This code shows how to detect and track white colored object in LIVE video using MATLAB.
For deteil documentation please refer to:
For video tutorial please refer to:
how to convert it to simulink ?
vidDevice = imaq.VideoDevice('winvideo', 1, 'YUY2_1280x720', ... % Acquire input video stream 'ROI', [1 1 640 480], ... 'ReturnedColorSpace', 'rgb'); i have an error in code it says undefined variable "imaq" or class "imaq.videoDevice"
i am using R2010a version and i am using windows 7
Please help to track a black coloured objects
can you explain me for this :
Undefined variable "vision" or class "vision.BlobAnalysis".
Error in white (line 14)
hblob = vision.BlobAnalysis('AreaOutputPort', false, ... % Set blob analysis
i'm stuck with it, kindly please help me :)
Hello, I tried to run this code but constantly an error occurs saying there is an error in this line::
Error: rgbFrame = step(vidDevice);
and also i get this which i am unable to resolve::
Error in tempdir (line 31)
curr_dir = cd(tmp_dir);
and I checked all along the code evrything seems fine. Could you let me know what should I do?
Ya thanks dude. It worked.. :)
Now If need to change the color of the detected white objects into grey color of some other rgb colors format, what should i do???.
Are there any possibilities to do such type of processing. ???
@Jenisten Stark: Yes, surely. You have to release the video input handle. In this case put the following line at the end of your code.
one more help dude... My webcam's still on even if i finish running ur code also. so i had to close matlab completely and then again start it fresh...
So is der any command or code to stop this process alone without closing matlab completely..
Rate this Submission
Matlab R2012a works awsum... !!!
Thank u for ur guidance dude...
@Jenisten Stark: From R2012a onward Image Acquisition Toolbox handles are prefixed by imaq.. So if you are using R2009 version, try to use videoinput('winvideo',1,'YUY2_640x480')
Probably it will fix the problem.
But still you don't have Computer Vision Toolbox. So its better to upgrade your version.
Thank U For ur reply dude... And Actually, I've got imaq tool box. I used this tool and then only set the video input command to YUY2_640x480 resolution.
But Computer Vision System Toolbox is missing in my version. Is it possible to download that tool box alone or should i change the version for using it??
@Jenisten Stark: Its showing the error because in your MATLAB version, 'Image Acquisition Toolbox' is not available. The word 'imaq' stands for 'Image Acquisition Toolbox'.
Probably you don't have 'Computer Vision Toolbox' as well. The word 'vision' stands for it.
These toolbox are included in MATLAB R2012a onward.
I'm using R 2009 version and it shows
??? Undefined variable "imaq" or class "imaq.VideoDevice".
Error in ==> white at 10
vidDevice = imaq.VideoDevice('winvideo', 1, 'YUY2_640x480', ... %
Acquire input video stream
Think some tool boxes are missing in this version.
What tool boxes are required for this program...
Nice, Thanks a lot.