Skip to content

StereoBM

stereoclassOpenCV 5.0.0
import { StereoBM } 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 StereoMatcher.

Class for computing stereo correspondence using the block matching algorithm, introduced and contributed to OpenCV by K. Konolige.

Constructors and members

static create

Creates StereoBM object

create(numDisparities: number, blockSize: number): StereoBM | null;
3 available overloads
create(): StereoBM | null;
create(numDisparities: number): StereoBM | null;
create(numDisparities: number, blockSize: number): StereoBM | null;
numDisparities

the disparity search range. For each pixel algorithm will find the best disparity from 0 (default minimum disparity) to numDisparities. The search range can then be shifted by changing the minimum disparity.

blockSize

the linear size of the blocks compared by the algorithm. The size should be odd (as the block is centered at the current pixel). Larger block size implies smoother, though less accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher chance for algorithm to find a wrong correspondence.

The function create StereoBM object. You can then call StereoBM::compute() to compute disparity for a specific stereo pair.

Returns

The StereoBM | 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;
Returns

The this result.

getPreFilterType

Return the pre filter type configured on this StereoBM object.

getPreFilterType(): number;
Returns

The number result.

setPreFilterType

Set the pre filter type used by this StereoBM object.

setPreFilterType(preFilterType: number): void;
preFilterType

pre filter type argument (number).

getPreFilterSize

Return the pre filter size configured on this StereoBM object.

getPreFilterSize(): number;
Returns

The number result.

setPreFilterSize

Set the pre filter size used by this StereoBM object.

setPreFilterSize(preFilterSize: number): void;
preFilterSize

pre filter size argument (number).

getPreFilterCap

Return the pre filter cap configured on this StereoBM object.

getPreFilterCap(): number;
Returns

The number result.

setPreFilterCap

Set the pre filter cap used by this StereoBM object.

setPreFilterCap(preFilterCap: number): void;
preFilterCap

pre filter cap argument (number).

getTextureThreshold

Return the texture threshold configured on this StereoBM object.

getTextureThreshold(): number;
Returns

The number result.

setTextureThreshold

Set the texture threshold used by this StereoBM object.

setTextureThreshold(textureThreshold: number): void;
textureThreshold

texture threshold argument (number).

getUniquenessRatio

Return the uniqueness ratio configured on this StereoBM object.

getUniquenessRatio(): number;
Returns

The number result.

setUniquenessRatio

Set the uniqueness ratio used by this StereoBM object.

setUniquenessRatio(uniquenessRatio: number): void;
uniquenessRatio

uniqueness ratio argument (number).

getSmallerBlockSize

Return the smaller block size configured on this StereoBM object.

getSmallerBlockSize(): number;
Returns

The number result.

setSmallerBlockSize

Set the smaller block size used by this StereoBM object.

setSmallerBlockSize(blockSize: number): void;
blockSize

block size argument (number).

getROI1

Return the roi1 configured on this StereoBM object.

getROI1(): Rect;
Returns

The Rect result.

setROI1

Set the roi1 used by this StereoBM object.

setROI1(roi1: Rect): void;
roi1

roi1 argument (Rect).

getROI2

Return the roi2 configured on this StereoBM object.

getROI2(): Rect;
Returns

The Rect result.

setROI2

Set the roi2 used by this StereoBM object.

setROI2(roi2: Rect): void;
roi2

roi2 argument (Rect).

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.