main.cpp
#include "mainwindow.h"
#include <QApplication>
#include <iostream>
#include <string>
#include <stdio.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include "colordetector.h"
#include "opencvcolordetector.h"
using namespace cv;
int main(int argc, char *argv[])
{
opencvcolordetector *cdetect=new opencvcolordetector();
ColorDetector *clordetect=new ColorDetector();
clordetect->setInputImage("C:\\Users\\Administrator\\Desktop\\QTsucai\\result.jpg");
clordetect->setTargetColor(0,0,0);
clordetect->process();
namedWindow("result");
cv::imshow("result",clordetect->getResult());
waitKey(20);
getchar();
return 0;
}
colordetector.h<