当前位置:网站首页>cmake_ example
cmake_ example
2022-06-13 02:07:00 【weixin_ forty-four million five hundred and seventy-six thousan】
file name: camke_camera set 5 file follow as:
bin
build
include
res
src
the camer.cpp in src file
camer.cpp
#include <iostream>
#include<string.h>
#include<fstream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
using namespace ml;
int device = 0;
int i_begin = 0;
int width = 2560;
int height = 720;
double fps = 45.0;
std::string outputVideoPath = "test\\";
std::string outputVideoName = "test.avi";
std::string outputPicturePath = "Latest\\";
std::string outputPictureFormat = ".jpg";
std::string imshowWindowName = "result";
int quit = 'q';
int fourcc = cv::VideoWriter::fourcc('M', 'P', '4', '2');
int waitkey_time = 100;
int main()
{
cv::VideoCapture capture(device);
if (!capture.isOpened())
{
return -1;
}
capture.set(cv::CAP_PROP_FRAME_WIDTH, width);
capture.set(cv::CAP_PROP_FRAME_HEIGHT, height);
int vedio_width = capture.get(cv::CAP_PROP_FRAME_WIDTH);
int vedio_height = capture.get(cv::CAP_PROP_FRAME_HEIGHT);
cv::VideoWriter video(outputVideoPath+ outputVideoName, fourcc,\
fps, cv::Size(vedio_width, vedio_height));
while (true)
{
cv::Mat frame;
capture >> frame;
if (frame.empty())
continue;
cv::namedWindow(imshowWindowName, CV_WINDOW_NORMAL);
cv::imshow(imshowWindowName, frame);
//cv::imwrite(outputPicturePath + to_string(i_begin) + outputPictureFormat, frame);
i_begin++;
video << frame;
int q=cv::waitKey(waitkey_time);
if (q == quit)
break;
}
capture.release();
video.release();
cv::destroyAllWindows();
return 0;
}
CMakeLists.txt
cmake_minimum_required (VERSION 2.8)
project (mydemo)
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
find_package(OpenCV REQUIRED)
aux_source_directory (src SRC_LIST)
include_directories (include)
add_executable (main ${SRC_LIST})
target_link_libraries(main ${OpenCV_LIBS})边栏推荐
- Decompression and compression of chrome resource file Pak
- Stm32 mpu6050 servo pan tilt support follow
- Rsync transport exclusion directory
- 回顾ITIL各版本历程,找到企业运维发展的关键点
- Ten thousand words make it clear that synchronized and reentrantlock implement locks in concurrency
- 记录:如何解决MultipartFile类的transferTo()上传图片报“系统找不到指定的路径“问题【亲测有效】
- 10 days based on stm32f401ret6 smart lock project practice day 1 (environment construction and new construction)
- Can't use typedef yet? C language typedef detailed usage summary, a solution to your confusion. (learning note 2 -- typedef setting alias)
- Configuring virtual private network FRR for Huawei equipment
- Use of Arduino series pressure sensors and detected data displayed by OLED (detailed tutorial)
猜你喜欢

QT realizes mind mapping function (II)

Establishment of microservice development environment

Mac使用Docker安装Oracle

Uniapp preview function

Sensorless / inductive manufacturing of brushless motor drive board based on stm32

General IP address, account and password of mobile IPv6 optical cat login, and mobile optical cat is in bridging mode

The new wild prospect of JD instant retailing from the perspective of "hour shopping"

Top level configuration + cooling black technology + cool appearance, the Red Devils 6S Pro is worthy of the flagship game of the year

Ctrip reshapes new Ctrip
![[learning notes] xr872 GUI littlevgl 8.0 migration (file system)](/img/9b/0bf88354e8cfdbcc1ea91311c9a823.jpg)
[learning notes] xr872 GUI littlevgl 8.0 migration (file system)
随机推荐
Stm32 mpu6050 servo pan tilt support follow
[learning notes] xr872 audio driver framework analysis
Devaxpress Chinese description --tdximageslider (picture rotation control)
[open source] libinimini: a minimalist ini parsing library for single chip computers
Pytoch freeze pre training weights (feature extraction and BN layer)
Vivo released originos ocean, and the domestic customized system is getting better and better
Swiper horizontal rotation grid
[programming idea] communication interface of data transmission and decoupling design of communication protocol
Mac下搭建MySQL环境
Alertwindowmanager pop up prompt window help (Part 1)
Learning notes 51 single chip microcomputer keyboard (non coding keyboard and coding keyboard, scanning mode of non coding keyboard, independent keyboard, matrix keyboard)
[sequence structure, branch structure, loop structure, continue statement, break statement, return statement] (learning Note 6 -- C language process control)
The commercial value of Kwai is being seen by more and more brands and businesses
js获取元素
Examples of using the chromium base library
1、 Set up Django automation platform (realize one click SQL execution)
Padavan mounts SMB sharing and compiles ffmpeg
【 unity】 Problems Encountered in Packaging webgl Project and their resolution Records
DFS and BFS to solve Treasure Island exploration
In the third quarter, the revenue and net profit increased "against the trend". What did vatti do right?