草稿一

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;
    }*/
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值