How to remove specified part in image and count number of objects in the image
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jialin Men
le 29 Déc 2022
Commenté : Jialin Men
le 30 Déc 2022
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1246902/image.png)
Hello guys,
I would like to remove the part which is at the bottom right.
After that I need to caculate the number of objects in the image.
Thanks so much for your help in advance
0 commentaires
Réponse acceptée
Image Analyst
le 29 Déc 2022
You can erase the lower right corner of the image like this:
rgbImage(end-50 : end, end-100 : end, :) = 0;
There are more general ways to erase anything outside of the circle, but you don't need that if all you want to do is erase the micron bar and it's in the same location for all your images -- you can simply set that portion to zero like I did above.
However if you want to see the more general way, even though you don't need it, let me know. It probably involves imclose, imclearborder, and bwareafilt
7 commentaires
Image Analyst
le 30 Déc 2022
Yes it's easier because we don't have the zeros penetrating into the circle area, so it's easier to get the background mask. See attached.
You can get my interactive thresholding app here:
or else just segment the masked gray scale image however you were doing it instead of thresholding.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1247612/image.png)
Plus de réponses (1)
Sulaymon Eshkabilov
le 29 Déc 2022
See this solution post: https://www.mathworks.com/matlabcentral/answers/486087-remove-specific-objects-from-an-image
0 commentaires
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!