Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, October 23, 2011 3:40:12 AM(UTC)

URso5  
URso5

Groups: Registered
Posts: 6


At first,plz Forgive my bad English.

I have a document image.It's format is ".JPG",I want to Deskew it.

the image's BitsPerPixel is 24,if i run the DeskewCommand directly,the Rotation angle will be very big.

For a better results--

1st Load the JPEG image and run the AutobinarizeCommand and save it as a TIF image (BitsPerPixel=1).

2nd load the TIF image,run the DeskewCommand and get the Accurate angle.

3rd run the RotateCommand on the JPG image with the angle from step 2nd.

It works,but waste time.there is Thousands of image to handle.

Is there a better way?

May I change the BitsPerPixel of the RasterImage from 24 to 1?

May I change the format of the RasterImage from JPEG to TIF ? JPEG do not Support the BitsPerPixel=1.

if i could change it ,i will not do save the TIF image (BitsPerPixel=1),and it will save my time.

my Leadtools is V 16.5
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, October 23, 2011 6:47:37 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


You don't need to save the image as TIFF to convert it to black and white. The process of saving then loading adds extra time that you don't need to lose for each image.
A better approach will be:
1) Load the JPEG Image as 24-bit.
2) Make a copy of the image as Image2, for example, using the RasterImage.Clone method.
3) Use AutoBinarize on Image2.
4) Calculate deskew angle for Image2 without rotating it using the ReturnAngleOnly flag.
5) Rotate Original Image using angle from Step 4.
6) Dispose Image2.

 
#3 Posted : Sunday, October 23, 2011 7:51:00 AM(UTC)

URso5  
URso5

Groups: Registered
Posts: 6


thx,but Even if image2 convert to black and white,but is BitsPerPixel still 24. In this case, the return Angle from Step 4 is as big as color image, I must change the BitsPerPixel from 24 to 1,when the BitsPerPixel of the image is 1,i will get the angle what i want.

1)rasterimage.BitsPerPixel=1
2) black and white image
the 2 conditions are indispensable
 
#4 Posted : Monday, October 24, 2011 3:57:03 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


Hi,
After using AutoBinarizCommand in step3, use the ColorResolutionCommand to change from 24 to 1 bit-per-pixel.
When doing that, use the Fixed Palette option to always ensure the resulting image is pure black and white.
Then continue the rest of the steps.
 
#5 Posted : Monday, October 24, 2011 4:53:20 AM(UTC)

URso5  
URso5

Groups: Registered
Posts: 6


thank you Daoud .thank you very much.

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.063 seconds.