Skip to content

mcc_CCheckerDetector

objdetectclassOpenCV 5.0.0
import { mcc_CCheckerDetector } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSmcc_CCheckerDetector
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Algorithm.

A class to find the positions of the ColorCharts in the image.

Constructors and members

static create

Returns the implementation of the CCheckerDetector.

create(): mcc_CCheckerDetector | null;
Returns

The mcc_CCheckerDetector | null result.

static create1

Set the net which will be used to find the approximate bounding boxes for the color charts. And returns the implementation of the CCheckerDetector.

It is not necessary to use this, but this usually results in better detection rate.

create1(net: dnn_Net): mcc_CCheckerDetector | null;
net

the neural network, if the network in empty, then the function will return false.

Returns

The mcc_CCheckerDetector | null result.

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

processWithROI

Find the ColorCharts in the given image.

The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker()

processWithROI(image: Mat, regionsOfInterest: RectVector, nc: number): boolean;
2 available overloads
processWithROI(image: Mat, regionsOfInterest: RectVector): boolean;
processWithROI(image: Mat, regionsOfInterest: RectVector, nc: number): boolean;
image

image in color space BGR

regionsOfInterest

regions of image to look for the chart, if it is empty, charts are looked for in the entire image

nc

number of charts in the image, if you don't know the exact then keeping this number high helps.

Returns

true if atleast one chart is detected otherwise false

process

Find the ColorCharts in the given image.

Differs from the above one only in the arguments.

This version searches for the chart in the full image.

The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker()

process(image: Mat, nc: number): boolean;
2 available overloads
process(image: Mat): boolean;
process(image: Mat, nc: number): boolean;
image

image in color space BGR

nc

number of charts in the image, if you don't know the exact then keeping this number high helps.

Returns

true if atleast one chart is detected otherwise false

getBestColorChecker

Get the best color checker. By the best it means the one detected with the highest confidence.

getBestColorChecker(): mcc_CChecker | null;
Returns

checker A single colorchecker, if atleast one colorchecker was detected, 'nullptr' otherwise.

getListColorChecker

Get the list of all detected colorcheckers

getListColorChecker(): Ptr_cv__mcc__CCheckerVector;
Returns

checkers vector of colorcheckers Release returned native handles with using or delete(), including handles nested in results.

draw

Draws the checker to the given image.

draw(checkers: Ptr_cv__mcc__CCheckerVector, img: Mat, color: Scalar, thickness: number): void;
3 available overloads
draw(checkers: Ptr_cv__mcc__CCheckerVector, img: Mat): void;
draw(checkers: Ptr_cv__mcc__CCheckerVector, img: Mat, color: Scalar): void;
draw(checkers: Ptr_cv__mcc__CCheckerVector, img: Mat, color: Scalar, thickness: number): void;
checkers

The checkers which will be drawn by this object.

img

Input/output value, modified by the native operation. image in color space BGR

color

The color by with which the squares of the checker will be drawn

thickness

The thickness with which the sqaures will be drawn

getRefColors

Gets the reference color for chart.

getRefColors(): Mat;
Returns

The Mat result. Release returned native handles with using or delete(), including handles nested in results.

setDetectionParams

Sets the detection paramaters for mcc.

setDetectionParams(params: mcc_DetectorParametersMCC): void;
params

DetectorParametersMCC structure containing detection configuration parameters.

setColorChartType

Sets the color chart type for MCC detection.

setColorChartType(chartType: number): void;
chartType

ColorChart enum specifying the type of color chart to detect.

setUseDnnModel

Enables or disables the use of the neural network for detection.

setUseDnnModel(useDnn: boolean): void;
useDnn

Boolean flag to indicate whether to use neural network (true) or not (false).

getUseDnnModel

Read the use dnn model.

Enables or disables the use of the neural network for detection.

getUseDnnModel(): boolean;
Returns

The boolean result.

getDetectionParams

Read the detection params.

Sets the detection paramaters for mcc.

getDetectionParams(): mcc_DetectorParametersMCC;
Returns

The mcc_DetectorParametersMCC result.

getColorChartType

Read the color chart type.

Sets the color chart type for MCC detection.

getColorChartType(): number;
Returns

The number result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.