mcc_CCheckerDetector
import { mcc_CCheckerDetector } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;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;netthe neural network, if the network in empty, then the function will return false.
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;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;imageimage in color space BGR
regionsOfInterestregions of image to look for the chart, if it is empty, charts are looked for in the entire image
ncnumber of charts in the image, if you don't know the exact then keeping this number high helps.
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;imageimage in color space BGR
ncnumber of charts in the image, if you don't know the exact then keeping this number high helps.
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;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;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;checkersThe checkers which will be drawn by this object.
imgInput/output value, modified by the native operation. image in color space BGR
colorThe color by with which the squares of the checker will be drawn
thicknessThe thickness with which the sqaures will be drawn
getRefColors
Gets the reference color for chart.
getRefColors(): Mat;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;paramsDetectorParametersMCC structure containing detection configuration parameters.
setColorChartType
Sets the color chart type for MCC detection.
setColorChartType(chartType: number): void;chartTypeColorChart 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;useDnnBoolean 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;The boolean result.
getDetectionParams
Read the detection params.
Sets the detection paramaters for mcc.
getDetectionParams(): mcc_DetectorParametersMCC;The mcc_DetectorParametersMCC result.
getColorChartType
Read the color chart type.
Sets the color chart type for MCC detection.
getColorChartType(): number;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.