How to extract diagonal line data from image
23 views (last 30 days)
Show older comments
Hello,
I am having some difficult attempting to extract point data from a set of diagonal lines. The lines should be perfectly vertical, but unfortunately because of experimental parameters beyond my control, it's slightly tilted CW. It's a very simple problem but with a solution I find difficult to implement (at least I can't figure it out too well). Attached is the image I have for context with a Hough transform applied to show some lines. X and Y axes are pixel counts (the whole image is the total size of the CCD chip). The Hough transform procedure to see the lines only give me the end points, which is obviously not sufficient.
Naturally it would be easy if the lines were aligned along the Y axis on an XY axis plot, just take all the points along Y for a single X value. But doing it diagonally seems to make the problem extremely more difficult. One would just think of getting the data along the appropriate Y = m*X + b line, but if the slope m is super steep, that would mean I need much more resolution along X to properly resolve Y if it were vertical.
How would I be able to apply an algorithm such that the line drawn along the plot would be able to capture most if not all the points that would be if the lines were vertical? Maybe the Hough transform procedure has this info stored and I just need to extract it? Any assistance would be really appreciated!
0 Comments
Answers (2)
Image Analyst
on 10 Nov 2019
Edited: Image Analyst
on 10 Nov 2019
Your image is a perfect place where the radon transform would be used. Basically the radon transform rotates the image through a series of angles that you specify to get projections. Then you get an image with distance versus angle. You can look at each angle (column) in the image to find out which angle gives the brightest average value by taking the mean along the rows to get the mean for each column. The column (i.e. angle) with the brightest mean is the angle you want. I'm attaching a demo, which uses the football demo image not yours, but you can easily adapt it.
2 Comments
Image Analyst
on 11 Nov 2019
Well, most people wouldn't think of it. Maybe that's why they won a Nobel prize for it - figuring out how to do CT using the Radon Transform.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!