mser matlab,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

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

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);

08601ea7d0f7afe8a64d6ad4c01e914b.png

Display ellipses and centroids fit into the regions.

figure; imshow(I); hold ;

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

7e2ca2d152f24b5403c62b392a3cd07a.png

Input Arguments

M-by-N2-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.

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.

[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.

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.

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

MSER regions object, returned as a MSERRegions

object. The object contains information about MSER features detected in the

grayscale input image.

More About

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.

7ca596e69f4beeb6964a1c27ca5472c4.png

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.

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

原文:http://www.cnblogs.com/dawnminghuang/p/3779552.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值