linemod_Detector
import { linemod_Detector } 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.
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;modalitiesModalities to use (color gradients, depth normals, ...).
T_pyramidValue of the sampling step T at each pyramid level. The number of pyramid levels is T_pyramid.size().
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;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;sourcesSource images, one for each modality.
thresholdSimilarity threshold, a percentage between 0 and 100.
matchesOutput destination, filled by the native operation. Template matches, sorted by similarity score.
class_idsIf non-empty, only search for the desired object classes.
quantized_imagesOutput destination, filled by the native operation. Optionally return vector<Mat> of quantized images.
masksThe 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;sourcesSource images, one for each modality.
class_idObject class ID.
object_maskMask separating object from background.
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;templatestemplates argument (linemod__TemplateVector).
class_idclass id argument (EmbindString).
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;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_levelpyramid level argument (number).
The number result.
pyramidLevels
Get number of pyramid levels used by this detector.
pyramidLevels(): number;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_idclass id argument (EmbindString).
template_idtemplate id argument (number).
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;The number result.
numTemplates1
Return the number of stored LINEMOD templates for the supplied class identifier.
numTemplates1(class_id: EmbindString): number;class_idclass id argument (EmbindString).
The number result.
numClasses
Return the number of object classes stored in this template detector.
numClasses(): number;The number result.
classIds
Return an owned string vector containing the detector's object class identifiers.
classIds(): StringVector;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;fnfn 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_idsclass ids argument (StringVector).
formatformat argument (EmbindString).
writeClasses
Serialize LINEMOD configuration or class templates to the supplied file storage in this instance's virtual filesystem.
writeClasses(format: EmbindString): void;formatformat 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.