April 3, 2012

              pylon 3.0 – How Do the New Image Handling Classes Work?

              In view of the IEEE1394 or the GigE Vision restricted bandwidths, there is a need to "pack" the image data into data packets well in order to maximize the number of images per second transmitted from the camera to the host PC. Adapted image formats are needed when pixel information can only be coded in 10- or 12-bit data depth formats and not in the standard 8-bit. In the case of color images the data mapping becomes even more challenging, as the complete color information needs to transmitted for each pixel.

              The GigE Vision Standard defines image formats, which avoid "space" during packaging. The "Mono_12_Packed" format for example specifies how two pixel values – each with 12-bit data depth information – are packed into three 8-bit packets for transmission. The assembling of image data is automatically done by the camera. The correct packaging is automatically done by the Basler GigE camera.

              pylon 3.0 offers in comparison to older 2.x versions a better "un-packaging" support on the host PC side, which is more flexible and much more efficient. You can use the new pylon Image Format Converter to convert practically all input formats, such as Mono, Bayer, RGB und YUV422 variants, into 8-,10-,12- and 16-bit formats. Output formats, like BGRA8packed, BGR8packed, RGB8packed, etc., can be easily displayed as Windows bitmaps on the screen; and they can be also saved.

              The code sequence below illustrates how the new Image Format Converter can be used:

              // Create a target image.
              CPylonImage targetImage;
              // Create the converter and set parameters.
              CImageFormatConverter converter;
              converter.OutputPixelFormat = PixelType_BGRA8packed;
              // This smart pointer will receive the grab result data.
              CGrabResultPtr ptrGrabResult;
              // Create an instant camera object with the camera device found first.
              CInstantCamera Camera( CTlFactory::GetInstance().CreateFirstDevice());
              if ( Camera.GrabOne( 1000, ptrGrabResult))
              // Now we can check if conversion is required.
              if ( converter.ImageHasDestinationFormat( ptrGrabResult))
              // No conversion is needed. It can be skipped for saving
              // processing time.
              Pylon::DisplayImage(1, ptrGrabResult);
              // Conversion is needed.
              converter.Convert( targetImage, ptrGrabResult);
              Pylon::DisplayImage(1, targetImage);
              The new pylon Image Window allows the application programmer to display a grabbed image on a screen for detailed viewing and analysis. Furthermore they can save the image in the pylon window in a variety of file formats for offline analysis, for example as Bitmaps or TIFF.

              Backward Compatibility
              Even though the new Image Format Converter in pylon 3.0 is more wide-ranging, faster and more user-friendly, pylon 3.0 is still backward compatible with older pylon 2.x releases. Customers can thus upgrade to the latest release now, or at a later date. We recommend you use release 3.0 in new projects in order to benefit from the new features and upgrades.

              Try it out now – Free Download
              Take a closer look and download the free pylon 3.0 driver package for Windows 32bit or 64bit from our Downloads Section. You can also download the Release Notes for the new release there for detailed information on all innovations, upgrades and improvements in the pylon Release 3.0.

                RSS Feed

                Subscribe the Basler News RSS Feed and get the latest news stories directly delivered to you.
                RSS News Feed
                Please activate cookies in order to download files without having to fill in your data again the next time you visit.