void draw(){
/*int c = WX;
Mat a = Mat::zeros(c, c, CV_8UC3);
int d;
Mat* b;
b->at;
rectangle(a, Rect(100, 100, 100, 100), Scalar(255, 0, 0), 4, 8, 0);
imshow("x", a);
waitKey(0);*/
}
void color2(){
//Mat a = imread("a4.png");
//cvtColor(a, a, COLOR_BGR2BGR565);
}
void featureCompare(){
/*Mat img1 = imread("a4.png", CV_LOAD_IMAGE_GRAYSCALE);
Mat img2 = imread("a4.png", CV_LOAD_IMAGE_GRAYSCALE);
if (img1.empty() || img2.empty())
{
printf("Can't read one of the images\n");
}
// detecting keypoints
SurfFeatureDetector detector(10);
vector<KeyPoint> keypoints1, keypoints2;
detector.detect(img1, keypoints1);
detector.detect(img2, keypoints2);
// computing descriptors
SurfDescriptorExtractor extractor;
Mat descriptors1, descriptors2;
extractor.compute(img1, keypoints1, descriptors1);
extractor.compute(img2, keypoints2, descriptors2);
// matching descriptors
BruteForceMatcher<L2<float> > matcher;
vector<DMatch> matches;
matcher.match(descriptors1, descriptors2, matches);
// drawing the results
namedWindow("matches", 1);
Mat img_matches;
drawMatches(img1, keypoints1, img2, keypoints2, matches, img_matches);
imshow("matches", img_matches);*/
}
void save(){
/*#include <iostream>
#include <opencv2\opencv.hpp>
#include <opencv2/core/core.hpp>
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/legacy/legacy.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/objdetect.hpp"
#include <time.h>
#define WX 400;
using namespace cv;
using namespace std;
template<typename T> T getVaxxxlue(T a, T b);
int cget(int a);
int main(){
cout << clock() << endl;
Mat mat = imread("e1.jpg");
string name = "haarcascade_frontalface_alt.xml";
CascadeClassifier ca;
ca.load(name);
vector<Rect> faces;
ca.detectMultiScale(mat, faces);
cout << faces.size() << endl;
Rect bb;
for (size_t i = 0; i < faces.size(); i++){
Rect s = faces[i];
bb = faces[i];
rectangle(mat, s.br(), s.tl(), Scalar(255, 0, 55), 2, 8, 0);
stringstream sd;
sd << i << "a.jpg";
Mat sdd = mat(bb);
imwrite(sd.str(), sdd);
}
Mat sdd = mat(bb);
cout << clock() << endl;
imshow("s", sdd);
//system("pause");
waitKey(0);
return 0;
}
int cget(int a){
return 100;
}
template<typename T> T getVaxxxlue(T t1, T t2) {
T tmpT;
tmpT = t1;
t1 = t2;
t2 = tmpT;
return tmpT;
}*/
}
/*int c = WX;
Mat a = Mat::zeros(c, c, CV_8UC3);
int d;
Mat* b;
b->at;
rectangle(a, Rect(100, 100, 100, 100), Scalar(255, 0, 0), 4, 8, 0);
imshow("x", a);
waitKey(0);*/
}
void color2(){
//Mat a = imread("a4.png");
//cvtColor(a, a, COLOR_BGR2BGR565);
}
void featureCompare(){
/*Mat img1 = imread("a4.png", CV_LOAD_IMAGE_GRAYSCALE);
Mat img2 = imread("a4.png", CV_LOAD_IMAGE_GRAYSCALE);
if (img1.empty() || img2.empty())
{
printf("Can't read one of the images\n");
}
// detecting keypoints
SurfFeatureDetector detector(10);
vector<KeyPoint> keypoints1, keypoints2;
detector.detect(img1, keypoints1);
detector.detect(img2, keypoints2);
// computing descriptors
SurfDescriptorExtractor extractor;
Mat descriptors1, descriptors2;
extractor.compute(img1, keypoints1, descriptors1);
extractor.compute(img2, keypoints2, descriptors2);
// matching descriptors
BruteForceMatcher<L2<float> > matcher;
vector<DMatch> matches;
matcher.match(descriptors1, descriptors2, matches);
// drawing the results
namedWindow("matches", 1);
Mat img_matches;
drawMatches(img1, keypoints1, img2, keypoints2, matches, img_matches);
imshow("matches", img_matches);*/
}
void save(){
/*#include <iostream>
#include <opencv2\opencv.hpp>
#include <opencv2/core/core.hpp>
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/legacy/legacy.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/objdetect.hpp"
#include <time.h>
#define WX 400;
using namespace cv;
using namespace std;
template<typename T> T getVaxxxlue(T a, T b);
int cget(int a);
int main(){
cout << clock() << endl;
Mat mat = imread("e1.jpg");
string name = "haarcascade_frontalface_alt.xml";
CascadeClassifier ca;
ca.load(name);
vector<Rect> faces;
ca.detectMultiScale(mat, faces);
cout << faces.size() << endl;
Rect bb;
for (size_t i = 0; i < faces.size(); i++){
Rect s = faces[i];
bb = faces[i];
rectangle(mat, s.br(), s.tl(), Scalar(255, 0, 55), 2, 8, 0);
stringstream sd;
sd << i << "a.jpg";
Mat sdd = mat(bb);
imwrite(sd.str(), sdd);
}
Mat sdd = mat(bb);
cout << clock() << endl;
imshow("s", sdd);
//system("pause");
waitKey(0);
return 0;
}
int cget(int a){
return 100;
}
template<typename T> T getVaxxxlue(T t1, T t2) {
T tmpT;
tmpT = t1;
t1 = t2;
t2 = tmpT;
return tmpT;
}*/
}