-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Android camera provider #3236
Android camera provider #3236
Conversation
Thank you so much for this! Could you please rebase and make a PR against kivy:master? |
This is awesome! Finally someone get it right :) Same as @cbenhagen, can you rebase your work on master first? We wont get PR merged first in stable without going to master first. Thanks :) |
…ack/buffer to receive frames - a lot faster and removes dependency on OpenCV.
…eated and destroyed - cleaner and more efficient.
… from texture doesn't work well for all devices - slow and/or low color depth.
…ch must cleared on pause.
…parated for flexibility.
Thanks for the suggestion, I rebased the branch against tag 1.8.0 on master, please let me know if it is good enough. |
@jasonxunxu Your PR at the top still indicate a PR against stable-1.8.x, you need to move it to master as well :) |
def _refresh_fbo(self): | ||
self._fbo.clear() | ||
with self._fbo: | ||
#BindTexture(texture=self._camera_texture, index=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no need to bind, how the samplerExternalOES is binded then? Please note that the BindTexture use standard GL_TEXTURE2D, but you can use a graphics Callback, and manually do opengl in it in the Fbo pipeline.
Also, _fbo.clear + recreate Rectangle every frame is not efficient, you can setup your fbo only once at the start, then call fbo.draw() every frame.
@tito How can I change the PR to be against master without recreating one? I just rebased the branch, is there something else I should have done? Thanks! |
If you click on Edit, don't you see a way to change it at the top? |
master...jasonxunxu:camera-android is what we want. |
@tito The Edit button only allows me to revise the title, so I have to close this PR and submit another one. Regarding the binding thing, it surprised me that everything works fine without even binding the texture, I don't actually know why and still am very curious. I will try to improve efficiency as you pointed out, thanks a lot! |
This is a fully working camera provider for Android. It is efficient and can achieve pretty high frame rate by receiving frames through a
SurfaceTexture
(based on this snippet).In addition, it provides an interface to obtain current frame data as a Numpy array (requiring OpenCV Python binding
cv2
), making it suitable for computer vision apps.It fixes issue #2831.