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
댓글 수: 0
답변 (1개)
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?
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!