LEADTOOLS Support
Imaging
Imaging SDK Questions
How to transform the barcode data's angle to the rotatecommand's angle?
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, August 3, 2009 11:49:20 PM(UTC)
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.
#2
Posted
:
Tuesday, August 4, 2009 2:47:01 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
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:23:21 PM(UTC)
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:07:57 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
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
LEADTOOLS Support
Imaging
Imaging SDK Questions
How to transform the barcode data's angle to the rotatecommand's angle?
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.