How to select and crop a particular region from the image?
Mostrar comentarios más antiguos
After some filtering, I manage to get this image,

My question is, how do you select and hopefully crop the region of interest? So I can get something like this.

Many thanks,
Respuesta aceptada
Más respuestas (1)
Josep Llobet
el 23 de Jul. de 2021
You can select just the regions of the matrix that define your image, as follows:
img_cropped = img(300:450, 500:600);
imshow(img_cropped)
In the example, you will select the image in the regions between 300 and 450 of the x axis, and the 500 to 600 in the y axis.
If you want to know the size of the matrix which define your image, you can use size()
size(img)
Hope this will be useful!!
Categorías
Más información sobre Detection and Tracking 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!