OpenCV 2.4.2

org.opencv.calib3d
Class StereoBM

java.lang.Object
  extended by org.opencv.calib3d.StereoBM

public class StereoBM
extends java.lang.Object

Class for computing stereo correspondence using the block matching algorithm.

The class is a C++ wrapper for the associated functions. In particular, :ocv:funcx:"StereoBM.operator()" is the wrapper for "cvFindStereoCorrespondenceBM".

See Also:
org.opencv.calib3d.StereoBM

Field Summary
static int BASIC_PRESET
           
static int FISH_EYE_PRESET
           
static int NARROW_PRESET
           
protected  long nativeObj
           
static int PREFILTER_NORMALIZED_RESPONSE
           
static int PREFILTER_XSOBEL
           
 
Constructor Summary
  StereoBM()
          The constructors.
  StereoBM(int preset)
          The constructors.
  StereoBM(int preset, int ndisparities, int SADWindowSize)
          The constructors.
protected StereoBM(long addr)
           
 
Method Summary
 void compute(Mat left, Mat right, Mat disparity)
          Computes disparity using the BM algorithm for a rectified stereo pair.
 void compute(Mat left, Mat right, Mat disparity, int disptype)
          Computes disparity using the BM algorithm for a rectified stereo pair.
protected  void finalize()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASIC_PRESET

public static final int BASIC_PRESET
See Also:
Constant Field Values

FISH_EYE_PRESET

public static final int FISH_EYE_PRESET
See Also:
Constant Field Values

NARROW_PRESET

public static final int NARROW_PRESET
See Also:
Constant Field Values

nativeObj

protected final long nativeObj

PREFILTER_NORMALIZED_RESPONSE

public static final int PREFILTER_NORMALIZED_RESPONSE
See Also:
Constant Field Values

PREFILTER_XSOBEL

public static final int PREFILTER_XSOBEL
See Also:
Constant Field Values
Constructor Detail

StereoBM

public StereoBM()

The constructors.

The constructors initialize StereoBM state. You can then call StereoBM.operator() to compute disparity for a specific stereo pair.

Note: In the C API you need to deallocate CvStereoBM state when it is not needed anymore using cvReleaseStereoBMState(&stereobm).

See Also:
org.opencv.calib3d.StereoBM.StereoBM

StereoBM

public StereoBM(int preset)

The constructors.

The constructors initialize StereoBM state. You can then call StereoBM.operator() to compute disparity for a specific stereo pair.

Note: In the C API you need to deallocate CvStereoBM state when it is not needed anymore using cvReleaseStereoBMState(&stereobm).

Parameters:
preset - specifies the whole set of algorithm parameters, one of:
  • BASIC_PRESET - parameters suitable for general cameras
  • FISH_EYE_PRESET - parameters suitable for wide-angle cameras
  • NARROW_PRESET - parameters suitable for narrow-angle cameras

After constructing the class, you can override any parameters set by the preset.

See Also:
org.opencv.calib3d.StereoBM.StereoBM

StereoBM

public StereoBM(int preset,
                int ndisparities,
                int SADWindowSize)

The constructors.

The constructors initialize StereoBM state. You can then call StereoBM.operator() to compute disparity for a specific stereo pair.

Note: In the C API you need to deallocate CvStereoBM state when it is not needed anymore using cvReleaseStereoBMState(&stereobm).

Parameters:
preset - specifies the whole set of algorithm parameters, one of:
  • BASIC_PRESET - parameters suitable for general cameras
  • FISH_EYE_PRESET - parameters suitable for wide-angle cameras
  • NARROW_PRESET - parameters suitable for narrow-angle cameras

After constructing the class, you can override any parameters set by the preset.

ndisparities - the disparity search range. For each pixel algorithm will find the best disparity from 0 (default minimum disparity) to ndisparities. The search range can then be shifted by changing the minimum disparity.
SADWindowSize - 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.
See Also:
org.opencv.calib3d.StereoBM.StereoBM

StereoBM

protected StereoBM(long addr)
Method Detail

compute

public void compute(Mat left,
                    Mat right,
                    Mat disparity)

Computes disparity using the BM algorithm for a rectified stereo pair.

The method executes the BM algorithm on a rectified stereo pair. See the stereo_match.cpp OpenCV sample on how to prepare images and call the method. Note that the method is not constant, thus you should not use the same StereoBM instance from within different threads simultaneously. The function is parallelized with the TBB library.

Parameters:
left - Left 8-bit single-channel image.
right - Right image of the same size and the same type as the left one.
disparity - Output disparity map. It has the same size as the input images. When disptype==CV_16S, the map is a 16-bit signed single-channel image, containing disparity values scaled by 16. To get the true disparity values from such fixed-point representation, you will need to divide each disp element by 16. If disptype==CV_32F, the disparity map will already contain the real disparity values on output.
See Also:
org.opencv.calib3d.StereoBM.operator()

compute

public void compute(Mat left,
                    Mat right,
                    Mat disparity,
                    int disptype)

Computes disparity using the BM algorithm for a rectified stereo pair.

The method executes the BM algorithm on a rectified stereo pair. See the stereo_match.cpp OpenCV sample on how to prepare images and call the method. Note that the method is not constant, thus you should not use the same StereoBM instance from within different threads simultaneously. The function is parallelized with the TBB library.

Parameters:
left - Left 8-bit single-channel image.
right - Right image of the same size and the same type as the left one.
disparity - Output disparity map. It has the same size as the input images. When disptype==CV_16S, the map is a 16-bit signed single-channel image, containing disparity values scaled by 16. To get the true disparity values from such fixed-point representation, you will need to divide each disp element by 16. If disptype==CV_32F, the disparity map will already contain the real disparity values on output.
disptype - Type of the output disparity map, CV_16S (default) or CV_32F.
See Also:
org.opencv.calib3d.StereoBM.operator()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

Official OpenCV 2.4 Documentation