impossible d'executer ce programme :
Merci d'utiliser les différentes balises à ta disposition, dans ce cas cette balise est symbolisée par ceci:
yoda1234.
Code:function [video_mat,color_burst_mat]=video_extract(raw_video) %********************************************************************** % % THIS FUNCTION EXTRACT THE ACTIVE VIDEO AND THE COLOR BURST INFORMATION % FROM A BINARY FILE OF 27MHZ SAMPLED VIDEO. % % INPUT - RAW VIDEO BINARY FILE % % OUTPUT - 3D MATRIX OF ACTIVE VIDEO. EACH 2D MATRIX IS ONE FIELD % EACH RAW IS ONE VIDEO LINE % THE COLOR BURST MAT CONTAINS THE FREQUENCY AND PHASE IN EACH % VIDEO LINE %********************************************************************** % SAMPLING RATE IS 27MHZ MEANING 37ns PERIOD. [m,n]=size(raw_video); sync_threshold=800; %threshold for sync detection vsync_period_threshold=700; hsync_period_threshold=100; % First vertical sync detection vsync_flag=0; hsync_flag=0; vsync_progress=0; vsync_counter=0; hsync_counter=0; for i=1:m if raw_video(i) < sync_threshold vsync_counter=vsync_counter+1; if vsync_counter > vsync_period_threshold vsync_flag=1; end else if vsync_flag==1 vsync_progress=vsync_progress+1; vsync_flag=0; vsync_counter=0; if vsync_progress == 6 end_of_1st_vsync=i vsync_progress=0; break; end end end end % From end of VSYNC, detect every HSYNC and store active video field % from video lines 10-262 for field0 and 272-525 for field1 % End of VSYNC is at the end of line 6 % Lines 7,8,9 has equalizing pulses and HSYNC pulse every half line period active_pxl_per_line= 1440; line_number=0; field_number=1; hsync_low2active_video=round(9.2/0.037); %active video is 9.2us from falling edge of HSYNC hsync_low2color_burst=round(5.3/0.037); %color burst starts 5.3us from falling edge of HSYNC color_burst_length=round(10*(1/3.579545e6)/37e-9);%color burst length is 9+-1 cycles of 3.579545MHZ i=end_of_1st_vsync; while i<=m if raw_video(i) < sync_threshold hsync_counter=hsync_counter+1; vsync_counter=vsync_counter+1; if vsync_counter > vsync_period_threshold vsync_flag=1; end if (hsync_counter > hsync_period_threshold & hsync_counter < vsync_period_threshold) hsync_flag=1; else hsync_flag=0; end else % HSYNC case if hsync_flag == 1 line_number=line_number+1; start_of_active_vid=i-hsync_counter+hsync_low2active_video; video_mat(line_number,:,field_number)=... raw_video(start_of_active_vid:start_of_active_vid+active_pxl_per_line- 1); %Extracting the line color burst frequency start_of_color_burst=i-hsync_counter+hsync_low2color_burst; color_burst=raw_video(start_of_color_burst:start_of_color_burst+color_burst_length) ; cb_interp=interp(color_burst,100)-color_burst(1); cb_sign=sign(cb_interp)+1; cb_zero_cross=diff(cb_sign); [zero_index,s]=find(cb_zero_cross>0); color_burst_mat(line_number,1,field_number)=1/(mean(diff(zero_index(4:end- 4)))*37e-11); %color burst phase 1=0 degrees -1=180 degrees color_burst_mat(line_number,2,field_number)=cb_sign(700)/2; %reseting counters and progress i to the next line i=start_of_active_vid+active_pxl_per_line-1; vsync_counter=0; hsync_counter=0; hsync_flag=0; % VSYNC case elseif vsync_flag==1 vsync_progress=vsync_progress+1; vsync_flag=0; vsync_counter=0; hsync_flag=0; hsync_counter=0; if vsync_progress == 6 line_number=0; field_number=field_number+1 vsync_progress=0; end % Equalizing pulses case else vsync_counter=0; hsync_counter=0; end end i=i+1; end
aidez moi svp
-----