Looking for a fast image deskewing implementation

R
Posted By
Ramon
Mar 31, 2009
Views
1508
Replies
8
Status
Closed
I have 3 different implementations of image deskewing, and frankly I am not satisfied with their performance. The output files end up straight, but the process takes too long.

I know for a fact that this process can be done much faster because I have seen it in a couple of commercial programs (Adobe Acrobat Professional is one of them).

My files are B&W TIFF, sampled at 600dpi. They only contain text and tables. Nothing hard such as pictures.

Any pointers are most welcome.

TIA,

-Ramon F Herrera

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

MR
Mike Russell
Apr 1, 2009
On Tue, 31 Mar 2009 14:55:35 -0700 (PDT), Ramon F Herrera wrote:

I have 3 different implementations of image deskewing, and frankly I am not satisfied with their performance. The output files end up straight, but the process takes too long.
….
Have you tried using Photoshop using linear or nearest neighbor resampling? On my system this gives about 3X faster performance than bicubic, and the results are not that bad. Skewing is slow probably because it does a full affine transform instead, not just a skew operation.

Imagemagick is a freeware command line and scriptable graphics system that may do a reasonable job. Its performance is similar to Photoshop, but you never know til you try.

Mike Russell – http://www.curvemeister.com
L
lohith
Apr 2, 2009
On Apr 1, 2:55 am, Ramon F Herrera wrote:
I have 3 different implementations of image deskewing, and frankly I am not satisfied with their performance. The output files end up straight, but the process takes too long.

I know for a fact that this process can be done much faster because I have seen it in a couple of commercial programs (Adobe Acrobat Professional is one of them).

My files are B&W TIFF, sampled at 600dpi. They only contain text and tables. Nothing hard such as pictures.

Any pointers are most welcome.

TIA,

-Ramon F Herrera

Use leptonica library. This is very good, does it very fast. http://www.leptonica.com/

–lohith
R
Ramon
Apr 2, 2009
On Apr 2, 6:39 am, lohith wrote:
On Apr 1, 2:55 am, Ramon F Herrera wrote:

I have 3 different implementations of image deskewing, and frankly I am not satisfied with their performance. The output files end up straight, but the process takes too long.

I know for a fact that this process can be done much faster because I have seen it in a couple of commercial programs (Adobe Acrobat Professional is one of them).

My files are B&W TIFF, sampled at 600dpi. They only contain text and tables. Nothing hard such as pictures.

Any pointers are most welcome.

TIA,

-Ramon F Herrera

Use leptonica library. This is very good, does it very fast.http://www.leptonica.com/
–lohith

I have looked at the leptonica library. It shows a lot of potential, indeed, and it has a lot of interesting reading.

It has a huge problem, however. It doesn’t build on Linux, and it doesn’t build on Windows. It has lots of error messages, particularly at link time. I am not talking about my experience only. I have checked with several colleagues and don’t know a single one that has been able to run the examples provided.

That’s too bad, because it seems that it could become a very popular library.

-Ramon
L
lohith
Apr 3, 2009
On Apr 3, 2:58 am, Ramon F Herrera wrote:
On Apr 2, 6:39 am, lohith wrote:

On Apr 1, 2:55 am, Ramon F Herrera wrote:

I have 3 different implementations of image deskewing, and frankly I am not satisfied with their performance. The output files end up straight, but the process takes too long.

I know for a fact that this process can be done much faster because I have seen it in a couple of commercial programs (Adobe Acrobat Professional is one of them).

My files are B&W TIFF, sampled at 600dpi. They only contain text and tables. Nothing hard such as pictures.

Any pointers are most welcome.

TIA,

-Ramon F Herrera

Use leptonica library. This is very good, does it very fast.http://www.leptonica.com/

–lohith

I have looked at the leptonica library. It shows a lot of potential, indeed, and it has a lot of interesting reading.

It has a huge problem, however. It doesn’t build on Linux, and it doesn’t build on Windows. It has lots of error messages, particularly at link time. I am not talking about my experience only. I have checked with several colleagues and don’t know a single one that has been able to run the examples provided.

That’s too bad, because it seems that it could become a very popular library.

-Ramon

I am using it on fedora 8 ( linux ) system. It builds easily. Only that you have install the dev packages it uses, like gif, jpeg, png etc.
I have not tried it on windows.
Give it a try to compile and use it. It will be worth it. Just give the details of how you are installing, on what OS . Will try to help.

–lohith
R
Ramon
Apr 4, 2009
On Apr 3, 1:36 am, lohith wrote:
On Apr 3, 2:58 am, Ramon F Herrera wrote:

On Apr 2, 6:39 am, lohith wrote:

On Apr 1, 2:55 am, Ramon F Herrera wrote:

I have 3 different implementations of image deskewing, and frankly I am not satisfied with their performance. The output files end up straight, but the process takes too long.

I know for a fact that this process can be done much faster because I have seen it in a couple of commercial programs (Adobe Acrobat Professional is one of them).

My files are B&W TIFF, sampled at 600dpi. They only contain text and tables. Nothing hard such as pictures.

Any pointers are most welcome.

TIA,

-Ramon F Herrera

Use leptonica library. This is very good, does it very fast.http://www.leptonica.com/

–lohith

I have looked at the leptonica library. It shows a lot of potential, indeed, and it has a lot of interesting reading.

It has a huge problem, however. It doesn’t build on Linux, and it doesn’t build on Windows. It has lots of error messages, particularly at link time. I am not talking about my experience only. I have checked with several colleagues and don’t know a single one that has been able to run the examples provided.

That’s too bad, because it seems that it could become a very popular library.

-Ramon

I am using it on fedora 8 ( linux ) system.  It builds easily. Only that you have install the dev packages it uses, like gif, jpeg, png etc.
I have not tried it on windows.
Give it a try to compile and use it. It will be worth it. Just give the details of how you are installing, on what OS . Will try to help.

–lohith

Thanks for your kind assistance, lohith. You were absolutely right: the Leptonica library is remarkable. Allow me to elaborate. I have a TIFF viewer application which contains a "deskew" button, and have been searching for years all over for a decent deskewing implementation. I have found 3 so far, hiring programmers to implement them. My TIFF files are rather large and the fastest deskewing that I have takes about 1 minute. Well, following your advice I decided to give Leptonica’s implementation a try. My jaw dropped when I saw the performance: about 1 second. That’s the kind of performance that a GUI application requires!

This was just a quick thank-you note.

Will have some questions next.

-Ramon
R
Ramon
Apr 4, 2009
On Apr 3, 1:36 am, lohith wrote:
On Apr 3, 2:58 am, Ramon F Herrera wrote:

On Apr 2, 6:39 am, lohith wrote:

On Apr 1, 2:55 am, Ramon F Herrera wrote:

I have 3 different implementations of image deskewing, and frankly I am not satisfied with their performance. The output files end up straight, but the process takes too long.

I know for a fact that this process can be done much faster because I have seen it in a couple of commercial programs (Adobe Acrobat Professional is one of them).

My files are B&W TIFF, sampled at 600dpi. They only contain text and tables. Nothing hard such as pictures.

Any pointers are most welcome.

TIA,

-Ramon F Herrera

Use leptonica library. This is very good, does it very fast.http://www.leptonica.com/

–lohith

I have looked at the leptonica library. It shows a lot of potential, indeed, and it has a lot of interesting reading.

It has a huge problem, however. It doesn’t build on Linux, and it doesn’t build on Windows. It has lots of error messages, particularly at link time. I am not talking about my experience only. I have checked with several colleagues and don’t know a single one that has been able to run the examples provided.

That’s too bad, because it seems that it could become a very popular library.

-Ramon

I am using it on fedora 8 ( linux ) system.  It builds easily. Only that you have install the dev packages it uses, like gif, jpeg, png etc.
I have not tried it on windows.
Give it a try to compile and use it. It will be worth it. Just give the details of how you are installing, on what OS . Will try to help.

–lohith

I am going to ignore the Windows version for now, because that’s a different story altogether.

Leptonica installs easily on Linux, but I am having a problem building the samples. It seems that the authors make many calls to a function named "TIFFCleanup()" which is not present anywhere in the source code. Such function doesn’t seem to be part of ‘libtiff’ either. One of my attempts was to replace "TIFFCleanup()" by "TIFFClose()", but the applications cannot open TIFF files after such change.

My quick hack was simply to remove all the calls to TIFFCleanup(), and now the applications can be built. That solution, however, doesn’t sound too healthy (or pretty).

TIA,

-Ramon
R
Ramon
Apr 4, 2009
On Apr 4, 8:49 am, Ramon F Herrera wrote:
On Apr 3, 1:36 am, lohith wrote:

On Apr 3, 2:58 am, Ramon F Herrera wrote:

On Apr 2, 6:39 am, lohith wrote:

On Apr 1, 2:55 am, Ramon F Herrera wrote:

I have 3 different implementations of image deskewing, and frankly I am not satisfied with their performance. The output files end up straight, but the process takes too long.

I know for a fact that this process can be done much faster because I have seen it in a couple of commercial programs (Adobe Acrobat Professional is one of them).

My files are B&W TIFF, sampled at 600dpi. They only contain text and tables. Nothing hard such as pictures.

Any pointers are most welcome.

TIA,

-Ramon F Herrera

Use leptonica library. This is very good, does it very fast.http://www.leptonica.com/

–lohith

I have looked at the leptonica library. It shows a lot of potential, indeed, and it has a lot of interesting reading.

It has a huge problem, however. It doesn’t build on Linux, and it doesn’t build on Windows. It has lots of error messages, particularly at link time. I am not talking about my experience only. I have checked with several colleagues and don’t know a single one that has been able to run the examples provided.

That’s too bad, because it seems that it could become a very popular library.

-Ramon

I am using it on fedora 8 ( linux ) system.  It builds easily. Only that you have install the dev packages it uses, like gif, jpeg, png etc.
I have not tried it on windows.
Give it a try to compile and use it. It will be worth it. Just give the details of how you are installing, on what OS . Will try to help.

–lohith

I am going to ignore the Windows version for now, because that’s a different story altogether.

Leptonica installs easily on Linux, but I am having a problem building the samples. It seems that the authors make many calls to a function named "TIFFCleanup()" which is not present anywhere in the source code. Such function doesn’t seem to be part of ‘libtiff’ either. One of my attempts was to replace "TIFFCleanup()" by "TIFFClose()", but the applications cannot open TIFF files after such change.
My quick hack was simply to remove all the calls to TIFFCleanup(), and now the applications can be built. That solution, however, doesn’t sound too healthy (or pretty).

TIA,

-Ramon

The TIFFCleanup() function is part of the recent versions of libtiff.

-RFH
L
lohith
Apr 5, 2009
On Apr 5, 3:50 am, Ramon F Herrera wrote:
On Apr 4, 8:49 am, Ramon F Herrera wrote:

On Apr 3, 1:36 am, lohith wrote:

On Apr 3, 2:58 am, Ramon F Herrera wrote:

On Apr 2, 6:39 am, lohith wrote:

On Apr 1, 2:55 am, Ramon F Herrera wrote:

I have 3 different implementations of image deskewing, and frankly I am not satisfied with their performance. The output files end up straight, but the process takes too long.

I know for a fact that this process can be done much faster because I have seen it in a couple of commercial programs (Adobe Acrobat Professional is one of them).

My files are B&W TIFF, sampled at 600dpi. They only contain text and tables. Nothing hard such as pictures.

Any pointers are most welcome.

TIA,

-Ramon F Herrera

Use leptonica library. This is very good, does it very fast.http://www.leptonica.com/

–lohith

I have looked at the leptonica library. It shows a lot of potential, indeed, and it has a lot of interesting reading.

It has a huge problem, however. It doesn’t build on Linux, and it doesn’t build on Windows. It has lots of error messages, particularly at link time. I am not talking about my experience only. I have checked with several colleagues and don’t know a single one that has been able to run the examples provided.

That’s too bad, because it seems that it could become a very popular library.

-Ramon

I am using it on fedora 8 ( linux ) system.  It builds easily. Only that you have install the dev packages it uses, like gif, jpeg, png etc.
I have not tried it on windows.
Give it a try to compile and use it. It will be worth it. Just give the details of how you are installing, on what OS . Will try to help.

–lohith

I am going to ignore the Windows version for now, because that’s a different story altogether.

Leptonica installs easily on Linux, but I am having a problem building the samples. It seems that the authors make many calls to a function named "TIFFCleanup()" which is not present anywhere in the source code. Such function doesn’t seem to be part of ‘libtiff’ either. One of my attempts was to replace "TIFFCleanup()" by "TIFFClose()", but the applications cannot open TIFF files after such change.

My quick hack was simply to remove all the calls to TIFFCleanup(), and now the applications can be built. That solution, however, doesn’t sound too healthy (or pretty).

TIA,

-Ramon

The TIFFCleanup() function is part of the recent versions of libtiff.
-RFH

So the problem is solved.
great!!.

— lohith

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

Related Discussion Topics

Nice and short text about related topics in discussion sections