capacitor-mlkit icon indicating copy to clipboard operation
capacitor-mlkit copied to clipboard

feat(barcode-scanning): support `cornerPoints` in `readBarcodesFromImage(...)`

Open tigohenryschultz opened this issue 2 years ago • 3 comments

Plugin(s)

  • [X] Barcode Scanning
  • [ ] Translation

Did you test the latest version?

  • [X] I use the latest version

Platform(s)

  • [X] Android
  • [ ] iOS
  • [ ] Web

Current behavior

cornerPoints is empty

Expected behavior

cornerPoints should have points

Reproduction

https://github.com/tigohenryschultz/ionic-cap-ml-barcode-test

Steps to reproduce

  1. Go to the ML Kit tab
  2. Click take a picture
  3. Missing points data

Code is in TgMLKitBarcodes.vue

Other information

3
: 
bytes
: 
(9) [52, 45, 50, 68, 48, 55, 69, 50, 84]
cornerPoints
: 
[]
displayValue
: 
"4-2D07E2T"
format
: 
"QR_CODE"
rawValue
: 
"4-2D07E2T"
valueType
: 
"TEXT"
[[Prototype]]
: 
Object
4
: 
{bytes: Array(9), cornerPoints: Array(0), displayValue: '4-2D0775R', format: 'QR_CODE', rawValue: '4-2D0775R', …}
5
: 
{bytes: Array(9), cornerPoints: Array(0), displayValue: '4-2D0765X', format: 'QR_CODE', rawValue: '4-2D0765X', …}
6
: 
bytes
: 
(9) [52, 45, 50, 67, 57, 68, 56, 53, 77]
cornerPoints
: 
Array(0)
length
: 
0
[[Prototype]]
: 
Array(0)
displayValue
: 
"4-2C9D85M"
format
: 
"QR_CODE"
rawValue
: 
"4-2C9D85M"
valueType
: 
"TEXT"
[[Prototype]]
: 
Object
7
: 
{bytes: Array(9), cornerPoints: Array(0), displayValue: '4-2D07EFY', format: 'QR_CODE', rawValue: '4-2D07EFY', …}
8
: 
bytes
: 
(9) [52, 45, 50, 67, 57, 67, 68, 56, 87]
cornerPoints
: 
[]
displayValue
: 
"4-2C9CD8W"
format
: 
"QR_CODE"
rawValue
: 
"4-2C9CD8W"
valueType
: 
"TEXT"
[[Prototype]]
: 
Object

image

Capacitor doctor

Latest Dependencies:

@capacitor/cli: 5.0.4 @capacitor/core: 5.0.4 @capacitor/android: 5.0.4 @capacitor/ios: 5.0.4

Installed Dependencies:

@capacitor/cli: 5.0.3 @capacitor/core: 5.0.3 @capacitor/android: 5.0.3 @capacitor/ios: 5.0.3

Before submitting

  • [X] I understand that incomplete issues (e.g. without reproduction) are closed.

tigohenryschultz avatar May 23 '23 21:05 tigohenryschultz

Adding this debug code I see getBoundingBox has some information:

image

tigohenryschultz avatar May 23 '23 21:05 tigohenryschultz

Thank you for reporting this. I will take a closer look the next days.

robingenz avatar May 25 '23 16:05 robingenz

The readBarcodesFromImage(...) method does not yet support the calculation of cornerPoints. I have now documented this (see here) and converted the issue into a feature request. PRs are welcome.

robingenz avatar May 31 '23 17:05 robingenz

@ebarooni Feel free to work on this issue. There is already a PR which you can use as inspiration: https://github.com/capawesome-team/capacitor-mlkit/pull/100

robingenz avatar Dec 09 '24 14:12 robingenz

Closed by #225

robingenz avatar Jan 19 '25 12:01 robingenz