Radon Transform

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Radon Transform

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Radon Transform

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Radon Transform

Post 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
piponazo

Re: Radon Transform

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Radon Transform

Post by fmw42 »

that code does not seem to exist
Post Reply