在Matlab R2013a 和R2014a中已经实现MSER特征的提取。

  • 一、函数detectMSERFeatures

输入的是M*N的灰度图片。可以指定阈值刻度,区域范围,感兴趣区域等参数。

输出的是MSERRegions class,即框住区域的椭圆由椭圆中心的坐标,椭圆的长短轴,椭圆的方向(有长轴与x方向形成的角),即区域内所有像素的坐标。

Detect MSER features and return MSERRegions object

Syntax

· regions = detectMSERFeatures(I) example

· regions = detectMSERFeatures(I,Name,Value)

Description

example

regions = detectMSERFeatures(I) returns an MSERRegions object, regions, containing information about MSER features detected in the 2-D grayscale input image, I. This object uses Maximally Stable Extremal Regions (MSER) algorithm to find regions.

regions = detectMSERFeatures(I,Name,Value) sets additional options specified by one or moreName,Value pair arguments.

Code Generation Support:
Supports MATLAB Function block: No
For code generation, the function outputs regions.PixelList as an array. The region sizes are defined in regions.Lengths. Generated code for this function uses a precompiled platform-specific shared library.
Code Generation Support, Usage Notes, and Limitations

Examples

collapse all

Find MSER Regions in an Image

Read image and detect MSER regions.

I = imread('cameraman.tif');

regions = detectMSERFeatures(I);

Visualize MSER regions which are described by pixel lists stored inside the returned 'regions' object.

figure; imshow(I); hold ;

plot(regions, 'showPixelList', true, 'showEllipses', false);

Display ellipses and centroids fit into the regions.

figure; imshow(I); hold ;

plot(regions); % by default, plot displays ellipses and centroids

Input Arguments

collapse all

I — Input imageM-by-N 2-D grayscale image

Input image, specified in grayscale. It must be real and nonsparse.

Data Types: uint8 | int16 | uint16 | single | double

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name andValue is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'RegionAreaRange',[30 14000], specifies the size of the region in pixels.

'ThresholdDelta' — Step size between intensity threshold levels2 (default) | percent numeric value

Step size between intensity threshold levels, specified as the comma-separated pair consisting of 'ThresholdDelta' and a numeric value in the range (0,100]. This value is expressed as a percentage of the input data type range used in selecting extremal regions while testing for their stability. Decrease this value to return more regions. Typical values range from 0.8 to 4.

'RegionAreaRange' — Size of the region[30 14000] (default) | two-element vector

Size of the region in pixels, specified as the comma-separated pair consisting of 'RegionAreaRange' and a two-element vector. The vector, [minArea maxArea], allows the selection of regions containing pixels to be between minArea and maxArea, inclusive.

'MaxAreaVariation' — Maximum area variation between extremal regions0.25 (default) | positive scalar

Maximum area variation between extremal regions at varying intensity thresholds, specified as the comma-separated pair consisting of 'MaxAreaVariation' and a positive scalar value. Increasing this value returns a greater number of regions, but they may be less stable. Stable regions are very similar in size over varying intensity thresholds. Typical values range from 0.1 to 1.0.

'ROI' — Rectangular region of interest[1 1 size(I,2) size(I,1)] (default) | vector

Rectangular region of interest, specified as a vector. The vector must be in the format [x y widthheight]. When you specify an ROI, the function detects corners within the area located at [x y] of size specified by [width height] . The [x y] elements specify the upper left corner of the region.

Output Arguments

collapse all

regions — MSER regions objectMSERRegions object (default)

MSER regions object, returned as a MSERRegions object. The object contains information about MSER features detected in the grayscale input image.

More About

collapse all

Algorithms

Intensity Threshold Levels

The MSER detector incrementally steps through the intensity range of the input image to detect stable regions. The ThresholdDelta parameter determines the number of increments the detector tests for stability. You can think of the threshold delta value as the size of a cup to fill a bucket with water. The smaller the cup, the more number of increments it takes to fill up the bucket. The bucket can be thought of as the intensity profile of the region.

The MSER object checks the variation of the region area size between different intensity thresholds. The variation must be less than the value of the MaxAreaVariation parameter to be considered stable.

At a high level, MSER can be explained, by thinking of the intensity profile of an image representing a series of buckets. Imagine the tops of the buckets flush with the ground, and a hose turned on at one of the buckets. As the water fills into the bucket, it overflows and the next bucket starts filling up. Smaller regions of water join and become bigger bodies of water, and finally the whole area gets filled. As water is filling up into a bucket, it is checked against the MSER stability criterion. Regions appear, grow and merge at different intensity thresholds。

  • 二 MSERRegions class

Object for storing MSER regions

Description

This object describes MSER regions and corresponding ellipses that have the same second moments as the regions. It passes data between the detectMSERFeatures and extractFeaturesfunctions. The object can also be used to manipulate and plot the data returned by these functions.

Although MSERRegions may hold many regions, it is a scalar object. Therefore,NUMEL(MSERRegions) always returns 1. This value may differ from LENGTH(MSERRegions), which returns the true number of regions held by the object.

Construction

regions = MSERRegions(pixellist) constructs an MSER regions object, regions, from an M-by-1 cell array of regions,pixellist. Each cell contains a P-by-2 array of [x y] coordinates for the detected MSER regions, where P varies based on the number of pixels in a region.

CODE GENERATION SUPPORT

Compile-time constant inputs: No restrictions.

Supports MATLAB Function block: Yes

For code generation, you must specify both the pixellist cell array and the length of each array, as the second input. The object outputs, regions.PixelList as an array. The region sizes are defined inregions.Lengths.

Generated code for this function uses a precompiled platform-specific shared library.

Code Generation Support, Usage Notes, and Limitations

Input Arguments

pixellist

M-by-2 cell array of [x y] coordinates of the detected MSER regions.

Properties

The following properties are read-only and are calculated once the input pixel list is specified.

Count

Number of stored regions

Default: 0

Location

An M-by-2 array of [x y] centroid coordinates of ellipses that have the same second moments as the MSER regions.

Axes

A two-element vector, [majorAxis minorAxis]. This vector specifies the major and minor axis of the ellipse that have the same second moments as the MSER regions.

Orientation

A value in the range from -pi/2 to +pi/2 radians. This value represents the orientation of the ellipse as measured from the X-axis to the major axis of the ellipse. You can use this property for visualization purposes.

Methods

isempty
Returns true for empty object

length
Number of stored points

plot
Plot MSER regions

size
Size of the MSERRegions object

Matlab mser(最大极值稳定区域)的更多相关文章

  1. matlab实现MSER(最大极值稳定区域)来进行文本定位

    一.自然场景文本定位综述   场景图像中文本占据的范围一般都较小,图像中存在着大范围的非文本区域.因此,场景图像文本定位作为一个独立步骤越来越受到重视.这包括从最先的CD和杂志封面文本定位到智能交通系 ...

  2. EasyPR源码剖析(2):车牌定位

    上一篇主要介绍了车牌识别的整体框架和流程,车牌识别主要划分为了两个过程:即车牌检测和字符识别,而车牌识别的核心环节就是这一节主要介绍的车牌定位,即 Plate Locate.车牌定位主要是将图片中有可 ...

  3. 区域检测算法-MSERs

    区域检测算法-MSERs:最大稳定极值区域 参考书籍——<图像局部不变性特征与描述>王永明.王贵锦著 MSER最大极值稳定区域的提取步骤:1.像素点排序   2.极值区域生成   3.稳定 ...

  4. MSER最稳定极值区域源码分析

    最稳定极值区域介绍 如把灰度图看成高低起伏的地形图,其中灰度值看成海平面高度的话,MSER的作用就是在灰度图中找到符合条件的坑洼.条件为坑的最小高度,坑的大小,坑的倾斜程度,坑中如果已有小坑时大坑与小 ...

  5. MATLAB学习笔记(七)——MATLAB解方程与函数极值

    (一)线性方程组求解 包含n个未知数,由n个方程构成的线性方程组为: 其矩阵表示形式为: 其中 一.直接求解法 1.左除法 x=A\b; 如果A是奇异的,或者接近奇异的.MATLAB会发出警告信息的. ...

  6. MATLAB求函数零点与极值

    1.      roots函数 针对多项式求零点(详见MATLAB多项式及多项式拟合) 2.      fzero函数 返回一元函数在某个区间内的的零点. x0 = fzero(@(x)x.^2-3* ...

  7. mser 最大稳定极值区域(文字区域定位)算法 附完整C代码

    mser 的全称:Maximally Stable Extremal Regions 第一次听说这个算法时,是来自当时部门的一个同事, 提及到他的项目用它来做文字区域的定位,对这个算法做了一些优化. ...

  8. MATLAB神经网络(4) 神经网络遗传算法函数极值寻优——非线性函数极值寻优

    4.1 案例背景 \[y = {x_1}^2 + {x_2}^2\] 4.2 模型建立 神经网络训练拟合根据寻优函数的特点构建合适的BP神经网络,用非线性函数的输入输出数据训练BP神经网络,训练后的B ...

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

    http://blog.csdn.net/zizi7/article/details/50379973 http://www.cnblogs.com/dawnminghuang/p/3779552.h ...

随机推荐

  1. Sklearn 中的 CrossValidation 交叉验证

    1. 交叉验证概述 进行模型验证的一个重要目的是要选出一个最合适的模型,对于监督学习而言,我们希望模型对于未知数据的泛化能力强,所以就需要模型验证这一过程来体现不同的模型对于未知数据的表现效果. 最先 ...

  2. nodejs 获取指定路径下所有的文件夹名

    示例:获取 ./components 下所有的文件夹名称 let components = [] const files = fs.readdirSync('./components') files. ...

  3. 解决js下跳转无referer的方法

    HTTP Header referer这玩意主要是告诉人们我是从哪儿来的,就是告诉人家我是从哪个页面过来的,可以用于统计访问本网站的用户来源,也可以用来防盗链.获取这个东西最好的方式是js,如果在服务 ...

  4. 王立平--Eclipse中配置svn

    1.-------------------------------------------------------------------------------------------------- ...

  5. C# AppDomain 类

    /*** AppDomain 表示应用程序域,它是一个应用程序在其中执行的独立环境.无法继承此类. 应用程序域(由 AppDomain 对象表示)为执行托管代码提供隔离.卸载和安全边界. 使用应用程序 ...

  6. Java重构-策略模式、状态模式、卫语句

    前言 当代码中出现多重if-else语句或者switch语句时.弊端之一:如果这样的代码出现在多处,那么一旦出现需求变更,就需要把所有地方的if-else或者switch代码进行更改,要是遗漏了某一处 ...

  7. 实战Jquery(二)--能够编辑的表格

    今天实现的是一个表格的样例,通过获取表格的奇数行,设置背景色属性,使得奇偶行背景色不同.这个表格能够在单击时编辑,回车即更改为新输入的内容;ESC还原最初的文本.表格的实现思路非常清晰,仅仅是在实现的 ...

  8. UML结构体系简介

    一.UML的结构 UML有3种基本的构造块,分别是事物(元素).关系和图.事物是UML中重要的组成部分.关系把事物紧密联系在一起.图是很多有相互相关的事物的组. 二.UML的事物 UML中的事物也称为 ...

  9. 基于JS实现回到页面顶部的五种写法(从实现到增强)

    这篇文章主要介绍了基于JS实现回到页面顶部的五种写法(从实现到增强)的相关资料,本文介绍的非常详细,实用性也非常高,非常具有参考借鉴价值,需要的朋友可以参考下   写法 [1]锚点 使用锚点链接是一种 ...

  10. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights

    第一次提交遇到这样的情况,怎么回事呢,我在github上提交了ssh key 的啊. 排查先看看能不能解析, 1.先 ping https://github.com 把ip添加到 host :    ...