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 : Monday, August 3, 2009 11:54:20 PM(UTC)
ThomasLau

Groups: Registered
Posts: 10


I want to correct an image's skew by using barcode data's angle.It's wrong if I use the barcode data's angle directly.barcode data's angle to the rotatecommand's angle?

Best regards.
 

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 : Tuesday, August 4, 2009 2:52:01 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Do you mean that you want the RotateCommand Class to look for a Barcode in the image and then figure out by what angle the image needs to be tilted so that the barcode would be straight?

If you are using the latest LEADTOOLS v16 or v16.5, you might be able to do this by using the _barcodeEngine.Read method to read the barcode in the image as follows:
RasterCollection<BarcodeData> barcodeData = _barcodeEngine.Read(...);

Then, you can get the Angle of the barcode by using the barcodeData[0].Angle property, and then you can rotate the image with that angle in the reverse direction to fix the image.

If you mean something else, please provide me with more details about your requirements.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Tuesday, August 4, 2009 4:28:21 PM(UTC)
ThomasLau

Groups: Registered
Posts: 10


I'm using the LEADTOOLS V16.5. My final target is correct an image's skew.
At first, I use BarcodeEngine to get the BarcodeData of the image.Then I rotate the image by using the barcodedata.Angle property to correct the image's skew.But,I find that the barcodedata.Angle property can't be used to rotate image directly,bucause I always get a wrong result,the image  is still
 skew.
I think that the Angle of barcodedata has a different original point from image's original point.
 
#4 Posted : Wednesday, August 5, 2009 2:12:57 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

The RotateCommand works correctly when you pass the negative of the angle value (which is -barcodeData[0].Angle) to the RotateCommand.Angle property. Try the following code:
---------------
RasterCollection barcodeData = _barcodeEngine.Read(childFrm._viewer.Image,
area,
_readBarcodeTypes,
_unit,
_barcodeReadFlags,
_readMaxBarcodesCount,
_barcodeRead1d,
_barcodeReadPDF,
_barcodeReadColor);

Leadtools.ImageProcessing.RotateCommand rotate = new RotateCommand();
rotate.Angle = -barcodeData[0].Angle;
rotate.Run(childFrm._viewer.Image);
---------------

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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-2020, Yet Another Forum.NET
This page was generated in 0.143 seconds.