Just a short starting point for developing applications with OpenCV and Basler Pylon.
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:
Convert the incoming image to a format that OpenCV likes
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());**
Matthew B | pushed 5c116fc59754a36f5cf248386efd09311abc4499 | 2021-06-15 20:59:05 UTC | |
MattB | pushed 27ba038d76d5399fff15542ed4034d37e6f3ca74 | 2017-08-30 20:44:24 UTC | |
mattb | pushed 272b4e52edc011360a4d2e638e37ed0accceefb5 | 2017-08-28 16:45:19 UTC | |
mattbreit | pushed ad6fa36245ce04875f9d3fcae1ee94ff7c273854 | 2015-10-08 20:06:38 UTC | |
TaterCode | pushed b24df460232f06db6bc68315e4456cfc94c2ca53 | 2015-10-07 16:35:31 UTC | |
Matthew Breit | pushed 50269fe9e04682d2fb01391c4e763613ddc526dc | 2015-10-06 18:28:13 UTC |
Want to comment this ...
Show more