- label the binary image with bwlabel
- call [column, row] = int32(ginput(1)) to let the user click somewhere
- get the label with labelNumber = labeledImage(row, column)
- extract the object with extractedObject = ismember(labeledImage, labelNumber)
- Make it binary again binaryImage = extractedObject > 0;
- display it with imshow(binaryImage, []);
How to select an object if you click it?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Dear all,
I have an image the contains few objects as I show here. I want that if the user click inside an object using the mouse then this clicked object will remain and all other objects will be removed from the image.
Is there someway to do that?
Any help will be appreciated.
Meshoo

0 Commenti
Risposta accettata
Image Analyst
il 15 Gen 2014
Yes. Follow these steps
2 Commenti
SC P
il 26 Nov 2018
Error came while running script"
Brace indexing is not supported for
variables of this type.
Error in boundin_box_26_11 (line 75)
Selec = [Selec{:}];
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!