Table of Contents

Class IntelligentScissorsMB

Namespace
OpenCvSharp.Segmentation
Assembly
OpenCvSharp.dll

Intelligent Scissors image segmentation

This class is used to find the path (contour) between two points which can be used for image segmentation.

Usage example: @snippet snippets/imgproc_segmentation.cpp usage_example_intelligent_scissors

Reference: Intelligent Scissors for Image Composition http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.138.3811&rep=rep1&type=pdf algorithm designed by Eric N. Mortensen and William A. Barrett, Brigham Young University @cite Mortensen95intelligentscissors

public class IntelligentScissorsMB : CvObject, IDisposable
Inheritance
IntelligentScissorsMB
Implements
Inherited Members

Constructors

IntelligentScissorsMB()

Constructor

Methods

ApplyImage(InputArray)

Specify input image and extract image features

ApplyImageFeatures(InputArray, InputArray, InputArray, InputArray)

Specify custom features of imput image Customized advanced variant of applyImage() call.

BuildMap(Point)

Prepares a map of optimal paths for the given source point on the image Note: applyImage() / applyImageFeatures() must be called before this call

GetContour(Point, OutputArray, bool)

Extracts optimal contour for the given target point on the image Note: buildMap() must be called before this call

SetEdgeFeatureCannyParameters(double, double, int, bool)

Switch edge feature extractor to use Canny edge detector Note: "Laplacian Zero-Crossing" feature extractor is used by default (following to original article)

SetEdgeFeatureZeroCrossingParameters(float)

Switch to "Laplacian Zero-Crossing" edge feature extractor and specify its parameters

This feature extractor is used by default according to article.

Implementation has additional filtering for regions with low-amplitude noise. This filtering is enabled through parameter of minimal gradient amplitude (use some small value 4, 8, 16).

@note Current implementation of this feature extractor is based on processing of grayscale images (color image is converted to grayscale image first).

@note Canny edge detector is a bit slower, but provides better results (especially on color images): use setEdgeFeatureCannyParameters().

SetGradientMagnitudeMaxLimit(float)

Specify gradient magnitude max value threshold

Zero limit value is used to disable gradient magnitude thresholding (default behavior, as described in original article). Otherwize pixels with gradient magnitude >= threshold have zero cost.

@note Thresholding should be used for images with irregular regions (to avoid stuck on parameters from high-contract areas, like embedded logos).

SetWeights(float, float, float)

Specify weights of feature functions

Consider keeping weights normalized (sum of weights equals to 1.0) Discrete dynamic programming (DP) goal is minimization of costs between pixels.