Long exposures

OpenMV related project discussion.
RonC
Posts: 8
Joined: Wed Jun 15, 2016 5:38 pm

Long exposures

Postby RonC » Sun Oct 23, 2016 3:53 pm

Hi,
I have two questions:

1) I want to take long exposure (say, up to 300 seconds) images.
How do I setup the camera for this?
I see sensor.set_exposure_cntrl() in the documentation. Is this what I use, how do I use it?

2) I've tried to get the camera type by executing
import sensor
print("%s" % (sensor.get_id()))
The output is 119, not something like sensor:OV7725 as expected. What am I doing wrong?

Thanks for your consideration,
Ron
User avatar
kwagyeman
Posts: 1310
Joined: Sun May 24, 2015 2:10 pm

Re: Long exposures

Postby kwagyeman » Sun Oct 23, 2016 4:17 pm

You can do time lapse photos by using the blend command. So, basically you take pictures and then blend them together.

See the advanced frame differencing script for how to do this... (Note, this reminds me that I should add an example for this). In the advanced frame differencing script I blend images into a background image.

Wait, here's the code:

Code: Select all

sensor.snapshot().save("temp/bg.bmp")
while(True):
    img = sensor.snapshot() # Take a picture and return the image.
    img.blend("temp/bg.bmp", alpha=200)
    img.save("temp/bg.bmp")
And just do that repeatedly. Note that I just guessed the alpha value up there. You need to figure out what alpha value you'd like.
Nyamekye,
User avatar
kwagyeman
Posts: 1310
Joined: Sun May 24, 2015 2:10 pm

Re: Long exposures

Postby kwagyeman » Sun Oct 23, 2016 4:21 pm

For the second question the sensor ID value is an enum. So, you have to compare the value output with the enum type. The value of the return doesn't make sense directly on it's own. It's just a number.
Nyamekye,
User avatar
iabdalkader
Posts: 392
Joined: Sun May 24, 2015 3:53 pm

Re: Long exposures

Postby iabdalkader » Sun Oct 23, 2016 4:39 pm

The enum values are defined in Python too:

Code: Select all

if (sensor.get_id() == sensor.OV2640): # (or OV7725)
    .....
RonC
Posts: 8
Joined: Wed Jun 15, 2016 5:38 pm

Re: Long exposures

Postby RonC » Sun Oct 23, 2016 4:56 pm

Thanks for the quick replies :)

Return to “Project Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest