GetTransformationParameters method (Main Control)
Builder Syntax |
int GetTransformationParameters(PPoint pRefPoints, PPoint pTrnsPoints, int &nXTranslation, int &nYTranslation, int &nAngle, unsigned &uXScale, unsigned &uYScale); |
Delphi Syntax |
Function GetTransformationParameters (pRefPoints: pPOINT; pTrnsPoints: pPOINT; var nXTranslation: L_INT; var nYTranslation: L_INT; var nAngle: L_INT; var uXScale: L_UINT; var uYScale: L_UINT): L_INT; |
Overview |
Refer to Detecting Registration Marks |
Remarks
(Document/Medical) Computes the rotation angle, XY scaling, and XY translation of the transformed bitmap with comparison to the reference bitmap. These are the transformations that would have to be performed to the reference bitmap to have it match the current bitmap.
This method detects transformation parameters of the transformed bitmap by comparing it with the reference bitmap. The number of reference and detected points must be three.
Use GetMarksCenterMass to fill the pRefPoints array with the points representing the center of masses for each of the reference marks from the reference bitmap.
Fill the pTrnsPoints array by performing the following steps:
Use SearchRegMarks to find the new positions
for the reference marks
Use GetMarksCenterMass to fill the pTrnsPoint
array with points representing the center of masses for each of the transformed
reference marks.
The values used to update pnXTranslation, pnYTranslation, pnAngle, puXScale and puYScale are internally divided by 100. For example, if the variable pointed to by pnAngle is 500, the actual angle of rotation is 5 degrees clockwise.
The values obtained by this method must be sent, without any modification, to the ApplyTransformationParameters method in order to correct the image.
If you want to correct the image yourself, you have to perform the inverse operations in this order:
Shift the image by (-*pXTranslation / 100,
-*pYTranslation / 100) using Combine or CombineExt
Rotate without resizing by -(*pnAngle)
Resize using scaling factors of (100 / *puXScale,
100 / *puYScale) using Size or Resize
If you simply want to automatically straighten a bitmap, use the Deskew method.
This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
See Also
Elements: |
Combine method, Rotate method, Size method, IsRegMark method, SearchRegMarks method, GetMarksCenterMass method, ApplyTransformationParameters method |
Topics: |