Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
910 stars 199 forks source link

Problem with scan area overlay / google ml kit #428

Closed djwinston closed 5 months ago

djwinston commented 6 months ago

Example of component barcode_preview_overlay.dart has wrong calculate of scan area and pointer position. Incorrect calculations

I suppose all calculations of the component have shifted along Y axis

Steps to Reproduce

Expected results

https://docs.page/Apparence-io/camera_awesome/image_analysis/reading_barcodes#scan-area image

Actual results

Android https://github.com/Apparence-io/CamerAwesome/assets/29452563/b545e362-2910-4fad-9b4d-917902acf0f8
iOS https://github.com/Apparence-io/CamerAwesome/assets/29452563/72502d73-b36a-46a9-8c3d-cb15be78b9d2

About your device

Brand Model OS
Apple iPhone 12Pro 17.2.1
OnePlus7 GM1901 13

Flutter version

g-apparence commented 6 months ago

Hi

This is a problem within the example. I'm sorry, this use the old calculation and the preview widget has been totally remade with some tools to help you convert a point from what you see and what analysis have. (On android for ex analysis image is totally different from what you see). That makes thing harder so we made some tools to help you.

You can check how it is working on the example "ai_analysis_faces.dart"

preview!.convertFromImage(
    Offset(element.x.toDouble(), element.y.toDouble()), model.img!)
);

Hope it helps