googlesamples / mlkit

A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Apache License 2.0
3.6k stars 2.94k forks source link

[Feature request] Absolute corner order on barcodes for 3D orientation tracking #892

Open trev3d opened 3 weeks ago

trev3d commented 3 weeks ago

I want to use this library for 3D position and orientation tracking of barcodes. The way barcode corner points are returned makes orientation tracking impossible. The library will 'sort' the clockwise order of barcode corners depending on the 'up' direction of the input image independent of the barcode orientation. If the barcode is 'upside-down' relative to the input image, the first point will still be the most top-left corner of the barcode relative to the input image.

What's your feature request? Please describe. I would like a way to get the corner points in order relative to the barcode itself rather than relative to the image. The index of each corner of the barcode should stay fixed as it rotates. If the barcode is turned upside-down relative to the image, then corner point [0] should be in the bottom-right corner of the code relative to the image.

In this gif, when I rotate the smartphone with the barcode sideways I want the text to rotate sideways as well. The current behavior of the barcode scanner will change the corner indices so the text is always upright relative to the image, but if an object is turned upside-down or sideways I want it to register as upside-down or sideways which is currently impossible. 381344946-522bc5ea-8b91-4ee9-91cd-0385fffc93a3

Mobile environment Both

Additional context