How to find pixel location using ROIPOLY???

1 次查看(过去 30 天)
Hi everyone,
I think I am on the right track using roipoly because I want to use it to locate a ROI within a picture. My ROI happens to be a piece of paper. When I have used the roipoly function I am given a binary image with the piece of paper area showing up as white with the rest of the background black. How do I find out the dimensions or pixel locations of the corners of this area? Maybe counting the number of '1' pixels? I need to know the size of this area because then I will crop the original RGB image to this specific area and then I can run some image processing code just on that ROI in the original image? Hope that makes sense!
Many thanks,
Ellis

回答(1 个)

Adam
Adam 2016-5-17
The
[BW, xi, yi] = roipoly(...)
syntax for calling roipoly gives you the vertices of the polygon/roi in xi and yi. Are these not what you want?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by