ppf_match_3d_PPF3DDetector
import { ppf_match_3d_PPF3DDetector } 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.
Class, allowing the load and matching 3D models. Typical Use:
// Train a model
ppf_match_3d::PPF3DDetector detector(0.05, 0.05);
detector.trainModel(pc);
// Search the model in a given scene
vector<Pose3DPtr> results;
detector.match(pcTest, results, 1.0/5.0,0.05);
Constructors and members
static new
Empty constructor. Sets default arguments
new(relativeSamplingStep: number, relativeDistanceStep: number, numAngles: number): ppf_match_3d_PPF3DDetector;4 available overloads
new(): ppf_match_3d_PPF3DDetector;new(_0: number): ppf_match_3d_PPF3DDetector;new(relativeSamplingStep: number, relativeDistanceStep: number): ppf_match_3d_PPF3DDetector;new(relativeSamplingStep: number, relativeDistanceStep: number, numAngles: number): ppf_match_3d_PPF3DDetector;_00 argument (number).
relativeSamplingStepSampling distance relative to the object's diameter. Models are first sampled uniformly in order to improve efficiency. Decreasing this value leads to a denser model, and a more accurate pose estimation but the larger the model, the slower the training. Increasing the value leads to a less accurate pose computation but a smaller model and faster model generation and matching. Beware of the memory consumption when using small values.
relativeDistanceStepThe discretization distance of the point pair distance relative to the model's diameter. This value has a direct impact on the hashtable. Using small values would lead to too fine discretization, and thus ambiguity in the bins of hashtable. Too large values would lead to no discrimination over the feature vectors and different point pair features would be assigned to the same bin. This argument defaults to the value of RelativeSamplingStep. For noisy scenes, the value can be increased to improve the robustness of the matching against noisy points.
numAnglesSet the discretization of the point pair orientation as the number of subdivisions of the angle. This value is the equivalent of RelativeDistanceStep for the orientations. Increasing the value increases the precision of the matching but decreases the robustness against incorrect normal directions. Decreasing the value decreases the precision of the matching but increases the robustness against incorrect normal directions. For very noisy scenes where the normal directions can not be computed accurately, the value can be set to 25 or 20.
The ppf_match_3d_PPF3DDetector 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.
trainModel
Trains a new model.
trainModel(Model: Mat): void;ModelThe input point cloud with normals (Nx6)
Uses the parameters set in the constructor to downsample and learn a new model. When the model is learnt, the instance gets ready for calling "match".
match
Matches a trained model across a provided scene.
match(scene: Mat, results: Ptr_cv__ppf_match_3d__Pose3DVector, relativeSceneSampleStep: number, relativeSceneDistance: number): void;3 available overloads
match(scene: Mat, results: Ptr_cv__ppf_match_3d__Pose3DVector): void;match(scene: Mat, results: Ptr_cv__ppf_match_3d__Pose3DVector, relativeSceneSampleStep: number): void;match(scene: Mat, results: Ptr_cv__ppf_match_3d__Pose3DVector, relativeSceneSampleStep: number, relativeSceneDistance: number): void;scenePoint cloud for the scene
resultsOutput destination, filled by the native operation. List of output poses
relativeSceneSampleStepThe ratio of scene points to be used for the matching after sampling with relativeSceneDistance. For example, if this value is set to 1.0/5.0, every 5th point from the scene is used for pose estimation. This parameter allows an easy trade-off between speed and accuracy of the matching. Increasing the value leads to less points being used and in turn to a faster but less accurate pose computation. Decreasing the value has the inverse effect.
relativeSceneDistanceSet the distance threshold relative to the diameter of the model. This parameter is equivalent to relativeSamplingStep in the training stage. This parameter acts like a prior sampling with the relativeSceneSampleStep parameter.
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.