How to crop/mask image using matlab ?
Ältere Kommentare anzeigen
how to do cropping on an image ?

5 Kommentare
Armylia Dewi
am 15 Jun. 2022
KSSV
am 15 Jun. 2022
You want to mask the black pixel region?
Armylia Dewi
am 15 Jun. 2022
Armylia Dewi
am 15 Jun. 2022
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 9 Jul. 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);
Kategorien
Mehr zu Display Image finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

