googlesamples / googlesamples/mlkit

[Bug report] corner points of text elements are erroneous because they lie far away from the text element's bounding box

Open
#671 6 comments 0 reactions 1 assignee Claimed by @stunningdimension22 View on GitHub
Dominant language
Kotlin
Stars
4.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
com.google.mlkit.vision.text.Text.Element.getCornerPoints() provides corner points which have nothing to do with the bounding box obtained via com.google.mlkit.vision.text.Text.Element.getBoundingBox().

**To Reproduce**
Example Steps to reproduce the behavior in sample app:
1. Open the MLKit-Vision app.
2. Click on "Run the ML Kit quickstart written in Java"
3. Select "CameraXLivePreviewActivity"
4. Select "Text Recognition Latin"
5. Scan some text
6. Look at the Logcat output:
```
Element text is: Der
TextGraphic com.google.mlkit.vision.demo D Element boundingbox is: Rect(56, 28 - 123, 68)
TextGraphic com.google.mlkit.vision.demo D Element cornerpoint is: [Point(28, 421), Point(33, 357), Point(68, 360), Point(63, 424)]
```
**Expected behavior**
The corner points [Point(28, 421), Point(33, 357), Point(68, 360), Point(63, 424)] lie far away and outside of the bounding box Rect(56, 28 - 123, 68), i.e. the corner points have nothing to do with the bounding box. The expected behaviour is that the corner points instead lie near the bounding box. It seems that the x and y coordinates of the corner points need to be swapped, but this alone wouldn't fix the problem.

**SDK Info:**
- com.google.mlkit:text-recognition:16.0.0-beta6

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.