Reading Multiple Images From Camera
AnsweredI am using FLIR A50 thermal camera with PySpin for data acquisition.
I have successfully utilized the PySpin library to capture individual images. However, I have encountered a limitation with current implementation, as the code samples provided only allow me to capture a single image at a time. Given the data processing requirements during acquisition, I am not able to keep up with the acquisition speed of the camera.
To solve this problem, I would like to learn how to set up a buffer on the camera and then retrieve all available images from the buffer using the PySpin library.
In the code I am using right now, I create a thread and continuously call a function to read a single image from the camera:
while self.CONTINUE_RECORDING:
try:
image_result = cam.GetNextImage()
if image_result.IsIncomplete():
pass
else:
image_data = image_result.GetNDArray()
if CHOSEN_IR_TYPE == IRFormatType.LINEAR_10MK:
image_Temp_Celsius_high = (image_data * 0.01) - 273.15
self.image_temp = image_Temp_Celsius_high
elif CHOSEN_IR_TYPE == IRFormatType.LINEAR_100MK:
image_Temp_Celsius_low = (image_data * 0.1) - 273.15
self.image_temp = image_Temp_Celsius_low
elif CHOSEN_IR_TYPE == IRFormatType.RADIOMETRIC:
image_Radiance = (image_data - J0) / J1
image_Temp = (B / np.log(R / ((image_Radiance / Emiss / Tau) - K2) + F)) - 273.15
self.image_temp = image_Temp
image_result.Release()
except PySpin.SpinnakerException as ex:
print('Error: %s' % ex)
-
Official comment
Hello GasperK,
One option that would aid to keep up with camera fps would be to create and store 'image_result' in image list container to be processed after end of acquisition. We implemented similar approach in SaveToAvi.py example code part of spinnaker python package.
It is possible to have full control of the buffer using SetUserBuffers(...) for image acquisition. Please reference example code AcquisitionUserBuffer.cpp part of spinnaker sdk on how this can be implemented.
You could also create support ticket via https://flir.custhelp.com/app/ask to go through this over together.
Regards,
Ifeanyi.
Please sign in to leave a comment.
Comments
1 comment