Prev: help needed to solve nonlinear decoupled matrix equations using fsolve.
Next: remove backgroud using global threshold
From: witek on 7 May 2010 11:52 Hi Chris, Having that stack trace below helps a lot. Notice the line about ffdshow. The MultimediaFileReader object relies on OS libraries and codecs installed on your system to read the multimedia files. It looks like the failure is happening in the ffdshow, which is a 3rd party piece of software. I'm guessing that you installed a larger codec pack on your system and either there is an issue with ffdshow or an interaction between the system object and the ffdshow. Try uninstalling ffdshow thus allowing your AVI to be handled by another codec on your system. BTW. Can you play your file with Windows Media Player? HTH, Witek Chris <chris_sar(a)hotmail.com> wrote: > Thank you very much Witek!! :) > > I believe the problem is that I cannot even read and play my own video..I tried your example ( Read a video and play it), with my own .avi file in the workspace that I have chosen, eg : > > C:\Program Files\MATLAB\R2010a\toolbox\vipblks\vipdemos > (where there are all the example videos!!) > > but I get the following error : > > MATLAB crash file:C:\Users\Chris\AppData\Local\Temp\matlab_crash_dump.4004: > > > ------------------------------------------------------------------------ > Segmentation violation detected at Thu May 06 08:09:16 2010 > ------------------------------------------------------------------------ > > Configuration: > MATLAB Version: 7.10.0.499 (R2010a) > MATLAB License: 161051 > Operating System: Microsoft Windows 7 > Window System: Version 6.1 (Build 7600) > Processor ID: x86 Family 6 Model 15 Stepping 2, GenuineIntel > Virtual Machine: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode > Default Encoding: windows-1252 > > Fault Count: 1 > > Register State: > EAX = 00000000 EBX = 0e20fac8 > ECX = 00c2c600 EDX = 26f50001 > ESI = 20532ccc EDI = 0e20fb24 > EBP = 0e20fb30 ESP = 00c2c5e0 > EIP = 30e82176 FLG = 00010216 > > Stack Trace: > [0] ffdshow.ax:0x30e82176(1, 83, 0, 0) > > If this problem is reproducible, please submit a Service Request via: > http://www.mathworks.com/support/contact_us/ts/help_request_1.html > > A technical support engineer might contact you with further information. > > Thank you for your help. MATLAB may attempt to recover, but even if recovery appears successful, > we recommend that you save your workspace and restart MATLAB as soon as possible. > > Then I choose "Attempt to continue" and I get the above error along with : > Caught MathWorks::System::FatalException > [Please exit and restart MATLAB]>> > > Thank you sooo much :) :) > You have been really helpful :) :)
From: Chris on 7 May 2010 12:19 Ohhh thank you soooooo much :) :) :) You are the best!! I finally managed to read my own .avi file with MultimediaFileReader!! 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...You reallyyy helped me so much.
From: Chris on 9 May 2010 06:52 Actually when I enter the last Stream processing loop : while ~isDone(hbfr) ................... end I get the error : ??? Error using ==> step Reported by video.MultimediaFileReader: Too many output arguments; must be between 1 and 2 (3 requested). Even if I enter only the very first part of the loop : while ~isDone(hbfr) [y, cb, cr] = step(hbfr); % Read input video frame [cb, cr] = step(hcr, cb, cr); imrgb = step(hcsc1, cat(3,y,cb,cr)); % Convert image from YCbCr to RGB image = step(hidtc, imrgb); % Convert image to single I = step(hcsc2, image); % Convert color image to intensity of = step(hof, I); % Estimate optical flow end or while ~isDone(hbfr) [y, cb, cr] = step(hbfr); % Read input video frame end I also get the same error... Thank you so much.
From: witek on 10 May 2010 11:17 Chris, The .bin file reader 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: > Actually when I enter the last Stream processing loop : > > > while ~isDone(hbfr) > > .................. > > > end > > > I get the error : > > > ??? Error using ==> step > Reported by video.MultimediaFileReader: Too many output arguments; must be between 1 and 2 > (3 requested). > > > Even if I enter only the very first part of the loop : > > while ~isDone(hbfr) > [y, cb, cr] = step(hbfr); % Read input video frame > [cb, cr] = step(hcr, cb, cr); > imrgb = step(hcsc1, cat(3,y,cb,cr)); % Convert image from YCbCr to RGB > image = step(hidtc, imrgb); % Convert image to single > I = step(hcsc2, image); % Convert color image to intensity > of = step(hof, I); % Estimate optical flow > end > > or > > while ~isDone(hbfr) > [y, cb, cr] = step(hbfr); % Read input video frame > end > > I also get the same error... > > Thank you so much.
From: Chris on 11 May 2010 11:30
Witek thank you so much for your focus and help. :) :) I managed to add my own video using the following code : while ~isDone(hbfr) my_rgb_frame = step(hbfr); % Read input video frame image = step(hidtc, my_rgb_frame); I = step(hcsc2, image); of = step(hof, I); % Estimate optical flow Thank you sooooo much!! I wish you the best. Chris |