rodgomesc / vision-camera-code-scanner

VisionCamera Frame Processor Plugin to read barcodes using MLKit Vision QrCode Scanning
MIT License
336 stars 222 forks source link

Issue with reading barcodes containing special characters #123

Open zorand1986 opened 1 year ago

zorand1986 commented 1 year ago

Dear all,

we are using react-native-vision-camera "2.15.2" and vision-camera-code-scanner "0.2.0", and when scanning barcodes that contain some special characters, it recognises them incorrectly.

Example: https://barcode.tec-it.com/en/Code128?data=ABC-abc-1234-%C3%84%C3%96%C3%9C

Expected result: ABC-abc-1234-ÄÖÜ The result we get: "ABC-abc-1234-DV\"

I've also tried in other apps using vision-camera-code-scanner and the result is the same. I've noticed that any time it rans into special characters, it returns "DV\"

Anyone else ran into the same issue?

Thanks a lot!

shaikhkhamroddin commented 1 year ago

can you try with format and fps setting, try with lower resolution format.

zorand1986 commented 1 year ago

@shaikhkhamroddin Thanks for the answer!

I've tried playing with fps and format and using different presets, but it didnt help. I've also tried another app that uses Vision camera and code scanner, and I get the same results when scanning special characters.

Can you try to scan this barcode yourself?

image

shaikhkhamroddin commented 1 year ago

As far I know above barcodes have some different symbols and characters, can you specify category of above barcode. because there are some types of barcode that is supported by vision camera that uses google ml kit for barcode reading.

Barcode types : https://www.peaktech.com/blog/learn-about-the-different-types-of-barcodes/ google ml : https://developers.google.com/ml-kit/vision/barcode-scanning/android

The following formats are supported in google ml kit: Code 128 (FORMAT_CODE_128) Code 39 (FORMAT_CODE_39) Code 93 (FORMAT_CODE_93) Codabar (FORMAT_CODABAR) EAN-13 (FORMAT_EAN_13) EAN-8 (FORMAT_EAN_8) ITF (FORMAT_ITF) UPC-A (FORMAT_UPC_A) UPC-E (FORMAT_UPC_E) QR Code (FORMAT_QR_CODE) PDF417 (FORMAT_PDF417) Aztec (FORMAT_AZTEC) Data Matrix (FORMAT_DATA_MATRIX)

zorand1986 commented 1 year ago

Yeah, this specific barcode is Code 128.

shaikhkhamroddin commented 1 year ago

I tried to scan but it's not reading,

I tried with above code generate barcode but not able to on below url: https://www.cognex.com/en-in/resources/interactive-tools/free-barcode-generator

tried with https://barcode.tec-it.com/en/Code128?data=ABC-abc-1234-%C3%84%C3%96%C3%9C it generating but not reading from scanner.

may be your 128 code has some subtype that not supported by ml kit

zorand1986 commented 1 year ago

As far as I researched ML kit is suppose to work fine with these nordic special characters. Our barcode is just a regular one with special characters.

I can see that google camera recognises it well.

So my assumption is, it has to do something with compiling inside the code-scanner library.