- https://in.mathworks.com/matlabcentral/answers/512025-how-do-i-apply-a-window-on-an-image-to-keep-the-part-in-the-window-while-reduce-the-resolution-clar (poly2mask example)
Cutting an image through its boundaries
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello, I'm a student working on my first image processing project and there is one question that has bugged me for a while.
I have this image that I'm suposed to process (https://imgur.com/a/c6k6yr3), and at first, I want to extract the elements to individual figures/images. I can do it easily using bwlabel ans regionprops.BoundingBox / imcrop in a for cicle for each N elements (https://imgur.com/a/ivkentP).
But with this methodology the rotaded elements are not extrated the way I want them to...I've tried also define the boundaries by using bwboudaries in a similar element-by-element analisys in a for cycle (https://imgur.com/a/aHaKtJZ) but then I can't find any way to 'cut' the image through those boundaries. Does anyone has some tips that can help me?
PS: I'm new here, so I'm not sure if I've given you enough information, but if I didn't please correct me.
Best regards,
Carlos M. Correia
0 comentarios
Respuestas (1)
Prabhan Purwar
el 27 de Mzo. de 2020
Hi,
After definning the boundaries using bwboudaries() try making use of poly2mask() under the for loop to crop out the interested region in image. In order to rotate the image make use of imrotate(). Get the edge points in resulted image using max and min value of the boundary and calculate the angle between the x-axis and line connecting the mid-points of the bounding box (as shown).
Hope it helps!!
Following links may help:
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!