Table of Contents

Class CvXImgProc.RL

Namespace
OpenCvSharp.XImgProc
Assembly
OpenCvSharp.dll

run_length_morphology.hpp

public static class CvXImgProc.RL
Inheritance
CvXImgProc.RL
Inherited Members

Methods

CreateRLEImage(IEnumerable<Point3i>, OutputArray, Size?)

Creates a run-length encoded image from a vector of runs (column begin, column end, row)

public static void CreateRLEImage(IEnumerable<Point3i> runs, OutputArray res, Size? size = null)

Parameters

runs IEnumerable<Point3i>

vector of runs

res OutputArray

result

size Size?

image size (to be used if an "on" boundary should be used in erosion, using the default means that the size is computed from the extension of the input)

Dilate(InputArray, OutputArray, InputArray, Point?)

Dilates an run-length encoded binary image by using a specific structuring element.

public static void Dilate(InputArray rlSrc, OutputArray rlDest, InputArray rlKernel, Point? anchor = null)

Parameters

rlSrc InputArray

input image

rlDest OutputArray

result

rlKernel InputArray

kernel

anchor Point?

position of the anchor within the element; default value (0, 0) is usually the element center.

Erode(InputArray, OutputArray, InputArray, bool, Point?)

Erodes an run-length encoded binary image by using a specific structuring element.

public static void Erode(InputArray rlSrc, OutputArray rlDest, InputArray rlKernel, bool bBoundaryOn = true, Point? anchor = null)

Parameters

rlSrc InputArray

input image

rlDest OutputArray

result

rlKernel InputArray

kernel

bBoundaryOn bool

indicates whether pixel outside the image boundary are assumed to be on (True: works in the same way as the default of cv::erode, False: is a little faster)

anchor Point?

position of the anchor within the element; default value (0, 0) is usually the element center.

GetStructuringElement(MorphShapes, Size)

Returns a run length encoded structuring element of the specified size and shape.

public static Mat GetStructuringElement(MorphShapes shape, Size ksize)

Parameters

shape MorphShapes

Element shape that can be one of cv::MorphShapes

ksize Size

Size of the structuring element.

Returns

Mat

IsRLMorphologyPossible(InputArray)

Check whether a custom-made structuring element can be used with run length morphological operations. (It must consist of a continuous array of single runs per row)

public static bool IsRLMorphologyPossible(InputArray rlStructuringElement)

Parameters

rlStructuringElement InputArray

Returns

bool

MorphologyEx(InputArray, OutputArray, MorphTypes, InputArray, bool, Point?)

Applies a morphological operation to a run-length encoded binary image.

public static void MorphologyEx(InputArray rlSrc, OutputArray rlDest, MorphTypes op, InputArray rlKernel, bool bBoundaryOnForErosion = true, Point? anchor = null)

Parameters

rlSrc InputArray

input image

rlDest OutputArray

result

op MorphTypes

all operations supported by cv::morphologyEx (except cv::MORPH_HITMISS)

rlKernel InputArray

kernel

bBoundaryOnForErosion bool

indicates whether pixel outside the image boundary are assumed to be on for erosion operations (True: works in the same way as the default of cv::erode, False: is a little faster)

anchor Point?

position of the anchor within the element; default value (0, 0) is usually the element center.

Paint(InputOutputArray, InputArray, Scalar)

Paint run length encoded binary image into an image.

public static void Paint(InputOutputArray image, InputArray rlSrc, Scalar value)

Parameters

image InputOutputArray

image to paint into (currently only single channel images).

rlSrc InputArray

run length encoded image

value Scalar

all foreground pixel of the binary image are set to this value

Threshold(InputArray, OutputArray, double, ThresholdTypes)

Applies a fixed-level threshold to each array element.

public static void Threshold(InputArray src, OutputArray rlDest, double thresh, ThresholdTypes type)

Parameters

src InputArray

input array (single-channel).

rlDest OutputArray

resulting run length encoded image.

thresh double

threshold value.

type ThresholdTypes

thresholding type (only cv::THRESH_BINARY and cv::THRESH_BINARY_INV are supported)