Class HfsSegment
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
intThe height of the input image
width
intThe width of the input image
segEgbThresholdI
floatsegEgbThresholdI
minRegionSizeI
intminRegionSizeI
segEgbThresholdII
floatsegEgbThresholdII
minRegionSizeII
intminRegionSizeII
spatialWeight
floatspatialWeight
slicSpixelSize
intslicSpixelSize
numSlicIter
intnumSlicIter
Properties
AlgorithmPtr
Native algorithm pointer
public nint AlgorithmPtr { get; }
Property Value
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
IInputArrayThe input image
ifDraw
boolif 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
IInputArrayThe input image
ifDraw
boolif 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