Straighten Scan

  • Follow


Hi,

Does anyone know of a script or plugin (Windows) that will straighten
a scanned image automatically?

thx,
Ed

0
Reply Ed 4/23/2004 11:11:56 PM

On Fri, 23 Apr 2004 16:11:56 -0700, Ed Bruck <gmb@canada.com> wrote:
....
>Does anyone know of a script or plugin (Windows) that will straighten
>a scanned image automatically?
What do you mean by "straighten"?

0
Reply Walter 4/24/2004 12:18:46 AM


On Sat, 24 Apr 2004 02:18:46 +0200, Walter Tross
<walter@waltertross.com> wrote:

>On Fri, 23 Apr 2004 16:11:56 -0700, Ed Bruck <gmb@canada.com> wrote:
>...
>>Does anyone know of a script or plugin (Windows) that will straighten
>>a scanned image automatically?
>What do you mean by "straighten"?

I should mentioned  that I need to straighten scanned documents.

Ed

0
Reply Ed 4/24/2004 12:30:03 AM

Ed Bruck <gmb@canada.com>, you wrote on Fri, 23 Apr 2004 16:11:56
-0700:

>Does anyone know of a script or plugin (Windows) that will straighten
>a scanned image automatically?

The best thing to do is to scan an image straight, because all digital
straightenings will visibly degrade the quality of the image.

Other than that, use the GIMP's rotation transform tool and set it to
corrective mode. You can then align the edges of the grid with the
edges of the image, and the GIMP will make sure the image gets rotated
correctly.

-- 
branko collin
- dr: "have you been exposed to any user interfaces designed by engineers?"
- woman: "yes"
- dr: "you have interface poisoning. you'll be dead within a week" (scott adams, dilbert)
0
Reply Branko 4/24/2004 1:40:02 AM

On Sat, 24 Apr 2004 03:40:02 +0200, Branko Collin <collin@xs4all.nl>
wrote:

>Ed Bruck <gmb@canada.com>, you wrote on Fri, 23 Apr 2004 16:11:56
>-0700:
>
>>Does anyone know of a script or plugin (Windows) that will straighten
>>a scanned image automatically?
>
>The best thing to do is to scan an image straight, because all digital
>straightenings will visibly degrade the quality of the image.
>
>Other than that, use the GIMP's rotation transform tool and set it to
>corrective mode. You can then align the edges of the grid with the
>edges of the image, and the GIMP will make sure the image gets rotated
>correctly.

I don't mind if there is some degradation in the documents I scan.
Years ago I used PaperPort that had an auto straightening feature.  I
believe PhotoShop has one as well. Looks like I'll have to keep doing
it manually.

thx,

Ed

0
Reply gmb 4/24/2004 5:14:07 AM

gmb@canada.com, you wrote on Fri, 23 Apr 2004 22:14:07 -0700:

>Years ago I used PaperPort that had an auto straightening feature.  I
>believe PhotoShop has one as well. Looks like I'll have to keep doing
>it manually.

How does such a feature work?

-- 
branko collin
- dr: "have you been exposed to any user interfaces designed by engineers?"
- woman: "yes"
- dr: "you have interface poisoning. you'll be dead within a week" (scott adams, dilbert)
0
Reply Branko 4/25/2004 12:50:01 PM

Hi Ed,

On Fri, 23 Apr 2004 16:11:56 -0700, Ed Bruck said:
> Does anyone know of a script or plugin (Windows) that will straighten
> a scanned image automatically?

This feature is called auto deskew, and I don't know of any GIMP plug-in
that does it (I was looking recently) - there certainly isn't one with
the main distribution. You might try on http://registry.gimp.org

Cheers,
Dave.

-- 
                David Neary,
        E-Mail: bolsh at gimp dot org
   Work e-mail: d dot neary at phenix dot fr
CV: http://www.redbrick.dcu.ie/~bolsh/CV/CV.html
0
Reply Dave 4/28/2004 6:23:07 PM

> >Years ago I used PaperPort that had an auto straightening feature.  I
> >believe PhotoShop has one as well. Looks like I'll have to keep doing
> >it manually.
> How does such a feature work?

You can use the Hough transform. (see
http://cs-alb-pc3.massey.ac.nz/notes/59318/l11.html)

Basically the hough transform works on a black and white image. For every
black pixel a line is calculated that goes through that specfic pixel and
every other black pixel in the image.
Then for all angles you count how many of these lines that has that specific
angle. The angle with the most lines is likely a good candidate for rotating
the image to make lines in a document be horizontal. This of corse requires
that the image is suitable for such a transform.

br,
Michael


0
Reply Michael 5/20/2004 9:44:54 AM

"Michael Lund" <milund@_fjern_kodehaj.dk>, you wrote on Thu, 20 May
2004 11:44:54 +0200:

>> >Years ago I used PaperPort that had an auto straightening feature.  I
>> >believe PhotoShop has one as well. Looks like I'll have to keep doing
>> >it manually.
>> How does such a feature work?
>
>You can use the Hough transform. (see
>http://cs-alb-pc3.massey.ac.nz/notes/59318/l11.html)
>
>Basically the hough transform works on a black and white image. For every
>black pixel a line is calculated that goes through that specfic pixel and
>every other black pixel in the image.
>Then for all angles you count how many of these lines that has that specific
>angle. The angle with the most lines is likely a good candidate for rotating
>the image to make lines in a document be horizontal. This of corse requires
>that the image is suitable for such a transform.

What happens if there are deformities in the scan, because of bulges
in the paper? For instance, if you are scanning a book, the paper
moves away from the scanning surface near the spine. Rendered in 2D,
the lines in your example would be diagonal near the spine (because
the letters would be rendered as sheared).

-- 
branko collin
- dr: "have you been exposed to any user interfaces designed by engineers?"
- woman: "yes"
- dr: "you have interface poisoning. you'll be dead within a week" (scott adams, dilbert)
0
Reply Branko 5/20/2004 11:18:58 AM

"Branko Collin" <collin@xs4all.nl> wrote in message
news:o44pa09a48nmofulsv51lgk41d37q416c8@4ax.com...
> "Michael Lund" <milund@_fjern_kodehaj.dk>, you wrote on Thu, 20 May
> 2004 11:44:54 +0200:
>
> >> >Years ago I used PaperPort that had an auto straightening feature.  I
> >> >believe PhotoShop has one as well. Looks like I'll have to keep doing
> >> >it manually.
> >> How does such a feature work?
> >
> >You can use the Hough transform. (see
> >http://cs-alb-pc3.massey.ac.nz/notes/59318/l11.html)
> >
> >Basically the hough transform works on a black and white image. For every
> >black pixel a line is calculated that goes through that specfic pixel and
> >every other black pixel in the image.
> >Then for all angles you count how many of these lines that has that
specific
> >angle. The angle with the most lines is likely a good candidate for
rotating
> >the image to make lines in a document be horizontal. This of corse
requires
> >that the image is suitable for such a transform.
>
> What happens if there are deformities in the scan, because of bulges
> in the paper? For instance, if you are scanning a book, the paper
> moves away from the scanning surface near the spine. Rendered in 2D,
> the lines in your example would be diagonal near the spine (because
> the letters would be rendered as sheared).

If the majority of the page isn't deformed (un-bulged? :-)) there should be
a good chance that the image will be rotated correctly so that the text away
from the spine will be horizontal. It will not straighten the lines so text
near the spine will be horizontal. I don't know any transforms that can do
that, but it is an interesting problem that could be fun to investigate.

At the university I once wrote an OMR program (OCR for music sheets), where
we tried to use the Hough transform to get the node lines to be horizontal.
It did work, but for that particular task it wasn't precise enough because
our images was too low resolution - it was in the good old days where 640kB
was the absolute maximum when programming for the PC :-)
We ended up with a solution where the user manually describe what was a
straight line...

br,
Michael


0
Reply Michael 5/20/2004 1:59:46 PM

> What happens if there are deformities in the scan, because of bulges
> in the paper? For instance, if you are scanning a book, the paper
> moves away from the scanning surface near the spine. Rendered in 2D,
> the lines in your example would be diagonal near the spine (because
> the letters would be rendered as sheared).

You might want to look at this paper:
http://www.comp.nus.edu.sg/labs/chime/da/paperdownload/zhang01icip.pdf

br,
Michael


0
Reply Michael 5/20/2004 2:43:20 PM

> > >Years ago I used PaperPort that had an auto straightening feature.  I
> > >believe PhotoShop has one as well. Looks like I'll have to keep doing
> > >it manually.
> > How does such a feature work?
> 
> You can use the Hough transform. (see
> http://cs-alb-pc3.massey.ac.nz/notes/59318/l11.html)

But does Photoshop really use that for auto-straightening? At least from
your description, it sounds quite computationally intensive.

--tml
0
Reply Tor 5/21/2004 8:31:05 AM

See
http://groups.google.fi/groups?selm=3A1A5D65.60E12BCF%40info.unicaen.fr
.. Sounds very simple. For a photographic image in general that is not a
line drawing, you presumably should apply an edge detection filter
first.

I wonder how well algorithmic automatic straightening (camera tilt
correction) would work for random photos? At least, if you shoot
cityscapes, houses, etc, you probably will have one or more hard edges
in the image that are supposed to be horizontal or vertical. But for
landscapes, unless you happen to include a piece of sea with the horizon
visible, presumably not.

--tml
0
Reply Tor 5/21/2004 9:43:51 AM

> > > >Years ago I used PaperPort that had an auto straightening feature.  I
> > > >believe PhotoShop has one as well. Looks like I'll have to keep doing
> > > >it manually.
> > > How does such a feature work?
> >
> > You can use the Hough transform. (see
> > http://cs-alb-pc3.massey.ac.nz/notes/59318/l11.html)
>
> But does Photoshop really use that for auto-straightening? At least from
> your description, it sounds quite computationally intensive.

It is. There are probably faster methods, where Hough is a very general
method - It can be changed to find other shapes like circles.

To answer your other posting, it probably isn't very good for correcting
tilted photos unless there are some well defined horizontal lines. So I
think for normal image enhancement you are better of rotating the image
manually.

/Michael


0
Reply Michael 5/21/2004 12:39:38 PM

13 Replies
705 Views

(page loaded in 0.25 seconds)

Similiar Articles:













7/22/2012 2:15:37 AM


Reply: