Class GraphSegmentation
- Namespace
- OpenCvSharp.XImgProc.Segmentation
- Assembly
- OpenCvSharp.dll
Graph Based Segmentation Algorithm. The class implements the algorithm described in @cite PFF2004.
public class GraphSegmentation : Algorithm, IDisposable, ICvPtrHolder
- Inheritance
-
GraphSegmentation
- Implements
- Inherited Members
Constructors
GraphSegmentation(nint)
Creates instance by raw pointer
protected GraphSegmentation(nint p)
Parameters
pnint
Properties
K
public virtual float K { get; set; }
Property Value
MinSize
public virtual int MinSize { get; set; }
Property Value
Sigma
public virtual double Sigma { get; set; }
Property Value
Methods
Create(double, float, int)
Creates a graph based segmentor
public static GraphSegmentation Create(double sigma = 0.5, float k = 300, int minSize = 100)
Parameters
sigmadoubleThe sigma parameter, used to smooth image
kfloatThe k parameter of the algorithm
minSizeintThe minimum size of segments
Returns
DisposeManaged()
Releases managed resources
protected override void DisposeManaged()
ProcessImage(InputArray, OutputArray)
Segment an image and store output in dst
public virtual void ProcessImage(InputArray src, OutputArray dst)
Parameters
srcInputArrayThe input image. Any number of channel (1 (Eg: Gray), 3 (Eg: RGB), 4 (Eg: RGB-D)) can be provided
dstOutputArrayThe output segmentation. It's a CV_32SC1 Mat with the same number of cols and rows as input image, with an unique, sequential, id for each pixel.