Intensities along border of cylindrical object
4 views (last 30 days)
Show older comments
Hi,
I want to measure and plot the intensities of a signal along the border of a cylindrical object.
The plot should be intensities over border length/coordinate. I have a lot of objects that kind of look like in the picture. They are orientated in all kinds of directions. My algorithm so far as an outline:
- Segmentation of objects
- Create label image
- Get region properties via regionprops ( Here I'm mainly interested in all the ellipse related values)
- Then for each objects get the Centroid and compute the point where the ellipse main axis intersects with the border of the object
- Walk along the border of each object using bwtraceboundary
- With these Locations measure intensities of these points
With this I have two major problems right now: First I get the centroid and compute the intersection point using MajorAxisLength*sind(Orientation) and *cosd(Orientation). But this gives me a numerical value like 4.8 22.4 What would a good way to find the nearest nonzero pixel of the perimeter image? (Image with only object border)
My second problem is that in this approach I will only get the intensities along a one pixel line. I would prefer to get the average along the line of a certain width, say 5 pixels. My idea would be to just do the trace, subtract the perimeter and then do the trace again so and so many times and then average the intensity values of corresponding values. But this sounds rather inefficient. Would there be a better way to address this?
Thank you very much for your help!
0 Comments
Answers (1)
Image Analyst
on 27 Oct 2014
I'd threshold, fill, find the centroid. Then use improfile() to send out rays from the centroid at a bunch of angles between 0 and 360 degrees. Then get the average of the non-zero values. Not too hard. Give it a shot. If you can't figure it out, come back and ask. Or if you need something more accurate (because the shape is not always perpendicular to the rays at the intersection point) - there are more complicated and accurate ways.
6 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!