merge master

13195980010 3 years ago
parent 755b094675
commit e394f4a07c

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>768</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QPushButton" name="CLOSE">
<property name="geometry">
<rect>
<x>1100</x>
<y>440</y>
<width>80</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>CLOSE</string>
</property>
</widget>
<widget class="QPushButton" name="PLAY">
<property name="geometry">
<rect>
<x>1100</x>
<y>250</y>
<width>80</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>PLAY</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>50</x>
<y>30</y>
<width>731</width>
<height>461</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,2 @@
opencvtest.cpp is used to detect whether the virtual machine can be connected to the camera
g++ `pkg-config opencv4 --cflags` opencvtest.cpp -o example `pkg-config opencv4 --libs`

Binary file not shown.

@ -0,0 +1,27 @@
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include<iostream>
using namespace cv;
int main() {
VideoCapture cap(0);
if (!cap.isOpened()) {
std::cout << "";
return -1;
}
Mat frame;
bool judge = true;
namedWindow("test1");
while (judge)
{
cap >> frame;
if (frame.empty()) break;
imshow("test1", frame);
if (27 == waitKey(30)) {
break;
}
}
destroyWindow("test1");
return 0;
}
Loading…
Cancel
Save