From: witek on 10 May 2010 11:20 Hi Chris, I'm reposting my response from your other thread on converting from .bin to .avi format: ======================================================== The .bin file reader in the original demo was set up to output YCbCr color signal that was Chroma sub-sampled. That signal was upsampled and converted to RGB. The YCbCr signal was output into three different arrays: Y, Cb and Cr (where Cb and Cr are smaller in size than Y). When you use the MultimediaFileReader, it gives you RGB output that's packed in a 3-D array, i.e. single variable output. Therefore, you need to do the following: 1. use a single variable to store you RBB output 2. remove chroma resampling 3. remove color space conversion to RGB since you already have RGB from the MultimediaFileReader 4. apply conversion to intensity on your new RGB signal (you will no longer need the cat(3,y,cb,cr), just feed your 3-D RGB signal directly to it). The error was basically saying: you asked for 3 outputs but I can give you only 1 or 2 (there is a way to get EOF indicator with this object). See the documentation for ChromaResampler to learn more about subsampled YCbCr color format. Your loop: while ~isDone(hbfr) [y, cb, cr] = step(hbfr); % Read input video frame end can be quickly made to work like this: while ~isDone(hbfr) my_rgb_frame = step(hbfr); % Read input video frame end ========================================================= Hope this helps, Witek Chris <chris_sar(a)hotmail.com> wrote: > Well, I finally managed to read my own .avi file with MultimediaFileReader by uninstalling the k-lite codec pack!! > > But now, at the end of the whole algorithm described here : > > http://www.mathworks.com/products/viprocessing/demos.html?file=/products/demos/shipping/vipblks/videotrafficof.html#1 > > When I enter the code : > > % Calculate and draw the motion vectors. > tmp = of(RV,CV) .* MotionVecGain; > lines = [X(:)';Y(:)';X(:)' + imag(tmp(:))';Y(:)' + real(tmp(:))']; > mv_video = step(hshapeins2, image, lines); > > step(hVideo1, image); % Display Original Video > step(hVideo2, mv_video); % Display video with motion vectors > step(hVideo3, th_image); % Display Thresholded Video > step(hVideo4, image_out); % Display video with bounding boxes > > I get the error message : > > ??? Error using ==> step > Reported by video.MultimediaFileReader: Too many output arguments; must be between 1 and 2 > (3 requested). > > I do not know what this means... > > Thank you so much... |