Segmentation_Growin​g(img,sx1,sx2,sy1,s​y2,f)

バージョン 1.32.0.0 (2.65 KB) 作成者: Ingo Hermann
This function grows from a certain area with a weigthing to the outer boarder of the object
ダウンロード: 268
更新 2016/12/16

ライセンスの表示

This Matlab Function segmentate a object of an image while choosing an area and growing from it with a weighting factor to the boundaries. (see here a description: http://physingo-en.blogspot.de/2016/12/matlab-segmentation-growing.html )
function [region, area, seed, sx1, sx2, sy1, sy2] = Segmentation_Growing(img,sx1,sx2,sy1,sy2,f)
%img is the image which is segmentated
%sx1 and sy1 are the values of the upper left corner and
%sx2 and sy2 are the values of the lower right corner
%f can vary between 1 and 2 and is the weigthing factor
%region is the output of the segmentated region
%if area is in region it's one otherwise it's 0
%seed is the start area
This is a methode of segmentation where a region is defined (seed) . In this seed the standard deviation and the mean is calculated and with a factor f it is weigthed. Pixel which are in the neighborhood of the seed are added to the seed if their value is in the boundary defined by the standard deviation, mean value and weighting factor f. This is done iterative as long as no more pixel is added to the seed. Then the object is segmented.
function [region, area, seed, sx1, sx2, sy1, sy2] = Segmentation_Growing(img,sx1,sx2,sy1,sy2,f):

This function needs an image as an imput. If there is no other input value one can choose with to cursors the starting point sx1, sy1, the left upper corner, and the end point sx2, sy2, the right lower corner. Otherwise one can define the s-value as one wants. If one uses cursors, one can use the second input argument for defining the factor f. This factor describes the weigthing and is in an area bigger equal to 0. This is shown in the following figure below for f=1 (blue), f=1.5 (yellow) and f=2 (green). The red rect shows the chosen seed.
The output of the function is region, which is the segmented object. Area describes the segmented area with value 1 and the rest as 0. Seed logically returns seed, if it is chosen by the cursors.

引用

Ingo Hermann (2024). Segmentation_Growing(img,sx1,sx2,sy1,sy2,f) (https://www.mathworks.com/matlabcentral/fileexchange/60715-segmentation_growing-img-sx1-sx2-sy1-sy2-f), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2016b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersFeature Detection and Extraction についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.32.0.0

Update 1.32: Added a comment

1.31.0.0

Update 1.31: Update description text.

1.3.0.0

Update 1.3: Now one an choose any region with the cursor and the distance output is better scaled.

1.2.0.0

Update 1.2: better definition of area in the code.

1.1.0.0

Update 1.1: It is now possible to segmentate black areas.

1.0.0.0