ESP32-CAM ov2640 exposure control/FREX mode

User avatar
HermannSW
Posts: 97
Joined: Fri Oct 27, 2017 6:58 am
Location: Eberbach, Germany
Contact:

Re: ESP32-CAM ov2640 exposure control/FREX mode

Postby HermannSW » Thu Jul 18, 2019 9:05 pm

I did new frame capture, with mostly same settings, but this time with "Wait for next VSYNC" enabled:
Image

This was the captured frame after I clicked "doit" button:
Image

These were the last two rows of Arduino IDE "serial Monitor" output:

Code: Select all

...
MJPG: 20556B 161ms (6.2fps), AVG: 155ms (6.5fps), 0+0+0+0=0 0
MJPG: 21333B 161ms (6.2fps), AVG: 156ms (6.4fps), 0+0+0+0=0 0
In difference to yesterday, today we know exactly when the 1.05ms time frame of the two 50µs long flashes happened:
Because of "Waiting for next VSYNC" at the very beginning of capturing 2nd last 161ms frame.
Since the 170ms offset reaches into next (last) frame it seems that the missing top part of global shutter propeller is the area of last frame that was already captured (rolling shutter) for last frame, before stopping the stream is initiated (this is the browser code executed when clicking on "doit"):

Code: Select all

  async function doit(ms) {
    updateConfig(ges_vsync_value)
    updateConfig(doitButton)
    await sleep(ms)
    stopStream();
  }
I expected now, that capturing with these settings would be completely recreatable.
But that was not the case.
Time for sending the updateConfig http requests might differ (Wifi).
Sleeping is done in browser, not sure how precisely timewise recreatable the actual start of the sleep is.
Also the waiting for VSYNC is executed on ESP32, while the wait and stop stream happen in browser.

User avatar
HermannSW
Posts: 97
Joined: Fri Oct 27, 2017 6:58 am
Location: Eberbach, Germany
Contact:

Re: ESP32-CAM ov2640 exposure control/FREX mode

Postby HermannSW » Tue Aug 06, 2019 6:47 pm

I just had serious problems in getting any global shutter captures done.

It turned out to be good to have serial monitor output in view.
The router in vacation house is not good, the time to capture a frame toggles between below 200ms and above 1000ms. And in current state, implementation is fragile to timings.
I temporarily switched to tethering hotspot on Android smartphone, but that has same unreliable frame times.

Just wanted to note that problem and diagnosis in case somebody wants to try doing global shutter capturing with ESP32-CAM.

User avatar
HermannSW
Posts: 97
Joined: Fri Oct 27, 2017 6:58 am
Location: Eberbach, Germany
Contact:

Re: ESP32-CAM ov2640 exposure control/FREX mode

Postby HermannSW » Mon Oct 28, 2019 6:08 pm

It turned out that Raspberry v1 camera can do global shutter capturing at daylight of fast rotating propeller as well:
https://github.com/Hermann-SW/Raspberry ... r#daylight
Image


Since v1 camera can do so with bigger framesize and higher framerates, I did not continue ESP32-CAM ov2640 investigations yet.

v1 camera allows for crazy stuff, this is first 20,000fps video I created from a 20,000eps (exposures per second) multiple exposure frame. A black painted propeller over a black disk did rotate very fast, and has a single small white marker (played at 20fps, 1000 times slower than real).The disk as well as propeller are painted with Black 3.0, which absorbs 98% of visible light. The disk looks grey, because the 5000lm diy highspeed flash did 34 flashes 9us long, at 20KHz frequency, so disk is hit by 34*9us=0.306ms 5000lm light:
Image


Playing with multiple airsoft pellets shot by single airsoft pistol is nice as well, I fill a red pellet (3D printed by my son) first, then a yellow airsoft pellet, and finally a red pellet. The left three pellets are from one multiple exposure, the right three pellets are from next exposure:
Image


You can find much more interesting stuff (like camera software panning to determine fast flying pellet (36m/s) rotation in flight) in the repo ...

stonemull
Posts: 2
Joined: Wed Dec 05, 2018 12:21 pm

Re: ESP32-CAM ov2640 exposure control/FREX mode

Postby stonemull » Sun Dec 08, 2019 12:31 pm

Thanks for that info, I want to use mine as a timelapse camera and have been looking into extreme low light (starlight ideally)
and was hoping several second exposures would be possible, I came to the conclusion I needed that FREX pin broken out and that led me to this post.
Came to the conclusion that this is probably not the best sensor for this funtionality.

Just wanted to say I appreciate the work put into documenting this :)

FBMinis
Posts: 15
Joined: Sun Jan 17, 2021 1:08 pm

Re: ESP32-CAM ov2640 exposure control/FREX mode

Postby FBMinis » Tue Jan 23, 2024 9:40 pm

Came across the following project some time ago, it allows taking photos in very dark conditions

https://github.com/paoloinverse/CameraW ... troEdition

Who is online

Users browsing this forum: No registered users and 62 guests