How to crop/mask image using matlab ?
Mostrar comentarios más antiguos
how to do cropping on an image ?

5 comentarios
Armylia Dewi
el 15 de Jun. de 2022
KSSV
el 15 de Jun. de 2022
You want to mask the black pixel region?
Armylia Dewi
el 15 de Jun. de 2022
Armylia Dewi
el 15 de Jun. de 2022
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 9 de Jul. de 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);
Categorías
Más información sobre Display Image en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

