OpenCV & C++: returned cv::Mat causes a Segmentation Fault

Advertisements I’m writing a class that grabs frames from basler USB cameras using pylonAPI and converts them to openCV format. Here’s the code of the grabbing method: std::pair<cv::Mat, cv::Mat> GrabPair() { int key; Pylon::CImageFormatConverter fmtConv; Pylon::CPylonImage pylonImg1, pylonImg2; fmtConv.OutputPixelFormat = Pylon::PixelType_BGR8packed; Pylon::CPylonImage pylonImgLeft, pylonImgRight; cv::Mat outImageL, outImageR; Pylon::CGrabResultPtr pResultLeft, pResultRight; if(cams.IsGrabbing()){ cams[leftCamIndex].RetrieveResult(1000, pResultLeft, Pylon::TimeoutHandling_ThrowException); cams[rightCamIndex].RetrieveResult(1000,… Read More OpenCV & C++: returned cv::Mat causes a Segmentation Fault