Skip to content

linemod_Detector

rgbdclassOpenCV 5.0.0
import { linemod_Detector } from '@banou/opencv-wasm'

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

ARGUMENTSConstructor or factory
CLASSlinemod_Detector
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.

Object detector using the LINE template matching algorithm with any set of modalities.

Constructors and members

static new

Empty constructor, initialize with read().

new(modalities: Ptr_cv__linemod__ModalityVector, T_pyramid: IntVector): linemod_Detector;
2 available overloads
new(): linemod_Detector;
new(modalities: Ptr_cv__linemod__ModalityVector, T_pyramid: IntVector): linemod_Detector;
modalities

Modalities to use (color gradients, depth normals, ...).

T_pyramid

Value of the sampling step T at each pyramid level. The number of pyramid levels is T_pyramid.size().

Returns

The linemod_Detector 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.

match

Detect objects by template matching.

Matches globally at the lowest pyramid level, then refines locally stepping up the pyramid.

match(sources: MatVector, threshold: number, matches: linemod__MatchVector, class_ids: StringVector, quantized_images: MatVector, masks: MatVector): void;
4 available overloads
match(sources: MatVector, threshold: number, matches: linemod__MatchVector): void;
match(sources: MatVector, threshold: number, matches: linemod__MatchVector, class_ids: StringVector): void;
match(sources: MatVector, threshold: number, matches: linemod__MatchVector, class_ids: StringVector, quantized_images: MatVector): void;
match(sources: MatVector, threshold: number, matches: linemod__MatchVector, class_ids: StringVector, quantized_images: MatVector, masks: MatVector): void;
sources

Source images, one for each modality.

threshold

Similarity threshold, a percentage between 0 and 100.

matches

Output destination, filled by the native operation. Template matches, sorted by similarity score.

class_ids

If non-empty, only search for the desired object classes.

quantized_images

Output destination, filled by the native operation. Optionally return vector<Mat> of quantized images.

masks

The masks for consideration during matching. The masks should be CV_8UC1 where 255 represents a valid pixel. If non-empty, the vector must be the same size as sources. Each element must be empty or the same size as its corresponding source.

addTemplate

Add new object template.

addTemplate(sources: MatVector, class_id: EmbindString, object_mask: Mat): linemod_Detector_addTemplateResult;
sources

Source images, one for each modality.

class_id

Object class ID.

object_mask

Mask separating object from background.

Returns

Template ID, or -1 if failed to extract a valid template. Scalar output parameters are returned as named fields in this object. Release returned native handles with using or delete(), including handles nested in results.

addSyntheticTemplate

Add a new object template computed by external means.

addSyntheticTemplate(templates: linemod__TemplateVector, class_id: EmbindString): number;
templates

templates argument (linemod__TemplateVector).

class_id

class id argument (EmbindString).

Returns

The number result.

getModalities

Get the modalities used by this detector.

You are not permitted to add/remove modalities, but you may dynamic_cast them to tweak parameters.

getModalities(): Ptr_cv__linemod__ModalityVector;
Returns

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

getT

Get sampling step T at pyramid_level.

getT(pyramid_level: number): number;
pyramid_level

pyramid level argument (number).

Returns

The number result.

pyramidLevels

Get number of pyramid levels used by this detector.

pyramidLevels(): number;
Returns

The number result.

getTemplates

Get the template pyramid identified by template_id.

For example, with 2 modalities (Gradient, Normal) and two pyramid levels (L0, L1), the order is (GradientL0, NormalL0, GradientL1, NormalL1).

getTemplates(class_id: EmbindString, template_id: number): linemod__TemplateVector;
class_id

class id argument (EmbindString).

template_id

template id argument (number).

Returns

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

numTemplates

Return the number of stored LINEMOD templates across classes.

numTemplates(): number;
Returns

The number result.

numTemplates1

Return the number of stored LINEMOD templates for the supplied class identifier.

numTemplates1(class_id: EmbindString): number;
class_id

class id argument (EmbindString).

Returns

The number result.

numClasses

Return the number of object classes stored in this template detector.

numClasses(): number;
Returns

The number result.

classIds

Return an owned string vector containing the detector's object class identifiers.

classIds(): StringVector;
Returns

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

read

Load LINEMOD modality, detector or class configuration from the supplied file storage. File paths refer to this instance's virtual filesystem.

read(fn: FileNode): void;
fn

fn argument (FileNode).

readClasses

Load LINEMOD modality, detector or class configuration from the supplied file storage. File paths refer to this instance's virtual filesystem.

readClasses(class_ids: StringVector, format: EmbindString): void;
2 available overloads
readClasses(class_ids: StringVector): void;
readClasses(class_ids: StringVector, format: EmbindString): void;
class_ids

class ids argument (StringVector).

format

format argument (EmbindString).

writeClasses

Serialize LINEMOD configuration or class templates to the supplied file storage in this instance's virtual filesystem.

writeClasses(format: EmbindString): void;
2 available overloads
writeClasses(): void;
writeClasses(format: EmbindString): void;
format

format argument (EmbindString).

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.