-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grab sequence of images with different exposure times #2
Comments
On the dart series it is only possible with tight loop. Recommended to use Softwaretrigger on the dart. Setup software trigger
|
I have wrote this function:
But when looking at the images array, I see that the images intensity do not match the exposure times, I think that the camera takes the images before the exposure time was changed, could it be fixed? |
Can you show your setup code to check for possible issue in trigger setup |
you were missing the configuration for the software trigger. added the code before start grabbing and also added a check, that the camera is ready for a frame trigger. Code is not tested ;-) and you can use
to make your src code pretty def capture_hdr_images(camera, exposure_times):
images = []
for exposure_time in exposure_times:
camera.ExposureTime.SetValue(exposure_time) # set exposure time
# wait for camera ready to execute software trigger
if camera.WaitForFrameTriggerReady(200, pylon.TimeoutHandling_ThrowException):
camera.TriggerSoftware.Execute()
grab_result = camera.RetrieveResult(5000, py.TimeoutHandling_ThrowException)
images.append(grab_result.Array)
return images
tlf = py.TlFactory.GetInstance()
devices = tlf.EnumerateDevices()
devices_SN = [d.GetSerialNumber() for d in devices]
camera_index = devices_SN.index('40238137')
cam = py.InstantCamera(tlf.CreateDevice(devices[camera_index]))
cam.Open()`
# setup software trigger
cam.TriggerSelector.SetValue("FrameStart")
cam.TriggerSource.SetValue("Software")
cam.TriggerMode.SetValue("On")
cam.StartGrabbing(py.GrabStrategy_LatestImageOnly)
images = capture_hdr_images(cam, [20, 100, 1000, 10000])
fig, axs = plt.subplots(2, 2)
axs[0, 0].imshow(images[0])
axs[0, 0].set_title('exposure time 20')
axs[0, 1].imshow(images[1])
axs[0, 1].set_title('exposure time 100')
axs[1, 0].imshow(images[2])
axs[1, 0].set_title('exposure time 1000')
axs[1, 1].imshow(images[3])
axs[1, 1].set_title('exposure time 10000')
plt.show() |
Works! Thanks for the help! |
Hey,
I own a Basler DART USB camera and want to capture a series of images with varying exposure times to create an HDR image. Is there a command available to perform this task without using loops?
Thanks,
Dvir
The text was updated successfully, but these errors were encountered: