@Namespace(value="cv") @Properties(inherit=opencv_calib3d.class) public class StereoBM extends StereoMatcher
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Modifier and Type | Field and Description |
|---|---|
static int |
PREFILTER_NORMALIZED_RESPONSE
enum cv::StereoBM::
|
static int |
PREFILTER_XSOBEL
enum cv::StereoBM::
|
DISP_SCALE, DISP_SHIFT| Constructor and Description |
|---|
StereoBM(Algorithm pointer)
Downcast constructor.
|
StereoBM(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static StereoBM |
create() |
static StereoBM |
create(int numDisparities,
int blockSize)
\brief Creates StereoBM object
|
int |
getPreFilterCap()
\brief Gets the current truncation value for prefiltered pixels.
|
int |
getPreFilterSize()
\brief Gets the current size of the pre-filter kernel.
|
int |
getPreFilterType()
\brief Gets the type of pre-filtering currently used in the algorithm.
|
Rect |
getROI1()
\brief Gets the current Region of Interest (ROI) for the left image.
|
Rect |
getROI2()
\brief Gets the current Region of Interest (ROI) for the right image.
|
int |
getSmallerBlockSize()
\brief Gets the current size of the smaller block used for texture check.
|
int |
getTextureThreshold()
\brief Gets the current texture threshold value.
|
int |
getUniquenessRatio()
\brief Gets the current uniqueness ratio value.
|
void |
setPreFilterCap(int preFilterCap)
\brief Sets the truncation value for prefiltered pixels.
|
void |
setPreFilterSize(int preFilterSize)
\brief Sets the size of the pre-filter kernel.
|
void |
setPreFilterType(int preFilterType)
\brief Sets the type of pre-filtering used in the algorithm.
|
void |
setROI1(Rect roi1)
\brief Sets the Region of Interest (ROI) for the left image.
|
void |
setROI2(Rect roi2)
\brief Sets the Region of Interest (ROI) for the right image.
|
void |
setSmallerBlockSize(int blockSize)
\brief Sets the size of the smaller block used for texture check.
|
void |
setTextureThreshold(int textureThreshold)
\brief Sets the threshold for filtering low-texture regions.
|
void |
setUniquenessRatio(int uniquenessRatio)
\brief Sets the uniqueness ratio for filtering ambiguous matches.
|
asAlgorithm, asAlgorithm, compute, compute, compute, getBlockSize, getDisp12MaxDiff, getMinDisparity, getNumDisparities, getSpeckleRange, getSpeckleWindowSize, setBlockSize, setDisp12MaxDiff, setMinDisparity, setNumDisparities, setSpeckleRange, setSpeckleWindowSizeclear, empty, getDefaultName, getPointer, position, read, save, save, write, write, writeaddress, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, trimMemory, withDeallocator, zeropublic static final int PREFILTER_NORMALIZED_RESPONSE
public static final int PREFILTER_XSOBEL
public StereoBM(Pointer p)
Pointer(Pointer).public StereoBM(Algorithm pointer)
public int getPreFilterType()
public void setPreFilterType(int preFilterType)
preFilterType - The type of pre-filter to use. Possible values are:
- PREFILTER_NORMALIZED_RESPONSE (0): Uses normalized response for pre-filtering.
- PREFILTER_XSOBEL (1): Uses the X-Sobel operator for pre-filtering.
\details The pre-filter type affects how the images are prepared before computing the disparity map. Different pre-filtering methods can enhance specific image features or reduce noise, influencing the quality of the disparity map.public int getPreFilterSize()
public void setPreFilterSize(int preFilterSize)
preFilterSize - The size of the pre-filter kernel. Must be an odd integer, typically between 5 and 255.
\details The pre-filter size determines the spatial extent of the pre-filtering operation, which prepares the images for disparity computation by normalizing brightness and enhancing texture. Larger sizes reduce noise but may blur details, while smaller sizes preserve details but are more susceptible to noise.public int getPreFilterCap()
public void setPreFilterCap(int preFilterCap)
preFilterCap - The truncation value. Typically in the range [1, 63].
\details This value caps the output of the pre-filter to [-preFilterCap, preFilterCap], helping to reduce the impact of noise and outliers in the pre-filtered image.public int getTextureThreshold()
public void setTextureThreshold(int textureThreshold)
textureThreshold - The threshold value. Must be non-negative.
\details This parameter filters out regions with low texture, where establishing correspondences is difficult, thus reducing noise in the disparity map. Higher values filter more aggressively but may discard valid information.public int getUniquenessRatio()
public void setUniquenessRatio(int uniquenessRatio)
uniquenessRatio - The uniqueness ratio value. Typically in the range [5, 15], but can be from 0 to 100.
\details This parameter ensures that the best match is sufficiently better than the next best match, reducing false positives. Higher values are stricter but may filter out valid matches in difficult regions.public int getSmallerBlockSize()
public void setSmallerBlockSize(int blockSize)
blockSize - The size of the smaller block. Must be an odd integer between 5 and 255.
\details This parameter determines the size of the block used to compute texture variance. Smaller blocks capture finer details but are more sensitive to noise, while larger blocks are more robust but may miss fine details.@ByVal public Rect getROI1()
public void setROI1(@ByVal Rect roi1)
roi1 - The ROI rectangle for the left image.
\details By setting the ROI, the stereo matching computation is limited to the specified region, improving performance and potentially accuracy by focusing on relevant parts of the image.@ByVal public Rect getROI2()
public void setROI2(@ByVal Rect roi2)
roi2 - The ROI rectangle for the right image.
\details Similar to setROI1, this limits the computation to the specified region in the right image.@opencv_core.Ptr public static StereoBM create(int numDisparities, int blockSize)
numDisparities - The disparity search range. For each pixel, the algorithm will find the best disparity from 0 (default minimum disparity) to numDisparities. The search range can 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 a higher chance for the algorithm to find a wrong correspondence.@opencv_core.Ptr public static StereoBM create()
Copyright © 2026. All rights reserved.