Recognised diagrams are returned at a smaller size than the input shape
J
J Elmstone
started a topic
over 4 years ago
Hello,
I am attempting to use diagram recognition using the SDK REST API. The resulting shape primitives I am getting from the API are returning a shape that is around 30-40% the size of the input shape strokes.
This is the body I am sending with 'application/vnd.myscript.jiix' in the Accept header
Is there a way of getting the recognised diagram to be a somewhat similar size to the input shape?
Best Answer
G
Gwenaelle @MyScript
said
over 4 years ago
Hello Jacob,
Thank you for contacting us.
The “input coordinates” of the strokes in the REST request body are in pixels, while those exported in the JIIX file in the REST response are in millimeters. For further details please, check this page about strokes and this one about jiix format.
By default, the input resolution is 96 DPI. To convert from millimeters to pixels, you shall compute the coordinates from the JJIX as follows: Pixel = mm * 96/25.4
Of course, if you set another resolution than 96 (e.g. 300 DPI), you shall adapt the formula accordingly: Pixel = mm * 300/25.4
Regards,
Gwenaëlle
1 Comment
G
Gwenaelle @MyScript
said
over 4 years ago
Answer
Hello Jacob,
Thank you for contacting us.
The “input coordinates” of the strokes in the REST request body are in pixels, while those exported in the JIIX file in the REST response are in millimeters. For further details please, check this page about strokes and this one about jiix format.
By default, the input resolution is 96 DPI. To convert from millimeters to pixels, you shall compute the coordinates from the JJIX as follows: Pixel = mm * 96/25.4
Of course, if you set another resolution than 96 (e.g. 300 DPI), you shall adapt the formula accordingly: Pixel = mm * 300/25.4
J Elmstone
Hello,
I am attempting to use diagram recognition using the SDK REST API. The resulting shape primitives I am getting from the API are returning a shape that is around 30-40% the size of the input shape strokes.
This is the body I am sending with 'application/vnd.myscript.jiix' in the Accept header
Is there a way of getting the recognised diagram to be a somewhat similar size to the input shape?
Hello Jacob,
Thank you for contacting us.
The “input coordinates” of the strokes in the REST request body are in pixels, while those exported in the JIIX file in the REST response are in millimeters. For further details please, check this page about strokes and this one about jiix format.
By default, the input resolution is 96 DPI. To convert from millimeters to pixels, you shall compute the coordinates from the JJIX as follows:
Pixel = mm * 96/25.4
Of course, if you set another resolution than 96 (e.g. 300 DPI), you shall adapt the formula accordingly: Pixel = mm * 300/25.4
Regards,
Gwenaëlle
Gwenaelle @MyScript
Hello Jacob,
Thank you for contacting us.
The “input coordinates” of the strokes in the REST request body are in pixels, while those exported in the JIIX file in the REST response are in millimeters. For further details please, check this page about strokes and this one about jiix format.
By default, the input resolution is 96 DPI. To convert from millimeters to pixels, you shall compute the coordinates from the JJIX as follows:
Pixel = mm * 96/25.4
Of course, if you set another resolution than 96 (e.g. 300 DPI), you shall adapt the formula accordingly: Pixel = mm * 300/25.4
Regards,
Gwenaëlle
1 person likes this