How to crop/mask image using matlab ?
Afficher commentaires plus anciens
how to do cropping on an image ?

5 commentaires
Armylia Dewi
le 15 Juin 2022
KSSV
le 15 Juin 2022
You want to mask the black pixel region?
Armylia Dewi
le 15 Juin 2022
Armylia Dewi
le 15 Juin 2022
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 9 Juil 2022
See my attached lung segmentation demo.

It should be easy for you to adapt even though your images are in a different orientation.
Once you have the mask, you can crop your image to the bounding box of just the lungs like this
[r, c] = find(mask);
row1 = min(r);
row2 = max(r);
col1 = min(c);
col2 = max(c);
croppedImage = maskedImage(row1:row2, col1:col2);
Catégories
En savoir plus sur Image Segmentation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

