Showing specific frame in a video file

hey I am trying to show a particular frame from video . I did following but it is showing error : Expected outputformat to match one of these strings: 'native', 'default' The input did not match any of the valid strings. Caused by: Error using validatestring>checkString (line 86) Expected input to be one of these types: char Instead its type was double.
vid1=VideoReader('D:\DDP\TEST\new.avi');
numofFrames=vid1.NumberOfFrames;
image=readFrame(vid1,numofFrames/2);
imshow(image);
Can someone help what I am doing wrong. and value of numofFrames=511.

 Accepted Answer

The deprecated method read() will accept an index.
readFrame() does not accept an index. The recommended interface is to set the currenttime property to the time corresponding to the frame and then readFrame from that. See http://www.mathworks.com/help/matlab/import_export/read-video-files.html

7 Comments

Thank you Walter.. This is exactly I was looking for. I have a binary video of man walking. Can you help me as to how I can determine the height of the man ? Attaching binary video
The height of the man is 19 zorkmids.
Walter, how did you find it ? Can you give some idea regarding it or show some code?
image is the name of a built-in function. You should not use it as the name of one of your variables.
The height is always 19 zorkmids. A zorkmid is the unit form of Finagle's Variable Constant.
Now if you want to compare the zorkmid to some other unit of measure, you need to supply information about the units of measure inherent in what is being measured.
Can you provide some links through which I can get the information?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!