Up: Component summary Component

SegmentImage

Segments a directory of images with various methods. The method choices are:

Example:
SourceOutputs

Chart for the minsize/maxsize area restrictions:

Chart for the minround/maxround roundness restrictions:

Version 2.3
Bundle anima
Categories Image Processing
Authors Ville Rantanen (ville.rantanen@helsinki.fi)
Issue tracker View/Report issues
Requires Matlab
Source files component.xml shapesegment.m imagesegment.m kmeanssegment.m snakesegment.m snakeiterate.m correlationsegment.m execute.m
Usage Example with default values

Inputs

Name Type Mandatory Description
in ImageList Mandatory A directory with grayscale image files.
opt ImageList Optional A directory with grayscale image files used in Correlation method.
seed MaskList Optional Masklist of objects as initial guess for the 'Snake' method. e.g. output from Ellipse2Masklist.

Outputs

Name Type Description
mask ImageList BW PNG images.
perimeter ImageList BW PNG images of the perimeter of the mask.
numbered ImageList BW PNG images of the numbers of the objects in the mask. Created only if parameter numbers is set true.
masklist MaskList Image folder structure describing each object. One folder of images for each source image.

Parameters

Name Type Default Description
clearBorders boolean true Clear objects touching the image edges. Applicable to all methods.
clusters float 2 Clusters for KMeans method. The result mask will have as many gray scales as cluster number. Results with number higher than 2 will not be compatible with the feature measurements components, and object numbering doesn't work.
constant float 0.5 Constant value for threshdolding the images, for 'Constant' method. Range 0 to 1. Also, the area ratio in ConstantArea method.
corr float 1 Correction multiplier for threshold value in 'Otsu' and 'Correlation' method.
fill boolean true Fill holes in segmented objects. Applicable to all methods.
maskList boolean false Produce masklist entry for each object. Forced true with 'Snake' method.
maxArea float 0 Maximum accepted pixel area in all methods. 0-1 is considered as ratio of image size. Use 0 for no limit.
maxEcc float 1 Maximum accepted eccentricity value. Default=line
maxRound float 1 Maximum accepted roundness value.
method string "Otsu" Method for image segmentation. Choose from 'Otsu', 'Constant', 'Shape', 'ConstantArea', 'KMeans', 'Snake', 'Wavelet', 'Correlation', 'Grid'.
minArea float 0 Minimum accepted pixel area in all methods.
minEcc float 0 Minimum accepted eccentricity value. Default=circle
minInt float 0 Minimum accepted intensity value in 'Shape' and 'Otsu' method. Ranges 0-1.
minRound float 0 Minimum accepted roundness value.
numbers boolean false Draw images of the numbers of the objects in the mask. This can be a lengthy process if there are huge amounts of objects.
snakeParam string "0.7,0.65,1,0.7,0.65,0.65,0.65,100" Parameters for active contour method. Must be a comma separated list of eight numbers. Explanation in the following order:
  • alpha: Controls tension
  • beta: Controls rigidity
  • gamma: Step size (note, smaller is bigger step)
  • kappa: Controls enegry term
  • wl: line component weight
  • we: edge component weight
  • wt: terminal energy component weight
  • iterations: No. of iteration for which snake is to be moved.
waveletParam string "4,5" Parameters for Wavelet method. Must be a comma separated list of two numbers. Explanation in the following order:
  • minscale: Smalles scale level to use
  • maxscale: Largest scale level to use

Test cases

Test case Parameters IN
in
IN
opt
IN
seed
OUT
mask
OUT
perimeter
OUT
numbered
OUT
masklist
case1 properties in (missing) (missing) mask perimeter (missing) (missing)

method=Shape,
minRound=0.6,
maxRound=1,
minArea=200,
maxArea=2000

case2 properties in (missing) (missing) mask perimeter (missing) (missing)

method=Otsu,
minArea=200,
maxArea=2000,
corr=0.7,
numbers=true,
maskList=true

case3_kmeans properties in (missing) (missing) mask perimeter (missing) (missing)

method=KMeans,
clusters=3,
numbers=false,
minArea=30

case4_snake properties in (missing) seed mask perimeter numbered (missing)

method=snake,
numbers=true,
minArea=10,
snakeParam=0.1, 0.35,0.007,0.4,0.25,0.65,0.25,40


Generated 2019-02-08 07:42:07 by Anduril 2.0.0