How to plot boundary on video frames called inside step() function
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am calling some images inside for loop and then doing some processing on those images. After that i am using a step function to display those frames/masks inside a video player. How can i add a boundary to an object inside that frame/mask. Below is the rough sketch of the code.
videoPlayer = vision.VideoPlayer();
maskPlayer = vision.VideoPlayer();
for ii = 1:nfiles
filenameii = [............]
frame= imread(filenameii);
mask = dOB(frame,BackgroundImg);
% some processing on the images
mask= bwareaopen(mask,27);
boundaries = bwboundaries(mask,'noholes');
B=boundaries{1};
Centroid = regionprops(mask,'centroid');
Centroids = cat(1, Centroid.Centroid);
plot(B(:,2),B(:,1),'g','LineWidth',3);
plot(Centroids(:,1), Centroids(:,2), 'r+', 'MarkerSize', 10);
step(videoPlayer,frame);
step(maskPlayer, mask);
end
I want the boundary B to be plotted on the mask image that i am calling inside step function.
P.S: I know how to display it on a figure using hold on and i am using MATLAB. Any guidance will be appreciated.
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Image Segmentation and Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!