Table of Contents

Class HfsSegment

Namespace
Emgu.CV.Hfs
Assembly
Emgu.CV.dll

Hierarchical Feature Selection for Efficient Image Segmentation

public class HfsSegment : SharedPtrObject, IDisposable, IAlgorithm
Inheritance
HfsSegment
Implements
Inherited Members
Extension Methods

Constructors

HfsSegment(int, int, float, int, float, int, float, int, int)

Create a hfs object

public HfsSegment(int height, int width, float segEgbThresholdI = 0.08, int minRegionSizeI = 100, float segEgbThresholdII = 0.28, int minRegionSizeII = 200, float spatialWeight = 0.6, int slicSpixelSize = 8, int numSlicIter = 5)

Parameters

height int

The height of the input image

width int

The width of the input image

segEgbThresholdI float

segEgbThresholdI

minRegionSizeI int

minRegionSizeI

segEgbThresholdII float

segEgbThresholdII

minRegionSizeII int

minRegionSizeII

spatialWeight float

spatialWeight

slicSpixelSize int

slicSpixelSize

numSlicIter int

numSlicIter

Properties

AlgorithmPtr

Native algorithm pointer

public nint AlgorithmPtr { get; }

Property Value

nint

Methods

DisposeObject()

Release all the unmanaged memory associate with this object

protected override void DisposeObject()

PerformSegmentCpu(IInputArray, bool)

Segmentation with cpu. This method is only implemented for reference. It is highly NOT recommended to use it.

public Mat PerformSegmentCpu(IInputArray src, bool ifDraw = true)

Parameters

src IInputArray

The input image

ifDraw bool

if draw the image in the returned Mat. if this parameter is false, then the content of the returned Mat is a matrix of index, describing the region each pixel belongs to. And it's data type is CV_16U. If this parameter is true, then the returned Mat is a segmented picture, and color of each region is the average color of all pixels in that region. And it's data type is the same as the input image

Returns

Mat

Segmentation result

PerformSegmentGpu(IInputArray, bool)

Segmentation with gpu

public Mat PerformSegmentGpu(IInputArray src, bool ifDraw = true)

Parameters

src IInputArray

The input image

ifDraw bool

if draw the image in the returned Mat. if this parameter is false, then the content of the returned Mat is a matrix of index, describing the region each pixel belongs to. And it's data type is CV_16U. If this parameter is true, then the returned Mat is a segmented picture, and color of each region is the average color of all pixels in that region. And it's data type is the same as the input image

Returns

Mat

Segmentation result