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
920 stars 207 forks source link

Question: How to configure detection boundaries for image. processing purpose through 'onImageForAnalysis' #269

Open CuriousDev21 opened 1 year ago

CuriousDev21 commented 1 year ago

Hello,

Thank you for the efforts put into making such a comprehensive camera plugin.

I wanted to ask about a use case I am having:

My current challenge is knowing how and if is possible to configure the 'onImageForAnalysis' to capture images only within the bounds of that overlayed rectangle.

Any help appreciated.

Merci,

apalala-dev commented 1 year ago

Hello,

Thanks for the feedback!

Keep in mind that most of the time, you can use a low res for image analysis: processing will be much faster. 👍

apalala-dev commented 1 year ago

Hey @Overlord21 ,

I just made a PR with this example in mind. Several changes on master have not yet been published to pub.dev, but you can take a look if you'd like! The PR is #273

CuriousDev21 commented 1 year ago

Hey @apalala-dev,

Thank you for the swift reply.

Yes, I can see it the overlay doable with the previewDecoratorBuilder, just the other aspect of object detection only in the rectangular area, is still unclear to me. I am expecting the full image to have many objects, but I only want to analyse the one within the boundaries of the overlayed rectangle.

Will check the PR changes mentioned.

Thanks again for your valuable support!

apalala-dev commented 1 year ago

Translating image analysis coordinates is not super easy, maybe you can try to take the example from the mentioned PR (preview_overlay_example.dart) and add your own code on top of it since it seems to do something very similar to what you want to achieve. That may be easier.

CuriousDev21 commented 1 year ago

Thanks, will try to use the preview Overlay example. My input is an image with a remote control device having a list of icons (kinda like a remote control), and the app should try and detect/identify one of the icons only inside the rectangular overlay.

I know it sounds very specific and will require something like a custom RenderRepaintBoundary to translate coordinates and crop images.

apalala-dev commented 1 year ago

Hey @Overlord21 , we've released 1.3 which includes the mentioned PR.

You might want to take a look at the doc of the barcode overlay example.