aarongrider / vision-camera-ocr

VisionCamera Frame Processor Plugin to detect text in real time using MLKit Text Detector (OCR)
MIT License
235 stars 86 forks source link

Text Recognition Bounds Units #13

Open codeapp17 opened 1 year ago

codeapp17 commented 1 year ago

Hello. Currently I am using Text Recognition using react-native-camera library and it returns bounds for x, y coordinates which I can filter for limiting scan area, it works perfectly fine.

But vision-camera-ocr is giving me different coordinates for scanning in the same location in the camera. I have try to use pixel density for converting corner points to dp but that also seems wrong bounds.

Can anybody provide me the information about how can i filter the bounds for limiting the scan area or frame processors give the coordinates in which units.

I am stuck with this for many days, any help would be appreciated.

francesco-clementi-92 commented 1 year ago

I'm exactly in your same situation. Can't find a way to limitate the area to scan, even using the pixelRation

codeapp17 commented 1 year ago

@francesco-clementi-92 this was working fine in iOS with pixel ratio, but I am also able to resolve it on android by using format in camera and then calculating pixel ratio using format width by screen width.

francesco-clementi-92 commented 1 year ago

Hi @codeapp17 I'd really appreciate a sample code as I'm fighting with this from weeks now

codeapp17 commented 1 year ago

@francesco-clementi-92 sorry for the late reply, below link would help https://lightrun.com/answers/rodgomesc-vision-camera-code-scanner-highlight-scan-barcodes-for-better-ux

Rakedd commented 7 months ago

Any updates on the issue, it seems the link you have provided doesn't give a fix :\