Stitcher
import { Stitcher } 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.
example: samples/cpp/snippets/stitching.cpp A basic example on image stitching example: samples/python/snippets/stitching.py A basic example on image stitching in Python. example: samples/cpp/stitching_detailed.cpp A detailed example on image stitching High level image stitcher.
It's possible to use this class without being aware of the entire stitching pipeline. However, to be able to achieve higher stitching stability and quality of the final images at least being familiar with the theory is recommended.
Note: - A basic example on image stitching can be found at opencv_source_code/samples/cpp/stitching.cpp
- A basic example on image stitching in Python can be found at opencv_source_code/samples/python/stitching.py
- A detailed example on image stitching can be found at opencv_source_code/samples/cpp/stitching_detailed.cpp
Constructors and members
static create
Creates a Stitcher configured in one of the stitching modes.
create(mode: number): Stitcher | null;modeScenario for stitcher operation. This is usually determined by source of images to stitch and their transformation. Default parameters will be chosen for operation in given scenario.
Stitcher class instance.
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.
registrationResol
Return the image resolution in megapixels used for feature registration.
registrationResol(): number;The number result.
setRegistrationResol
Set the registration resol used by this Stitcher object.
setRegistrationResol(resol_mpx: number): void;resol_mpxresol mpx argument (number).
seamEstimationResol
Return the image resolution in megapixels used for seam estimation.
seamEstimationResol(): number;The number result.
setSeamEstimationResol
Set the seam estimation resol used by this Stitcher object.
setSeamEstimationResol(resol_mpx: number): void;resol_mpxresol mpx argument (number).
compositingResol
Return the image resolution in megapixels used for panorama compositing; a negative value denotes original resolution.
compositingResol(): number;The number result.
setCompositingResol
Set the compositing resol used by this Stitcher object.
setCompositingResol(resol_mpx: number): void;resol_mpxresol mpx argument (number).
panoConfidenceThresh
Return the confidence threshold used to decide whether images belong to the same panorama.
panoConfidenceThresh(): number;The number result.
setPanoConfidenceThresh
Set the pano confidence thresh used by this Stitcher object.
setPanoConfidenceThresh(conf_thresh: number): void;conf_threshconf thresh argument (number).
waveCorrection
Return whether wave-effect correction is enabled for the estimated camera rotations.
waveCorrection(): boolean;The boolean result.
setWaveCorrection
Set the wave correction used by this Stitcher object.
setWaveCorrection(flag: boolean): void;flagflag argument (boolean).
interpolationFlags
Return the interpolation mode used when warping panorama images.
interpolationFlags(): number;The number result.
setInterpolationFlags
Set the interpolation flags used by this Stitcher object.
setInterpolationFlags(interp_flags: number): void;interp_flagsinterp flags argument (number).
estimateTransform
These functions try to match the given images and to estimate rotations of each camera.
Note: Use the functions only if you're aware of the stitching pipeline, otherwise use Stitcher::stitch.
estimateTransform(images: MatVector, masks: MatVector): number;2 available overloads
estimateTransform(images: MatVector): number;estimateTransform(images: MatVector, masks: MatVector): number;imagesInput images.
masksMasks for each input image specifying where to look for keypoints (optional).
Status code.
composePanorama
These functions try to compose the given images (or images stored internally from the other function calls) into the final pano under the assumption that the image transformations were estimated before.
Note: Use the functions only if you're aware of the stitching pipeline, otherwise use Stitcher::stitch.
composePanorama(pano: Mat): number;panoOutput destination, filled by the native operation. Final pano.
Status code.
composePanorama1
These functions try to compose the given images (or images stored internally from the other function calls) into the final pano under the assumption that the image transformations were estimated before.
Note: Use the functions only if you're aware of the stitching pipeline, otherwise use Stitcher::stitch.
composePanorama1(images: MatVector, pano: Mat): number;imagesInput images.
panoOutput destination, filled by the native operation. Final pano.
Status code.
stitch
These functions try to stitch the given images.
stitch(images: MatVector, pano: Mat): number;imagesInput images.
panoOutput destination, filled by the native operation. Final pano.
Status code.
stitch1
These functions try to stitch the given images.
stitch1(images: MatVector, masks: MatVector, pano: Mat): number;imagesInput images.
masksMasks for each input image specifying where to look for keypoints (optional).
panoOutput destination, filled by the native operation. Final pano.
Status code.
component
Returns indices of input images used in panorama stitching
component(): IntVector;The IntVector result. Release returned native handles with using or delete(), including handles nested in results.
cameras
Returns estimated camera parameters for all stitched images
cameras(): detail__CameraParamsVector;The detail__CameraParamsVector result. Release returned native handles with using or delete(), including handles nested in results.
workScale
Return the scale used to resize input images during feature registration.
workScale(): 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.