Coordinate Normalization and Conversion¶
The coordinates provided in the output are normalized, meaning they are expressed as percentages relative to the image's dimensions. To obtain the actual x, y coordinates on an image, you must multiply the normalized coordinates by the image’s width and height, respectively.
This design choice was made to simplify working with images or thumbnails of various sizes. By using normalized coordinates, the same positions can be applied across different thumbnail sizes without needing to adjust the values.
Example Output¶
"position": {
"canvas": [
{
"x": 0.3859283930058285,
"y": 0.8843813387423936
},
{
"x": 0.5141548709408826,
"y": 0.8853955375253549
}
],
"sectional": [
{
"x": 0.39577836411609496,
"y": 0.3758519961051607
},
{
"x": 0.5989445910290238,
"y": 0.37682570593963
}
],
"sheet": [
{
"x": 0.2728921124206709,
"y": 0.384304932735426
},
{
"x": 0.36597159262617107,
"y": 0.3847533632286996
}
]
}
Canvas Example¶
The image below illustrates the conversion for the Canvas Coordinates. The dimensions of the Canvas are 2402 x 986 px.
In the example above:
The keys "canvas", "sectional", and "sheet" correspond to different thumbnails of the same drawing.
Each section contains normalized x, y coordinate pairs, which represent positions relative to the image's dimensions.
Converting Coordinates¶
To convert the normalized coordinates to pixel values for a specific thumbnail size: * Multiply the x value by the image width. * Multiply the y value by the image height.
This allows the coordinates to scale appropriately for any thumbnail size.