How to use the pypylon.genicam function in pypylon

To help you get started, we’ve selected a few pypylon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github basler / pypylon / samples / utilityimageformatconverter.py View on Github external
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())