Convert a frame into image and use it as an input elsewhere
2 views (last 30 days)
Show older comments
I want to convert a frame into an image file. I am using the following code to acquire the frame, now i want to use that frame as an image file in my code, need help with that.. the code is
vid = videoinput('winvideo',1);
%here i want to take this frame as input image
but i am getting the following error
??? Error using ==> strfind
Input strings must have one row.
Error in ==> imread at 296
if (strfind(filename, '://'))
Please help me with this. or direct me to other solution
If you are going to imread() the image, you need to first imwrite() the frame into an image file.
imwrite(frame.cdata, frame.map, TheFileName);
where TheFileName is a string the specifies the name of the file to write.
Image Analyst on 3 May 2012
I'm not sure why you called imread() instead of just using the "frame" array directly in your subsequent code. If you want to use imread, then show your code for both imwrite and imread, but it's not really necessary unless you want to save the image to disk for some reason. Even if you did, you can continue to use "frame" and don't need to call imread at all.
Ah yes, I misread. (Can I blame it on the tail end of the cold I have?)
Find more on National Instruments Frame Grabbers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!