Convert images from Pylon to Opencv in c++

前端 未结 2 486
小鲜肉
小鲜肉 2021-01-28 07:38

I want to convert stereo images captured by Basler cameras to opencv (Mat) format. In the below code i have converted images to opencv format, but in show stages, i can not show

相关标签:
2条回答
  • 2021-01-28 08:05

    You need to create a window to display an opencv image into, use :

    namedWindow("left camera", CV_WINDOW_NORMAL); 
    imshow("left camera", openCvImage);
    

    There is also a few mistakes in your code, i guess "right_img.png" should be change in "left_img.png", otherwise you will save only one image.

    And this is redundant code

    PylonInitialize();
    Pylon::PylonAutoInitTerm autoInitTerm;
    

    autoInitTerm is automatically calling PylonInitialize() and PylonTerminate(). So you should remove it or remove PylonInitialize() and PylonTerminate()

    0 讨论(0)
  • 2021-01-28 08:06

    I think a waitKey(0) is required after the imshow to display the image.

    0 讨论(0)
提交回复
热议问题