How to plot boundary on video frames called inside step() function
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Segmentation and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!