马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
<br>网上载了一个读取YUV序列的MATLAB代码,但运行后出现错误,哪位可以帮忙看看啊?刚接触这个,拜托各位指教一下好吗?谢谢!!!!!!<br><br>close all;<br>clear<br>fid = fopen('D:\Sequence\akiyo_cif.yuv','r')<br>row=176*2;col=144*2;<br>frames=8; % total=300<br><br>for frame=1:frames<br>Y=zeros(row,col,frames);<br>U=zeros(row/2,col/2,frames);<br>V=zeros(row/2,col/2,frames);<br>UU=zeros(row,col,frames);<br>VV=zeros(row,col,frames);<br>[Y(:,:,frame),count] = fread(fid,[row,col],'uchar');<br>[U(:,:,frame),count1]=fread(fid,[row/2,col/2],'uchar');<br>[V(:,:,frame),count2]=fread(fid,[row/2,col/2],'uchar');<br>%fclose(fid)<br><br>%figure,imshow(Y);<br><br>UU(1:2:row-1,1:2:col-1,frame)=U(:,:,frame);<br>UU(1:2:row-1,2:2:col,frame)=U(:,:,frame);<br>UU(2:2:row,1:2:col-1,frame)=U(:,:,frame);<br>UU(2:2:row,2:2:col,frame)=U(:,:,frame);<br><br>VV(1:2:row-1,1:2:col-1,frame)=V(:,:,frame);<br>VV(1:2:row-1,2:2:col,frame)=V(:,:,frame);<br>VV(2:2:row,1:2:col-1,frame)=V(:,:,frame);<br>VV(2:2:row,2:2:col,frame)=V(:,:,frame);<br><br>R = Y + 1.140 * (VV-128 );<br>G = Y + 0.395 * (UU-128 ) - 0.581 *(VV-128);<br>B = Y + 2.032 *(UU-128);<br><br>for i=1:row<br>for j=1:col<br>if R(i,j,frame)<0<br>R(i,j,frame)=0;<br>end<br>if R(i,j,frame)>255<br>R(i,j,frame)=255;<br>end<br>if G(i,j,frame)<0<br>G(i,j,frame)=0;<br>end<br>if G(i,j,frame)>255<br>G(i,j,frame)=255;<br>end<br>if B(i,j,frame)<0<br>B(i,j,frame)=0;<br>end<br>if B(i,j,frame)>255<br>B(i,j,frame)=255;<br>end<br>end<br>end<br>R=R/255;G=G/255;B=B/255;<br>%X=[R',G',B'];<br>figure,imshow(R(:,:,frame)',G(:,:,frame)',B(:,:,frame)');<br>%M(frame) =im2frame(X,map);<br>end<br>%movie(M,10,30) <br><br><br>错误信息:<br><br><br>??? Error using ==> iptchecknargin<br>Function IMAGEDISPLAYPARSEINPUTS expected at most 2 input arguments<br>but was called instead with 3 input arguments.<br><br>Error in ==> imuitools\private\imageDisplayParseInputs at 117<br>iptchecknargin(0,2,num_args,mfilename);<br><br>Error in ==> imshow at 151<br> [cdata, cdatamapping, clim, map, xdata, ydata, ...<br><br><br> |