i want to display the coordinates of the centroid of the red components in video..uptil i have done the following code:
4 次查看(过去 30 天)
显示 更早的评论
a = imaqhwinfo; [camera_name, camera_id, format] = getCameraInfo(a); vid = videoinput(camera_name, camera_id, format); set(vid, 'FramesPerTrigger', Inf); set(vid, 'ReturnedColorspace', 'rgb') vid.FrameGrabInterval = 1; start(vid) while(vid.FramesAcquired<=100) data = getsnapshot(vid); diff_im = imsubtract(data(:,:,1), rgb2gray(data)); diff_im = medfilt2(diff_im, [3 3]); diff_im = im2bw(diff_im,0.17); diff_im = bwareaopen(diff_im,300); stats = regionprops(bw, 'Centroid');
0 个评论
回答(1 个)
Image Analyst
2015-4-26
OK. Do you have a question? To display coordinates you can use fprintf(), msgbox(), helpdlg(), or use sprintf() and set() to send a string to a label in your GUI.
There are File Exchange submissions on this. And for what it's worth, attached is my demo for tracking a green Sharpie marker in a video.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!