Hi! I’m MinGu.
I have a Jetson TX2 board(LI-JETSON-KIT-IMX377CS-X).
I want to be able to handle a stereo camera.
Here is the code that controls the mono camera using opencv.
#include <opencv2/opencv.hpp>
#include
#define camera1 “nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)680, height=(int)480, format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)I420 ! videoconvert ! video/x-raw, format=(string)BGR ! appsink”
int main(void)
{
/* camera connect /
cv::VideoCapture cap1(camera1);
if(!cap1.isOpened()){
std::cout<<“camera1 is not open\n”;
}
else{
std::cout<<“camera1 is open\n”;
}
/*****************/
/* Show the preview ********************************************************/
cv::Mat video;
cv::namedWindow("camera1");
while(true){
cap1>>video;
cv::imshow("camera1",video);
//if press keyboard
if(cv::waitKey(5)>=0)
break;
}
/***************************************************************************/
cv::destroyAllWindows();
return 0;
}
How do i control a stereo camera from the code above?
And where can i find sample code or documentation?