how to calculate perimeter on RGB picture??

조회 수: 4 (최근 30일)
BSantos
BSantos 2013년 8월 1일
Hello everyone!
I would like to ask for your help, once again!
In my project, I have to draw a circumference on a RGB picture, and calculate the intensity of that picture within that circumference (circle) and ON the circumference. The circle part, I can do it, but on the circumference not.
The issue is that, if the radius it's not an integer, the function does not count with the decimal part. Here's a picture to illustrate my issue.
Thanks!!!
BR,
BS.

답변 (2개)

Image Analyst
Image Analyst 2013년 8월 1일
I don't know what "The circle part, I can do it, but on the circumference not." means. Do you have the coordinates of the outside perimeter (circumference) of the circle? If so, use poly2mask to create a binary image from it, then call regionprops and ask for MeanIntensity. It's like 2 lines of code.
  댓글 수: 4
Image Analyst
Image Analyst 2013년 8월 1일
Responding to your Answer, if "within that circumference" actually means "on the perimeter" rather than "anywhere within the entire disk" then you can use the faq to get the perimeter pixels only, rather than a solid disc. Then use the same code. Nothing I gave in the code above is in the Image Processing Toolbox.
BSantos
BSantos 2013년 8월 2일
Thank you Image Analyst! I will give it a try.
Best regards, BS.

댓글을 달려면 로그인하십시오.


BSantos
BSantos 2013년 8월 1일
Image Analyst,
Thank you but this doesn't help much. I can create the circle (or disk), the issue is for those pixels that are on the border (let's call it like that), in case of non integer radius.
Plus, I don't have Image Processing Toolbox, so I can't use most of the functions that could actually solve this in 10secs(??)!
Help anyone???

Community Treasure Hunt

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

Start Hunting!

Translated by