关闭

MSER slower in 3.0.0 than 2.4.X (Bug #4478)

标签: MSER
643人阅读 评论(0) 收藏 举报
分类:


描述

The below simple code can be built with either 2.4.X or 3.0.0 by uncommenting or commenting the #define respectively. It simply opens an image file (I'll let you provide your own) and runs MSER on it. On both my Linux box and my Windows box I see that its 3-4X slower in 3.0.0 than 2.4.X. I have built both versions of OpenCV from source using cmake and stuck with the defaults...I have verified that the build settings are as close as they can be.



参考:http://code.opencv.org/issues/4478?journal_id=126531

#include "opencv2/highgui/highgui.hpp" 
#include "opencv2\features2d\features2d.hpp" 
#include "opencv2\imgproc\imgproc.hpp" 
#include <iostream>
#include <chrono>
#include <ctime>

#define USE249
using namespace std;

int main(int argc, char** argv)
{
    std::cout << "OpenCV version: " 
            << CV_MAJOR_VERSION << "." 
            << CV_MINOR_VERSION << "." 
            << CV_SUBMINOR_VERSION
            << std::endl;
    cv::Mat im = cv::imread("C:/example.jpg", 1);
    if (im.empty())
    {
        cout << "Cannot open image!" << endl;
        return -1;
    }
    cv::Mat gray;
    cv::cvtColor(im, gray, cv::COLOR_BGR2GRAY);
    int mnArea = 40 * 40;
    int mxArea = im.rows*im.cols*0.4;
    std::vector< std::vector< cv::Point > > ptblobs;
    std::vector<cv::Rect> bboxes;
    std::chrono::time_point<std::chrono::system_clock> start, end;

    start = std::chrono::system_clock::now();
#ifndef USE249
    cv::Ptr<cv::MSER> mser = cv::MSER::create(1, mnArea, mxArea, 0.25, 0.2);
    mser->detectRegions(gray, ptblobs, bboxes);
#else
    cv::MserFeatureDetector mser(1, mnArea, mxArea, 0.25, 0.2);
    mser(gray, ptblobs);
#endif
    end = std::chrono::system_clock::now();

    std::chrono::duration<double> elapsed_seconds = end - start;
    std::time_t end_time = std::chrono::system_clock::to_time_t(end);

    std::cout << "finished computation at " << std::ctime(&end_time)
        << "elapsed time: " << elapsed_seconds.count() << "s\n";

    cv::namedWindow("image", cv::WINDOW_NORMAL);
    cv::imshow("image", im);
    cv::waitKey(0);

    return 0;
} 


0
0
查看评论

OpenCV 3.0.0 MSER Binary Mask

Refer from http://stackoverflow.com/questions/28515084/opencv-3-0-0-mser-binary-mask 2 down vote favorite I am trying to us...
  • kaka20080622
  • kaka20080622
  • 2015-12-04 20:07
  • 985

机器学习实践系列之15 - OpenCV之MSER

最大稳定极值区域 MSER(Maximally Stable Extremal Regions)是一种类似分水岭的算法,目前主要用于图像分割和车牌区域检测。2012年由Matas等人提出。        MSER 基本原理是对一幅灰度图像(灰度值为0...
  • linolzhang
  • linolzhang
  • 2017-03-02 22:28
  • 1001

Opencv中的MSER特征

MSER特征
  • Quincuntial
  • Quincuntial
  • 2016-01-05 14:33
  • 2100

MSER 候选车牌区域检测

#include "opencv2/highgui/highgui.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/imgproc/imgproc.hpp&quo...
  • Gone_HuiLin
  • Gone_HuiLin
  • 2016-11-18 22:04
  • 1183

opencv MSER(最大极值稳定区域)

最大极值稳定区域,是一种类似分水岭图像的分割与匹配算法。它具有SIFT SURF及 ORB等特征不具备的仿射不变性,近年来广泛应用于图像分割与匹配领域。 详细算法原理介绍可参见链接   http://blog.csdn.net/zhaocj/article/details/407...
  • hust_bochu_xuchao
  • hust_bochu_xuchao
  • 2016-08-17 14:51
  • 11175

opencv中 MSER 源码赏析

/* Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met...
  • yeyang911
  • yeyang911
  • 2014-05-26 16:14
  • 3418

mser处理文本区域

Maximal Stable Extremal Regions(MSER)这个函数在opencv中有原型 采用这个函数ke
  • yzbhehe
  • yzbhehe
  • 2014-08-04 10:44
  • 1417

mser场景文字检测及筛选

发现很多人都用mser,swt等进行场景文字的检测,最近也去实现了一下,虽然swt较新的算法,但实现过程中传统的mser算法反而更稳定,速度也会更快,可能是我还没有完全领会swt的精髓。ps:暂时只做水平及水平倾斜的文字  demo    http://downloa...
  • u013293750
  • u013293750
  • 2016-11-04 09:43
  • 2232

最大稳定极值区域(MSER)检测

MSER算法
  • zizi7
  • zizi7
  • 2015-12-22 15:00
  • 9617

图像局部特征(十四)--MSER特征

原文: http://blog.csdn.net/zhaocj/article/details/40742191 最大稳定极值区域(MSER-Maximally Stable Extremal Regions)可以用于图像的斑点区域检测。该算法最早是由Matas等人于2002年提出,它是基于分水...
  • App_12062011
  • App_12062011
  • 2016-07-18 17:10
  • 2623
    个人资料
    • 访问:672175次
    • 积分:7216
    • 等级:
    • 排名:第3710名
    • 原创:120篇
    • 转载:167篇
    • 译文:0篇
    • 评论:236条
    ★个人说明★
    最新评论