Class SegmentationModel
- Namespace
- OpenCvSharp.Dnn
- Assembly
- OpenCvSharp.dll
This class represents high-level API for segmentation models. SegmentationModel allows to set params for preprocessing input image. SegmentationModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and returns the class prediction for each pixel.
public class SegmentationModel : Model, IDisposable
- Inheritance
-
SegmentationModel
- Implements
- Inherited Members
Constructors
SegmentationModel(Net)
Create model from deep learning network.
public SegmentationModel(Net network)
Parameters
networkNetNet object.
SegmentationModel(string, string?)
Create segmentation model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.
public SegmentationModel(string model, string? config = null)
Parameters
modelstringBinary file contains trained weights.
configstringText file contains network configuration.
Methods
Segment(InputArray, OutputArray)
Given the @p input frame, create input blob, run net.
public void Segment(InputArray frame, OutputArray mask)
Parameters
frameInputArrayThe input image.
maskOutputArrayAllocated class prediction for each pixel.