Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
show_image(grabResult, "Grabbed image.")
targetImage = pylon.PylonImage.Create(pylon.PixelType_Mono8, grabResult.GetWidth(), grabResult.GetHeight());
print(converter.IsSupportedOutputFormat(pylon.PixelType_Mono8))
# Now we can check if conversion is required.
if converter.ImageHasDestinationFormat(grabResult):
# No conversion is needed. It can be skipped for saving processing
# time.
show_image(grabResult, "Grabbed image.")
else:
# Conversion is needed.
show_image(grabResult, "Grabbed image.")
show_image(targetImage, "Converted image.")
except genicam.GenericException as e:
print("Could not grab an image: ", e.GetDescription())
except genicam.GenericException as e:
print("An exception occurred. ", e.GetDescription())