Page 1 of 1

Radon Transform

Posted: 2009-08-27T18:39:01-07:00
by fmw42
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.

Re: Radon Transform

Posted: 2009-08-27T19:24:00-07:00
by magick
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.

Re: Radon Transform

Posted: 2009-08-27T19:54:46-07:00
by fmw42
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
Image

The sinogram result of the radon transform is:
Image

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:
Image

The interesting thing about the radon transform is you can reverse it to regenerate the input:
Image

Re: Radon Transform

Posted: 2009-11-20T14:31:54-07:00
by piponazo
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.

Re: Radon Transform

Posted: 2009-11-20T16:20:09-07:00
by fmw42
that code does not seem to exist