Select shape from multiple closed borders in Image to obtain cell information/index from cell array B
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Import, Export, and Conversion 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!