Pro camera: The pro custom camera

The only way around this is to go out to the default camera app on the phone and take the picture there.

If you do not need a high resolution image, try with the preview picture taking, but you should set noise reduction to high quality:

(Also for me, no need to rotate the device)

Hi, I need to take photos programatically without user interaction and save them, I lack knowledge so can you instruct me on how can I do this? AIA project explaining it would be appreciated. Also these photos need to have best quality possible. Thanks in advance.

In this part, TakePicture block should be swapped for non-interactive photo taking and saving it.

You will need a workflow something like this:

  • setup the camera and the output, and set the interval required
  • start the clock
  • when the clock fires, take the picture, and stop the clock
  • once the picture is saved, start the clock
  • repeat

sir i use this program.but it give erorr.please look at it." could you help me?sir.

Thanks! I tried to implement what you sent me.


For some reason it wont save the picture, it opens camera view but never proceeds from there, as my microcontroller waits for info back that photo is taken and saved.
image
Here is how my setup of this extension looks. What could be a problem here?
On the BT connection I am pretty sure everything is fine (tested with bt serial monitor app and previous version of this), I am most definitely missing something about the extension.

There is an issue with the companion app currently
Try this version

Remember: 2.73d1u is intended for ai2, not ai2-test and you will need the click the "Not Now" button.

Taifun

thank you

image

If you do a ReceiveText(-1) without any bytes available, the app will hang until there are bytes available.

That's why each receiveText should be guarded by an if/then bytesAvailable > 0

1 Like

Hi all.

used ProCamBase64 take picture to base64 string, data too large, designed the VerticalArrangement size: 120x160, not improved, seems that window not relative to image pixel? anyway to set the resolution of the image before take image?
purpose is to reduce the string size.

Thanks.

I am doing a bit of work on the extension, if you can be patient i should have it ready soon.

1 Like

Great!
I am no rush.
Thank you so much.

Quick Update of ProCamBase64 to version 2

Note, this version is built with FAST instead of RUSH, so it will not update the previous extension, you will need to delete the previous extension, and then install the latest version (2).

uk.co.metricrat.procambase64.aix (27.8 KB)

The only change is the addition of the maxImgLength to the preview image, allowing you to set a resize width/height. I got success going up to 1280.

Blocks I used

An example:

The containing arrangement was set to 320x180
The number of characters returned for an image taken with maxImgLength set to 0 (no resize) = 430,000
Setting the maxImgLength to 160 returned an image with 19,900 characters

1 Like

Great.
I'll test it.

here is the testing:

  1. the block shown that when call ProCamBase64.TakeCameraImageToBase64 by BLE, phone works take picture and convert to base64 and sending but broken on half way;
    if call ProCamBase64.TakeCameraImageToBase64 set maxImgLength = 120, got APP crashed,

comp

  1. the maxImgLength reduce OK by button for testing; in my code's Button3 got runtime error: Not coonected to a Bluetooth...; don't know why?

can be the ProCamBase64.AfterToBase64 got difference result for:
ProCamBase64.TakeCameraImageToBase64
and:
ProCamBase64.TakeCameraImageToBase64 set maxImgLength = 120 ?

BTW. I'm using Android 14, the permission request got difference from Android 5? thanks.

Your issue is not with procam, it is what you are doing after you capture an image. Do some work on that . Break your approach down into steps, test each step, until you find where the problem is. This is much easier than trying to resolve an issue by running the whole thing at once.

1 Like

Thanks for the suggestion.

I've done all steps till got: APP be trigged to take screenshot and resized and encoded and sent to ESP32 works well.

this step now is let APP to take picture by camera and then to do the same thing, tested only: ProCamBase64.TakeCameraImageToBase64 doesn't crash the APP, but crashed on the halfway sending, thats why I think the reason is the string too big (actually it is too big), its why I am looking a solution to reduce the string, the ProCamBase64.TakeCameraImageToBase64 maxImgLength setting is a good solution tested by manually, but got APP crashed as long as it take picture.
its the all story.

I guess the core of:
ProCamBase64.TakeCameraImageToBase64 and
ProCamBase64.TakeCameraImageToBase64 maxImgLength set
may be some difference?

thanks.

All I did was add the resize function for the Preview Picture. No other changes made. If maxImglength is set to 0 then the behaviour is as the previous version.

are you trying to do too many things at once here ?

1 Like

Thanks.
please see the attached, nothing more, just disable one and enable another to do the thesting.

comp5

tested set maxImglength to 0 , no changes.

For the preview picture only - using 0...

1 Like

Thanks.
I'll test it.
one thing is the new procambase64 can't auto updated, what I did is deleted the old one and redo the new one.

also, the new extension got two:
ProCamBase64.TakeCameraImageToBase64 maxImgLength set
and missed:
ProCamBase64.TakeCameraImageToBase64 ?

Correct, the new one is built with FAST, the previous one was built with RUSH, I will update my post.