How to plot boundary on video frames called inside step() function

조회 수: 2 (최근 30일)
BlueBee77
BlueBee77 2017년 1월 25일
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개)

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by