mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
change camera logic
This commit is contained in:
@@ -293,13 +293,20 @@ void sendKobukiData(TKobukiData &data)
|
|||||||
|
|
||||||
void CapnSend()
|
void CapnSend()
|
||||||
{
|
{
|
||||||
std::string pipeline = "libcamerasrc ! video/x-raw,width=640,height=480,framerate=30/1 ! videoconvert ! appsink";
|
VideoCapture cap;
|
||||||
VideoCapture cap(pipeline, cv::CAP_GSTREAMER);
|
if (!cap.open("/dev/video0", cv::CAP_V4L2))
|
||||||
if (!cap.isOpened())
|
|
||||||
{
|
{
|
||||||
cerr << "Error: Could not open camera" << endl;
|
cerr << "Error: Could not open camera with /dev/video0" << endl;
|
||||||
|
if (!cap.open("/dev/video1", cv::CAP_V4L2))
|
||||||
|
{
|
||||||
|
cerr << "Error: Could not open camera with /dev/video1" << endl;
|
||||||
|
if (!cap.open("/dev/media2", cv::CAP_V4L2))
|
||||||
|
{
|
||||||
|
cerr << "Error: Could not open camera with /dev/video1" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Mat frame;
|
Mat frame;
|
||||||
while (true)
|
while (true)
|
||||||
|
Reference in New Issue
Block a user