how to calculate perimeter on RGB picture??
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
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
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!