#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/opencv.hpp>
#include <iostream>
#include "armordetection.h"
using namespace cv;
using namespace std;
int main()
{
VideoCapture capture("D:/1/1.avi");
//创建滑动条
int i = 0;
int max = 1;
void text(int,void*);
namedWindow("测试窗口", WINDOW_NORMAL);
createTrackbar("数字:", "测试窗口:", &i, max, text);
void text()
{
}
while (1)
{
Mat frame;
capture >> frame;
//分离图像通道
vector<Mat> channels;
split(frame, channels);
for (;;)
{
capture >> frame;
imshow("original", frame);
split(frame, channels);
imshow("red", channels.at(2));
imshow("green", channels.at(1));
imshow("blue", channels.at(0));
if (waitKey(30) >= 0)
break;
}
}
return 0;
}
然后怎么写?程序有什么问题呢?