i want to display the coordinates of the centroid of the red components in video..uptil i have done the following code:
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Image Analyst
le 26 Avr 2015
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 commentaires
Voir également
Catégories
En savoir plus sur Camera Views dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!