FirebaseExtended / mlkit-material-android

ML Kit Showcase App with Material Design
Apache License 2.0
491 stars 143 forks source link

Use CameraX #2

Open renanferrari opened 5 years ago

renanferrari commented 5 years ago

Google recently announced CameraX, a Jetpack support library that wraps camera2 capabilities into a much simpler API, based on use cases.

One of those use cases is Image Analysis, which seems perfect to use with MLKit – they even mention it in their documentation as an example.

I'd love to see this app implemented with CameraX. Is this something that would interest you?

kenz commented 5 years ago

So do I. In my option, Camera X is more useful and easy for almost developers. One problem about that Camera X is not support API Level 19(Kitkat).

zhouyiself commented 5 years ago

@renanferrari Yes, it's do in our plan but the priority may be not that high for now. Some factors we need to take into consideration before doing that, e.g.

spacemx09 commented 4 years ago

I have been trying to port the implementation with CameraX, however, I haven't been able to yet. The question I have is will it not be a problem if we keep using the deprecated Camera API? Our app uses minimum API 21, and I think most of the apps in market are following the same, as there are very less devices below 21 now a days. So please suggest which one would be the best to follow this implementation.

Update: Right after I posted, I have been able to get some success with CameraX. Took a reference from Crysxd's implementation. However, still modifying for multi object detection.

KaidoNinja commented 4 years ago

Would really love to see this example with CameraX, any progress?

spacemx09 commented 4 years ago

I have been successfully able to implement multiple object detection using CameraX with the help of crysxd/Object-Tracking-Demo and this demo. I will make it available once I get a little time. Also, we cannot put it in production as CameraX is in alpha. So I would suggest to try Camera2 if you need the feature to be in production right away.

I am still not sure if it is still okay to use Camera API as it is deprecated. Though it works fine on all the API upto the latest Q.

lakshaymudgal commented 4 years ago

Anybody here to me that how to put the captured photo in any view like (imageview, textureview, etc) in android.

seventhmoon commented 4 years ago

Since android.hardware.Camera was deprecated in API level 21.

I think the project should use Camera2 or CameraX if it is out of beta. (both require API level 21)

Agree with @kenz, we should move forward.

nelson336 commented 4 years ago

I am working with an application that min-sdk is 19 and I cannot change. There is no problem with camera x, to be used only in 21. But I could import it into the project and limit it with if (Build.VERSION.SDK_INT). And not in the build.

nelson336 commented 4 years ago

tools:overrideLibrary="androidx.camera.core" to force usage ??

nelson336 commented 4 years ago

That if I can import camera x on android, I can use camera 1 for sdk less than 21 and for larger use camera x.