Skip to main content
This object contains information about the pixel coordinates on the image at the moment when it was obtained from the ImageDocument object (the CoordinatesConverter property). It allows you to convert the pixel coordinates from one image modification state to another. You can use this object to convert the pixel coordinates between any two stages in the image processing. For example:
  1. Obtain this object directly after image opening, during which image skew was corrected.
  2. Apply a number of other modifications and obtain another instance of this object from the ImageDocument.
  3. Now you can convert pixel coordinates between the initially deskewed image plane and the modified image plane by twice applying the ConvertCoordinates method:
    • convert from the deskewed image plane to the original using the first instance of the CoordinatesConverter;
    • convert the result from the original image plane to the modified image plane using the second instance of the CoordinatesConverter.
The CoordinatesConverter object is a persistent object. This means that the object’s current state can be written to persistent storage. Later, the object can be re-created by reading the object’s state from the persistent storage. The following methods provide persistence of the object: Linux: SaveToFile, and LoadFromFile Windows SaveToFile, LoadFromFile, SaveToMemory, and LoadFromMemory.

Properties

NameTypeDescription
ApplicationEngine, read-onlyReturns the Engine object.

Methods

NameDescription
ConvertCoordinatesConverts coordinates of a pixel between different modification states or image planes of the ImageDocument.
LoadFromFileRestores the object’s contents from a file on disk.
LoadFromMemory <Note> Available for Windows. </Note>Restores the object’s contents from the global memory.
SaveToFileSaves the object’s contents into a file on disk.
SaveToMemory <Note> Available for Windows. </Note>Saves the object’s contents into the global memory.
CoordinatesConverter Object Diagram

Samples

Here is a Windows sample where this object is used to convert coordinates between two different modification states:

C#

FREngine.IEngine engine;
FREngine.IFRDocument frDoc;
// Skew correction is performed by default while adding the images to the document
frDoc.AddImageFile ("D:\\Sample.tif", null, null);
// Open ImageDocument of the first page
FREngine.IImageDocument imageDoc = frDoc.Pages[0].ImageDocument; 
// Create a snapshot of coordinates after opening
FREngine.ICoordinatesConverter convAfterOpening = imageDoc.CoordinatesConverter;
// Transform the image some more
imageDoc.Transform(FREngine.RotationTypeEnum.RT_Counterclockwise, false, false);
// Create a snapshot of coordinates after transformation
FREngine.ICoordinatesConverter convAfterModification = imageDoc.CoordinatesConverter;
...
// After some processing you find a pixel on the modified image plane whose coordinates you need to convert
int x, y;
convAfterModification.ConvertCoordinates(FREngine.ImageTypeEnum.IT_Base, FREngine.ImageTypeEnum.IT_Modified, ref x, ref y);
convAfterOpening.ConvertCoordinates(FREngine.ImageTypeEnum.IT_Modified, FREngine.ImageTypeEnum.IT_Base, ref x, ref y);
// now x, y contain the coordinates of the necessary point on the deskewed image plane
This object is also used in the Business Card Recognition code sample for macOS.

See also

ImageDocument Working with Images Working with Properties