I believe that Magick has implemented the radon transform in the -deskew IM function.
There has been some current interest in the Hough transform, a cousin of the Radon transform, both of which can be used for extracting the orientation and location of straight lines in an edge image. see viewtopic.php?f=1&t=14491 In fact, the radon transform may be superior.
I was wondering what the feasibility and effort might be to take what is currently developed for -deskew and create a new IM function, -radon, that would take an edge extracted image as input and output the radon transform. The bright spots in the radon transform then represent the strongest edges in the image from which one could deduce the the orientations and locations of those edges.
see for example http://eivind.imm.dtu.dk/staff/ptoft/Radon/Radon.html
This is open for discussion and interest, but I would certainly like to hear from Magick about the complexity of such a task. Does -deskew actually create a radon transform image (in memory) before computing the deskew angles? I understand if this is not high priority. I am just curious if it is a major effort to separate it from -deskew and if I have assumed more than what was implemented in -deskew.
Thanks.
Radon Transform
Re: Radon Transform
The current implementation of the Radon transform for the -deskew option uses a bit mask (width / 8, height) and may not produce the same results as detailed in the paper. Instead we should probably just write a new method for the -radon option. If you post pseudo code here for taking an input image and computing the Radon result for each pixel, we'll code it up for you in ImageMagick 6.5.5-5 Beta so you can begin testing.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Radon Transform
Thanks. I will look into it and get back to you.
In the mean time, I found a radon transform plugin for ImageJ and tested it. It is limited to 180 1 degree projections so the image width is 180.
Here are the results on a very simple edge image:
test_edge.png
The sinogram result of the radon transform is:
which I thresholded at 50% to ensure that there were 4 bright dots as 2 are not obvious because they are right on the right edge of sinogram which probably represent the two nearly vertical lines:
The interesting thing about the radon transform is you can reverse it to regenerate the input:
In the mean time, I found a radon transform plugin for ImageJ and tested it. It is limited to 180 1 degree projections so the image width is 180.
Here are the results on a very simple edge image:
test_edge.png
The sinogram result of the radon transform is:
which I thresholded at 50% to ensure that there were 4 bright dots as 2 are not obvious because they are right on the right edge of sinogram which probably represent the two nearly vertical lines:
The interesting thing about the radon transform is you can reverse it to regenerate the input:
Re: Radon Transform
It would be very interesting the implementation of the radon transform in ImageMagick. In this page http://takinginitiative.wordpress.com/2 ... on-update/ there is a open source code in C++ implementing this technique.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Radon Transform
that code does not seem to exist