PylonSample_OpenCV_Linux

Just a short starting point for developing applications with OpenCV and Basler Pylon.

Documentation

PylonSample_OpenCV_Linux:

Just a short starting point for developing applications with OpenCV and Basler Pylon.

Initial basic sample is in C++.

This can be done in a few ways, but the core is two steps:

  1. Convert the incoming image to a format that OpenCV likes

  2. Create an OpenCV image from the converted image.

An example is:

// The Pylon Image Format Converter will convert whatever format the grabbed buffer is in to a desired format.

CImageFormatConverter formatConverter;

// We configure the converter to use BGR8 because this is liked by OpenCV

formatConverter.OutputPixelFormat= PixelType_BGR8packed;

// We create a "Pylon Image" container to hold the converted image

CPylonImage pylonImage;

// Create an OpenCV image

Mat openCvImage;

**// Convert the grabbed buffer

formatConverter.Convert(pylonImage, ptrGrabResult);**

**// Create an OpenCV image from the pylon image

openCvImage= cv::Mat(ptrGrabResult->GetHeight(), ptrGrabResult->GetWidth(), CV_8UC3, (uint8_t *) pylonImage.GetBuffer());**

Code

GitHub Repository

https://github.com/MattsProjects/PylonSample_OpenCV_Linux

Commits

MattB
pushed 27ba038d76d5399fff15542ed4034d37e6f3ca74
License change to Apache 2.0
2017-08-30 20:44:24 UTC
mattb
pushed 272b4e52edc011360a4d2e638e37ed0accceefb5
updated makefile for pylon5
2017-08-28 16:45:19 UTC
mattbreit
pushed ad6fa36245ce04875f9d3fcae1ee94ff7c273854
test commit
2015-10-08 20:06:38 UTC
TaterCode
pushed b24df460232f06db6bc68315e4456cfc94c2ca53
initial commit
2015-10-07 16:35:31 UTC
Matthew Breit
pushed 50269fe9e04682d2fb01391c4e763613ddc526dc
Initial commit
2015-10-06 18:28:13 UTC
Info

Project State

Public Project

Licences

Software Licence: Apache 2.0
Hardware Licence: Project has no hardware

Project Tags

Admins

mattb

Members

Does this project pique your interest?

Login or register to join or follow this project.

Comments
Back to top

Your comments, please!

Want to comment this ... Show more