Filter löschen
Filter löschen

How to find pixel location using ROIPOLY???

1 Ansicht (letzte 30 Tage)
Ellis Berry
Ellis Berry am 17 Mai 2016
Beantwortet: Adam am 17 Mai 2016
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

Antworten (1)

Adam
Adam am 17 Mai 2016
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