v-hogood / CameraXSamples

Android .NET port of CameraX samples:
https://github.com/android/camera-samples
Apache License 2.0
7 stars 2 forks source link

Missing reference for MLKitAnalyzer #1

Open haavamoa opened 6 months ago

haavamoa commented 6 months ago

Hi, very nice samples. I am inspired by it and are implementing the same.

I was wondering with the CameraXMlKit part: I am having issues resolving MlKitAnalyzer object. Did this work you at a point?

image

haavamoa commented 6 months ago

I've reached out here, but I am curious if this ever worked for you.

v-hogood commented 6 months ago

Hi Havard,

Yes that’s the right place to reach out. The problem is the Xamarin group needs to bind the AndroidX Camera MlKit Vision library, but they don’t bind pre-releases, and that library is always in alpha/beta. So no I’ve never gotten that sample working. Maybe you can talk them into it :-)

https://maven.google.com/web/index.html#androidx.camera:camera-mlkit-vision Google's Maven Repositoryhttps://maven.google.com/web/index.html#androidx.camera:camera-mlkit-vision maven.google.comhttps://maven.google.com/web/index.html#androidx.camera:camera-mlkit-vision [favicon.ico]https://maven.google.com/web/index.html#androidx.camera:camera-mlkit-vision

Good luck!

—Howard

On Feb 16, 2024, at 5:08 AM, Håvard Moås @.***> wrote:

I've reached out herehttps://github.com/xamarin/GooglePlayServicesComponents/issues/839, but I am curious if this ever worked for you.

— Reply to this email directly, view it on GitHubhttps://github.com/v-hogood/CameraXSamples/issues/1#issuecomment-1948359067, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARRVNPNZP4NPSAQNIYEPGOTYT5K5FAVCNFSM6AAAAABDL7ZWQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBYGM2TSMBWG4. You are receiving this because you are subscribed to this thread.Message ID: @.***>

haavamoa commented 6 months ago

Hi, thanks for replying. I was unaware that this library was in pre-release.

I actually got it working. Instead of using MlKit analyzer, we can actually create our own analyzer and forward the image to the MLKit barcode scanner.

Here is where I forward the image to the bar code scanner client: https://github.com/DIPSAS/DIPS.Mobile.UI/blob/4f2bbac67af88d3b32a71e42b502043b6aaf8925/src/library/DIPS.Mobile.UI/API/Camera/BarcodeScanning/Android/BarcodeScanner.cs#L108

I found this from the MLKit bar code scanning docs.

Btw, a bit off topic, but I was amazed of how many different ways one can implement bar code scanning with MLKit. It was not a easy read on what solution would be the best or why I would pick one over the other...:P