Pro camera: The pro custom camera

To capture the preview image it has a block (TakePreviewPicture) that captures the content(image) in the arrangement and saves to the internal storage.

If you're using the block (TakePicture) it may change sometimes because when the camera API fails to take the actual picture, it captures the preview picture instead. TakePreviewPicture captures the arrangement.

Thanks.

In my old app which used the original camera library I could capture the byte data directly from the surface (vertical arrangement) of the control displaying the preview image. The advantage of this was that I could reduce the size of the preview image (making the amount of data much less) and the preview image is updated at a 100s of milliseconds rate rather than the several seconds required to take a picture. I could simulate a real-time movie by using the preview image data.

Since the preview image is displayed the data must be available on the visible surface of the control displaying the image. Theoretically it should be possible to read this data directly from the control surface.

Your original answer of capturing the data into a list and using as a byte array sounds exactly like what I would need to do. I could not see how to do that in App Inventor. Is there a function of the vertical arrangement I am not seeing?

The second part of my question about changing dimensions is an attempt to reduce the amount of data. The quality of the real-time image needed is very low – 640x480 is more than sufficient and reduces the image data size substantially. In the older original camera library you could choose the size of the preview image. I chose something like 640x480. In the new camera2 library documentation I have seen mention that changing the size of the display surface (vertical arrangement) will perform the function of reducing the preview image size – although this was not explicitly stated. Hopefully it is true and I can use the reduced size image.

2 Likes

Hello,

I had try your extension with appinventor.
But the quality of the image is very very poor.
In fact I had made a program to take picture each 5s and enable flash befaore and close after.
But focus is very bad, quality is very bad, lot of snow pixel on the image.
So do you have solution to have very good picture as I use normaly my camera in the same condition.
In fact I take picture in dark condition dans enable the flash just befaire taking the picture and disable the flash just after.

Thanks to help.
Regards.
JL

Ok, we need to set the nosereductionmode, but I don't know why we have to set this command. I Set nothing special on my camera to set this paramater?
Same thing thing exposure when using flash in dark situation.
Thanks.
JL

For a better resolution set the layout height to 70% of the screen. Since this uses camera 2 API, I couldn't find any solutions for the auto-focus like in the built-in camera.

NoiseReductionMode calls the camera API, and its effect varies on different devices.
If your device can set focus distance, then there is a block for that. That will throw an error if that functionality doesn't exist.

1 Like

Hello canalrun - what exactly prevents you from using the current camera library?

Hi.
Seems so cooool!!!
But I'm sorry I'm unable to find the Component "HorizontalArrangement1" block.
So I can't try it :frowning:
Any Help?
Thanks and best regards.

@starsky I think you should learn some basics first.
And with a simple Google search, you could have found the solution quickly.

2 Likes

Thanks! :grin: :grin: :grin:
I just was searching in the proCamera pane :grin: :grin: :grin: