OpenCv 多目标,多角度 ,模板匹配实现

#include "pch.h"
#include"ModelMatch.h"
// 成员函数定义
double Box::get(void)
{
    return length * breadth * height;
}

void Box::set(double len, double bre, double hei)
{
    length = len;
    breadth = bre;
    height = hei;
}
#include 
using namespace cv;
ModelDetector::ModelDetector(bool enable_openmp)
    :enable_openmp_(enable_openmp)
    , record_path_prefix_("./")
{
}
ModelDetector::~ModelDetector()
{
}
bool ModelDetector::roughMatch(const cv::Mat& src, const cv::Mat& templ,
    double thresh,
    std::vector& cand_results,
    int match_method)
{
    Mat result_score = Mat::zeros(src.size(), CV_32FC1);
    Mat result_angle = Mat::zeros(src.size(), CV_32FC1);

    Mat result_bin = Mat::zeros(src.size(), CV_8UC1);

    Point2f templ_center = Point2f(templ.cols / 2, templ.rows / 2);

    int result_cols = 0;
    int result_rows = 0;
    for (int angle =

你可能感兴趣的:(视觉_Opencv,c++,开发语言)