Hi,
Can someone explain this:
Deskew geometry=>string,threshold=>double
I don't understand what it's looking for. I always got the results I got from the command line with simply -deskew 40%, but I'm unsure how to get the same results with PerlMagick (geometry of what? threshold of 0.0-1.0, or 0-100, ?).
Thanks!
Deskew() in Perl
-
- Posts: 3
- Joined: 2011-01-15T02:57:05-07:00
- Authentication code: 8675308
Re: Deskew() in Perl
Use $image->Deskew('40%'). If you use the threshold parameter it is scaled from 0 to QuantumRange. For the Q16 version of ImageMagick, use a value from 0 to 65535.
-
- Posts: 3
- Joined: 2011-01-15T02:57:05-07:00
- Authentication code: 8675308
Re: Deskew() in Perl
Thanks for the reply.
Unfortunately, that was the first thing I tried. I get my tif, but it does no Deskewing.
ImageMagick-6.6.7-0
ImageMagick-perl-6.6.7-0
ImageMagick-devel-6.6.7-0
Unfortunately, that was the first thing I tried. I get my tif, but it does no Deskewing.
Code: Select all
sub do_magick {
my $im = Image::Magick->new;
my $ppm = $_[0];
$im->Read($ppm);
$im->Deskew('40%');
$im->Write($basenm . "_pldk.tif");
}
ImageMagick-perl-6.6.7-0
ImageMagick-devel-6.6.7-0
Re: Deskew() in Perl
ImageMagick cannot deskew every image. It is sensitive to the image and the threshold. Post a URL to your image here so we can reproduce the problem and trace why ImageMagick does not discover the deskewing factor.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Deskew() in Perl
From my limited experience with -deskew (in command line) it works best for images rotated or skewed less than 5 degrees. Above that the results are problematic. I have an unrotate bash shell script that works for larger rotations (see link below). But I have no idea how to convert it to PerlMagick.
-
- Posts: 3
- Joined: 2011-01-15T02:57:05-07:00
- Authentication code: 8675308
Re: Deskew() in Perl
I'll try to get a non-company document working sample.
Just to add, the document I am trying in Perl deskews perfectly with convert.
Just to add, the document I am trying in Perl deskews perfectly with convert.