Select shape from multiple closed borders in Image to obtain cell information/index from cell array B
1 view (last 30 days)
Show older comments
rgbFrame = readFrame(VideoObject) ; % Read video frame in RGB
gFrame = rgb2gray(rgbFrame) ; % Convert frame to Grayscale
bwFrame = imbinarize(gFrame, 'adaptive' ) ; % Convert gFrame to bwFrame
bwFrame = bwareaopen( bwFrame , 100 ) ; % Remove noise from bwFrame
bwFrame = imfill(bwFrame, 'holes') ; % Fill holes
[B,L] = bwboundaries(bwFrame,'noholes') ; % Obtain shape boundaries
Using the code above, I obtain a cell array of B with the borders of several closed shapes in my video frame. I would like to display all of the shapes on an image, select with the cursor (Maybe "ButtonDownFcn"?) the intended shape, and create a new cell array called "Circle" with only the information from the intended shape.
0 Comments
Answers (0)
See Also
Categories
Find more on Import, Export, and Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!