Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[camera] Access realtime image frames for pre-processing and effect overlays #18968

Open
rubencg195 opened this issue Jun 30, 2018 · 24 comments
Open
Labels
c: new feature Nothing broken; request for a new capability p: camera The camera plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team

Comments

@rubencg195
Copy link

Is it possible to access the real-time camera frame feed to do pre-processing or to be used for ML implementations like face-recognition, Image overlays, filters, etc.?

@zoechi zoechi added c: new feature Nothing broken; request for a new capability p: first party labels Jul 2, 2018
@zoechi
Copy link
Contributor

zoechi commented Jul 2, 2018

Sounds like https://github.com/flutter/plugins/tree/master/packages/camera can do that but I haven't tried myself yet.

@zoechi zoechi added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 2, 2018
@rubencg195
Copy link
Author

rubencg195 commented Jul 3, 2018

Thanks, but it will be better if you can obtain the byte array to work with instead of writing in memory and then retrieving the image for preprocessing. It can be costly in time and resources. I think it can be a really good feature to implement. Just think of the results, ML application, filters, AR/VR application, etc.

Maybe includying a Opencv wrapper for flutter. If possible, it could be awesome!
https://docs.opencv.org/2.4/doc/tutorials/introduction/android_binary_package/O4A_SDK.html

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 3, 2018
@dessant
Copy link

dessant commented Jul 8, 2018

Have you found a workaround for this? I'm looking for a way to grab the camera frames to then process them with ML Kit.

@Robbo2
Copy link

Robbo2 commented Jul 20, 2018

I'm also looking for a way to access real-time camera frame feed to do pre-processing and live-streaming.
Anyone have suggestions?

@zoechi
Copy link
Contributor

zoechi commented Jul 20, 2018

There is some work going on that looks related flutter/plugins#679

@dustin-graham
Copy link

Thanks @zoechi, I'm working to get that PR into shape soon. It'll be a good solution for working with ML Kit.

@arloan
Copy link

arloan commented Jul 31, 2018

I need this also. The camera plugin can only take a camera shot into image file, which is really too much time consuming for many kinds of scenario.

@dustin-graham
Copy link

dustin-graham commented Jul 31, 2018 via email

@arloan
Copy link

arloan commented Jul 31, 2018

Well, I'm afraid I don't have enough knowledge of Java or Android, that's why I chose flutter ...

@Nashua354
Copy link

Maurice added the bytestream capability in the camera package
flutter/plugins#965
and modified the firebase_ml_vision package too to make this demo
https://github.com/bparrishMines/mlkit_demo
Check it out. Its some amazing stuff.

@zoechi zoechi added the p: camera The camera plugin label Jan 4, 2019
@alejamp
Copy link

alejamp commented Feb 9, 2019

Camera plugin adds startImageStream in CameraController sice 0.2.9. The image format returned is YUV420-888 which is pretty useful for ML Kit, but not to show on screen.
I wrote a piece of code to convert the plane[0] from YUV420 to PNG using the DART Image library in order to use Image Widget to display it... but it takes too long almost 800ms per frame.

@gimox
Copy link

gimox commented Mar 7, 2019

@alejamp i'm working on custom model with ml_vision. Can you share the code to convert image?

@alejamp
Copy link

alejamp commented Mar 14, 2019

@alejamp i'm working on custom model with ml_vision. Can you share the code to convert image?

Here is the code

#26348 (comment)

@gimox
Copy link

gimox commented Mar 14, 2019

@alejamp thanks for code. now i have a ios custom model working with firebase_ml_vision but it's too slow for a production app. I think the only solution is working with native image manipulation.

any suggestions is appreciated about ios and android code....

@rubencg195
Copy link
Author

rubencg195 commented Apr 2, 2019

Hello everyone, is there any production-ready version (IOS & Android) for this feature?

@gimox
Copy link

gimox commented Apr 2, 2019

not for now!

@rubencg195
Copy link
Author

rubencg195 commented Apr 2, 2019

Thank you @gimox. How is ML-kit able to recognize faces and text in near real-time? Is there a way to access the image-stream from that package?

@gisinator
Copy link

Plus 1 for this. Trying to take 20 pictures without having to save them first on disk, so access to frames in a useful way would be super exciting.

@jdeltoft
Copy link

Was this resolved ever?

@Baileypollard
Copy link

Any updates on a solution for this?

@rubencg195
Copy link
Author

@zoechi any update? thank you.

@brainstorm
Copy link

Just googling a bit: https://github.com/shaqian/flutter_realtime_detection

... would that help?

@SelanDeemantha
Copy link

Hei, is there a proper way to process images(YUV420 (YCbCr)) which are captured by live-streaming to use for object recognition ?

I have used https://pub.dev/documentation/google_ml_kit/latest/ for image detection, and I need to crop images from frames in camera live stream to process for image recognition. I have referred below docs https://medium.com/@hugand/capture-photos-from-camera-using-image-stream-with-flutter-e9af94bc2bee
https://medium.com/@vad.pinchuk/image-stream-processing-in-flutter-application-by-tflite-neural-networks-2c40d65f3b67
If someone knows a better solution to achieve this using dart, please give some advice to follow up.

@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
@Hixie Hixie removed the plugin label Jul 6, 2023
@flutter-triage-bot flutter-triage-bot bot added team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team labels Jul 8, 2023
@stuartmorgan stuartmorgan changed the title Access Realtime Camera Image frames for Pre-processing and effect overlays [camera] Access realtime image frames for pre-processing and effect overlays Jan 4, 2024
@danielalonsomendez
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: new feature Nothing broken; request for a new capability p: camera The camera plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team
Projects
None yet
Development

No branches or pull requests