2011年提出,是一种二进制的特征描述算子。速度比较:SIFT<SURF<BRISK<FREAK<ORB,在对有较大模糊的图像配准时,BRISK算法在其中表现最为出色。

【函数】

Ptr<BRISK> create(int thresh=30, int octaves=3, float patternScale=1.0f);

【参数说明】原理链接

thresh——AGAST检测阈值

octaves——octave层数,0则单尺度

patternScale——关键点邻域采样倍数,多尺度空间下采样的倍数

【案例】

#include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;

int main()
{
    Mat srcImage = imread("D:/sunflower.png");
        Mat srcGrayImage;
        if (srcImage.channels() == 3)
        {
            cvtColor(srcImage,srcGrayImage,CV_RGB2GRAY);
        }
        else
        {
            srcImage.copyTo(srcGrayImage);
        }
        vector<KeyPoint>detectKeyPoint;
        Mat keyPointImage1,keyPointImage2;

        Ptr<BRISK> brisk = BRISK::create();
        brisk->detect(srcGrayImage,detectKeyPoint);
        drawKeypoints(srcImage,detectKeyPoint,keyPointImage1,Scalar(0,0,255),DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
        drawKeypoints(srcImage,detectKeyPoint,keyPointImage2,Scalar(0,0,255),DrawMatchesFlags::DEFAULT);

        imshow("src image",srcImage);
        imshow("keyPoint image1",keyPointImage1);
        imshow("keyPoint image2",keyPointImage2);

        waitKey(0);
        return 0;
}

 

版权声明:本文为xixixing原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/xixixing/p/12468999.html