Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Video preview inside ui.view [beta]
-
Got live video preview working using
objc_utils
. LiveCameraView lets you embed the camera's output in realtime (either front or back camera,set device=0 or 1) inside other ui.Views.It should be possible to then get snapshots, or access to the raw images for realtime image processing /effects ( have not tried it yet). i plan on experimenting with the Accelerate framework next.
-
Awesome work @JonB !
Can't wait to see some real-time image processing / face recognition with Pythonista!!
Is it possible to do the similar thing but with audio? I do remember there were some disucssion about accessing microphone. But not sure whether they are about live feeds? -
there was code a while back with audio. i made a simple audio wave displaye, but that grabbed a chunk of audio at a time, as a wave. it worked, but choppily, since it had to record then write then read. with objc now, i think we can access audio samples in the fly.
interestingly, the capture device claims it supports facedetection, but i cant seem to find any documentation on how to use this feature, and faceRectange always returns 0's.
-
@JonB said:
interestingly, the capture device claims it supports facedetection, but i cant seem to find any documentation on how to use this feature, and faceRectange always returns 0's.
The iOS camera does seem to have some builtin face detection functions as it tries to focus on faces when taking pictures. Not sure if this is an open API.
-
This program only shows the portrait orientation, how can we switch it to landscape?
-
Hi, a doubt...
you can put (overlap) buttons and or lines on top or the camera view?
for example, draw a "transparent" grid... -
you should be able to, since it is just a ui.View.
-
Really nice. Works great on my iPad Pro.
-
@JonB I don't understand how to take a snapshot of this ui.View
I've tried a button withdef snap_button_action(self,sender): with ui.ImageContext(self.width, self.height) as ctx: self.draw_snapshot() img = ctx.get_image() photos.save_image(
But I get a blank photo
-
it would require objc, since the underlying previewlayer is implemented as opengl.
Stackoverflow has some posts about capturing from a AVCaptureVideoPreviewLayer -- i have not digested it all, but mainly it seems like there is a delegate that you have to implement that gets the raw data, and can same that dirsctly to an image.
looking back in my archives, it looks like i once implemented most of a working solution (including face and maybe rectange detection), but it doesnt look quite finished. i will have to post what I've got
-
@JonB Thanks for your time and knowledge