草稿一
来源:互联网 发布:在线数字抽奖软件 编辑:程序博客网 时间:2024/06/15 22:44
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;
}*/
}
阅读全文
0 0
- 草稿一
- 草稿一
- struts草稿(一)
- struts2学习草稿一
- opencv 草稿一
- cmakelist 草稿一
- 草稿
- 草稿
- 草稿
- 草稿
- 草稿
- 草稿
- 草稿
- 草稿
- (草稿)
- 草稿
- 草稿
- 草稿
- 异常
- <p>标签为何不可以包含<div>标签
- Android App将数据写入内部存储和外部存储的示例
- oracle的基本术语
- Tomact端口被占用的解决方案
- 草稿一
- 深度学习_卷积神经网络CNN
- 怎么用U盘安装系统
- 微信小程序模板消息41003 page路径错误解决办法
- 冒泡排序
- 如何构建用户画像来实现精准营销?
- 利用系统自带工具快速实现SSH免密远程登录
- JavaScript基础之全选
- Android辅助功能之自动安装apk