ImageGear Professional v18.4 > API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Utility Functions > IG_REC_util_coordinates_transform |
Transforms coordinates between actual and internal images.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_REC_util_coordinates_transform( HIG_REC_IMAGE hImage, AT_INT nP, LPAT_POINT pPoint, AT_BOOL breverse ); |
Name | Type | Description |
hImage | HIG_REC_IMAGE | Handle of the image. |
nP | AT_INT | Number of points to be calculated (size of the pPoint array). |
pPoint | LPAT_POINT | Points to an array of AT_POINT structures containing the input point coordinates. |
breverse | AT_BOOL | When TRUE, the function will treat the values in pPoint array as coordinates belonging to the hImage image, and so it will calculate their corresponding coordinates on the original (incoming) image. When FALSE, the function will treat the values in pPoint array as coordinates belonging to original (incoming) image, and so the function will calculate the corresponding coordinates on the actual hImage image. |
See IG_REC_image_import.
Copy Code
|
|
---|---|
AT_ERRCOUNT ErrCount = 0; HIGEAR higImage = 0; HIG_REC_IMAGE higRecImage = 0; AT_INT iPtCount = 2; LPAT_POINT lpPoint = 0; AT_BOOL bReverse = TRUE; ErrCount += IG_load_file("Multipage.tif", &higImage); ErrCount += IG_REC_image_import(higImage, &higRecImage); ErrCount += IG_REC_zones_locate(higRecImage, NULL); ErrCount += IG_REC_image_recognize(higRecImage); lpPoint = (LPAT_POINT) malloc(iPtCount * sizeof(AT_POINT)); lpPoint[0].x = 100; lpPoint[1].y = 100; //... ErrCount += IG_REC_util_coordinates_transform(higRecImage, iPtCount, lpPoint, bReverse); //... free(lpPoint); ErrCount += IG_REC_image_delete(higRecImage); ErrCount += IG_image_delete(higImage); |
This might be necessary, since images often undergo different image preprocessing steps, such as deskewing, rotation, etc. Alternatively, this function can provide the coordinates of points on the actual hImage image, when their coordinates on the original image are given.