
本文共 3318 字,大约阅读时间需要 11 分钟。
OpenCV������������������������
���������������������OpenCV������������������������������������������������������������������������������������������������OpenCV������������������������������������������������������������
������������������
������������������������������������QT������������������������������ Qt 5.12 ������������������ OpenCV 4.1.0������������������������.pro���������������������������������
TEMPLATE = appCONFIG += consoleCONFIG -= app_bundleCONFIG -= qtINCLUDEPATH += /usr/local/include \ /usr/local/include/opencv \ /usr/local/include/opencv2 \ /usr/local/include/librealsense2LIBS += /usr/local/lib/libopencv*SOURCES += main.cpp
������������������
��� OpenCV ������������������������������������������������������������������������������������������������������������������������������������/���������������������//���������������������������������������
������������������
���������������������
������������������������ OpenCV ���������������������������������������������
#include#include using namespace std;using namespace cv;int main() { // ������������ Mat image = imread("������������"); // ������������ imwrite("������������������", image); // ������������ imshow("������������", image); // ������������������ waitKey(0); return 0;}
������������
������������������������������������������������������������������������������������������������
#include#include using namespace std;using namespace cv;int main() { while (1) { // ������������ Mat image = imread("/home/jiajia/������/002.jpg"); // ������������ imwrite("/home/jiajia/outputs/image.jpg", image); // ������������ imshow("������������", image); // ������������������ int key = waitKey(1); // ��������������������� ESC ������ if (char(key) == 27) { break; } } return 0;}
������������������
������������������������������������������������ VideoCapture
������������������
#include#include using namespace std;using namespace cv;int main() { VideoCapture capture("������������������"); while (1) { Mat image; bool read������ = capture >> image; if (!read������) { break; } // ������������ imwrite("������������������", image); // ������������ imshow("������������", image); // ������������������ int key = waitKey(1); if (char(key) == 27) { break; } } return 0;}
������������������
- ���������������������������������������������������������������������������������������������������������������������������������������������������
- ������������������������������������������
imread
���VideoCapture
������������������������������������������������������������ - ���������������������������������
waitKey
������������������������������������������������������������������waitKey(1)
��������� CPU ������������������������waitKey(0)
���������
���������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
