Matlab mser(最大极值稳定区域)

在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
image
M-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
levels
2 (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
regions
0.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(最大极值稳定区域)

时间: 2024-10-12 05:30:11

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

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

一.自然场景文本定位综述   场景图像中文本占据的范围一般都较小,图像中存在着大范围的非文本区域.因此,场景图像文本定位作为一个独立步骤越来越受到重视.这包括从最先的CD和杂志封面文本定位到智能交通系统中的车牌定位.视频中的字幕提取,再到限制条件少,复杂背景下的场景文本定位.与此同时文本定位算法的鲁棒性越来越高,适用的范围也越来越广泛.文本定位的方式一般可以分为三种,基于连通域的.基于学习的和两者结合的方式.基于连通域的流程一般是首先提取候选文本区域,然后采用先验信息滤除部分非文本区域,最后根据

《OpenCV图像处理编程实例》 目录

当当网购买地址:http://product.dangdang.com/23956649.html京东网购买地址:http://item.jd.com/11929148.html 内容简介 本书以 OpenCV 开源库为基础实现图像处理领域的很多通用算法,并结合当今图像处理领域前沿技术,对多个典型工程实例进行讲解及实现.全书内容覆盖面广,由基础到进阶,各个技术点均提供详细的代码实现,以帮助读者快速上手和深入学习.本书内容共三个部分,其中 1-2 章为基础篇, 3-6 章为进阶篇, 7-9 章为高

C++实现MATLAB一维数组函数findpeaks()函数求一维离散值极值(波峰波谷)

一.代码 #include <iostream> #include <vector> using namespace std; // //C++实现求一维离散数据极值(波峰.波谷) // //参数:数组,数组大小 void findPeaks(int *num,int count) { vector<int> sign; for(int i = 1;i<count;i++) { /*相邻值做差: *小于0,赋-1 *大于0,赋1 *等于0,赋0 */ int di

MATLAB学习笔记(七)&mdash;&mdash;MATLAB解方程与函数极值

(一)线性方程组求解 包含n个未知数,由n个方程构成的线性方程组为: 其矩阵表示形式为: 其中 一.直接求解法 1.左除法 x=A\b; 如果A是奇异的,或者接近奇异的.MATLAB会发出警告信息的. 2.利用矩阵的分解来求解线性方程组(比单单进行左除速度快) (1)LU分解 LU分解就是分解成一个交换下三角矩阵(也就是说进行一定的操作后才是下三角矩阵)和一个上三角矩阵(不需要变换)的乘积形式.只要A是非奇异的,就可以进行LU分解. MATLAB提供的LU分解函数对于矩阵进行LU分解: [L,U

Matlab基础学习------------------函数的极值、积分问题Matlab实现

<span style="font-size:18px;">% 函数的积分问题Matlab实现 %% 函数极值点 % 1.一元函数的极小值点 % 实例:求f(x)=x^3-x^2-x+1在区间[-2,2]的极小值点 [email protected](x)x.^3-x.^2-x+1 x=fminbnd(f,-2,2) %使用fminbnd()函数求解一元函数的极小值点,参数分别为f(x)和区间短点 y=f(x) %极小值点对应的函数值 %结果 % f = % @(x)x.^

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

mser 的全称:Maximally Stable Extremal Regions 第一次听说这个算法时,是来自当时部门的一个同事, 提及到他的项目用它来做文字区域的定位,对这个算法做了一些优化. 也就是中文车牌识别开源项目EasyPR的作者liuruoze,刘兄. 自那时起就有一块石头没放下,想要找个时间好好理理这个算法. 学习一些它的一些思路. 因为一般我学习算法的思路:3个做法, 第一步,编写demo示例. 第二步,进行算法移植或效果改进. 第三步,进行算法性能优化. 然后在这三个过程中

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

http://blog.csdn.net/zizi7/article/details/50379973 http://www.cnblogs.com/dawnminghuang/p/3779552.html http://www.cnblogs.com/frischzenger/p/3334569.html 作者:wangduo 出处:http://www.cnblogs.com/wangduo/ 本博客中未标明转载的文章归作者wangduo和博客园共有,欢迎转载,但未经作者同意必须保留此段声明

deep learning学习(四) 逻辑斯蒂(logistic)回归深入理解和matlab程序求参数

第一节中说了,logistic 回归和线性回归的区别是:线性回归是根据样本X各个维度的Xi的线性叠加(线性叠加的权重系数wi就是模型的参数)来得到预测值的Y,然后最小化所有的样本预测值Y与真实值y'的误差来求得模型参数.我们看到这里的模型的值Y是样本X各个维度的Xi的线性叠加,是线性的. Y=WX (假设W>0),Y的大小是随着X各个维度的叠加和的大小线性增加的,如图(x为了方便取1维): 然后再来看看我们这里的logistic 回归模型,模型公式是:,这里假设W>0,Y与X各维度叠加和(这里

数学软件 之 基于MATLAB的DFP算法

DFP算法是本科数学系中最优化方法的知识,也是无约束最优化方法中非常重要的两个拟Newton算法之一,上一周写了一周的数学软件课程论文,姑且将DFP算法的实现细节贴出来分享给学弟学妹参考吧,由于博客不支持数学公式,所以就不累述算法原理及推倒公式了. DFP算法流程图 先给出DFP算法迭代流程图,总体上是拟Newton方法的通用迭代步骤,唯独在校正公式的地方有所区别. MATLAB实现DFP 基于此图便可以设计DFP算法的MATLAB程序: 对分法及加步探索法的实现 首先由于DFP算法中需要利用一