Closed gitty889 closed 10 months ago
Is the code, where you save the images missing?
Here is the function to capture and save image
def capture_and_save_image(base_folder):
global camera
date_folder = datetime.now().strftime("%Y-%m-%d")
folder_path = os.path.join(base_folder, date_folder)
os.makedirs(folder_path, exist_ok=True)
file_path = os.path.join(folder_path, datetime.now().strftime("%Y%m%d_%H%M%S.bmp"))
grab_result = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)
if grab_result.GrabSucceeded():
image = grab_result.Array
cv2.imwrite(file_path, image)
grab_result.Release()
return file_path
I would use PNG to store 16bit images. Can you output
print(image.shape)
Before writing?
I am trying to save my images in 12bits but it saves in 8bit. Here's my code, please can you suggest what i am doing wrong?
I have the basler a2A1920-51gmPRO Operating System- Windows