//
//M*/
-#ifndef _CV_HPP_
-#define _CV_HPP_
+#ifndef __OPENCV_CV_HPP__
+#define __OPENCV_CV_HPP__
#ifdef __cplusplus
enum { MORPH_RECT=0, MORPH_CROSS=1, MORPH_ELLIPSE=2 };
CV_EXPORTS Mat getStructuringElement(int shape, Size ksize, Point anchor=Point(-1,-1));
+template<> inline void Ptr<IplConvKernel>::delete_obj()
+{ cvReleaseStructuringElement(&obj); }
+
+
CV_EXPORTS void copyMakeBorder( const Mat& src, Mat& dst,
int top, int bottom, int left, int right,
int borderType, const Scalar& value=Scalar() );
CV_EXPORTS void initUndistortRectifyMap( const Mat& cameraMatrix, const Mat& distCoeffs,
const Mat& R, const Mat& newCameraMatrix,
Size size, int m1type, Mat& map1, Mat& map2 );
+CV_EXPORTS Mat getOptimalNewCameraMatrix( const Mat& cameraMatrix, const Mat& distCoeffs,
+ Size imageSize, double alpha, Size newImgSize=Size(),
+ Rect* validPixROI=0);
CV_EXPORTS Mat getDefaultNewCameraMatrix( const Mat& cameraMatrix, Size imgsize=Size(),
bool centerPrincipalPoint=false );
CV_EXPORTS void grabCut( const Mat& img, Mat& mask, Rect rect,
Mat& bgdModel, Mat& fgdModel,
- int iterCount, int flag = GC_EVAL );
+ int iterCount, int mode = GC_EVAL );
enum { INPAINT_NS=CV_INPAINT_NS, INPAINT_TELEA=CV_INPAINT_TELEA };
CHAIN_APPROX_TC89_L1=CV_CHAIN_APPROX_TC89_L1,
CHAIN_APPROX_TC89_KCOS=CV_CHAIN_APPROX_TC89_KCOS };
-CV_EXPORTS void findContours( const Mat& image, vector<vector<Point> >& contours,
+CV_EXPORTS void findContours( Mat& image, vector<vector<Point> >& contours,
vector<Vec4i>& hierarchy, int mode,
int method, Point offset=Point());
-CV_EXPORTS void findContours( const Mat& image, vector<vector<Point> >& contours,
+CV_EXPORTS void findContours( Mat& image, vector<vector<Point> >& contours,
int mode, int method, Point offset=Point());
CV_EXPORTS void drawContours( Mat& image, const vector<vector<Point> >& contours,
///////////////////////////// Object Detection ////////////////////////////
CV_EXPORTS void groupRectangles(vector<Rect>& rectList, int groupThreshold, double eps=0.2);
+CV_EXPORTS void groupRectangles(vector<Rect>& rectList, vector<int>& weights, int groupThreshold, double eps=0.2);
class CV_EXPORTS FeatureEvaluator
{
Size imageSize, const Mat& R, const Mat& T,
Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q,
int flags=CALIB_ZERO_DISPARITY );
+
+CV_EXPORTS void stereoRectify( const Mat& cameraMatrix1, const Mat& distCoeffs1,
+ const Mat& cameraMatrix2, const Mat& distCoeffs2,
+ Size imageSize, const Mat& R, const Mat& T,
+ Mat& R1, Mat& R2, Mat& P1, Mat& P2, Mat& Q,
+ double alpha, Size newImageSize=Size(),
+ Rect* validPixROI1=0, Rect* validPixROI2=0,
+ int flags=CALIB_ZERO_DISPARITY );
CV_EXPORTS bool stereoRectifyUncalibrated( const Mat& points1,
const Mat& points2,
class CV_EXPORTS StereoBM
{
public:
- enum { NORMALIZED_RESPONSE = CV_STEREO_BM_NORMALIZED_RESPONSE,
+ enum { PREFILTER_NORMALIZED_RESPONSE = CV_STEREO_BM_NORMALIZED_RESPONSE,
+ PREFILTER_XSOBEL = CV_STEREO_BM_XSOBEL,
BASIC_PRESET=CV_STEREO_BM_BASIC,
FISH_EYE_PRESET=CV_STEREO_BM_FISH_EYE,
NARROW_PRESET=CV_STEREO_BM_NARROW };
StereoBM();
StereoBM(int preset, int ndisparities=0, int SADWindowSize=21);
void init(int preset, int ndisparities=0, int SADWindowSize=21);
- void operator()( const Mat& left, const Mat& right, Mat& disparity );
+ void operator()( const Mat& left, const Mat& right, Mat& disparity, int disptype=CV_16S );
Ptr<CvStereoBMState> state;
};
+
+class CV_EXPORTS StereoSGBM
+{
+public:
+ enum { DISP_SHIFT=4, DISP_SCALE = (1<<DISP_SHIFT) };
+
+ StereoSGBM();
+ StereoSGBM(int minDisparity, int numDisparities, int SADWindowSize,
+ int P1=0, int P2=0, int disp12MaxDiff=0,
+ int preFilterCap=0, int uniquenessRatio=0,
+ int speckleWindowSize=0, int speckleRange=0,
+ bool fullDP=false);
+ virtual ~StereoSGBM();
+
+ virtual void operator()(const Mat& left, const Mat& right, Mat& disp);
+
+ int minDisparity;
+ int numberOfDisparities;
+ int SADWindowSize;
+ int preFilterCap;
+ int uniquenessRatio;
+ int P1, P2;
+ int speckleWindowSize;
+ int speckleRange;
+ int disp12MaxDiff;
+ bool fullDP;
+
+protected:
+ Mat buffer;
+};
+
+
+CV_EXPORTS void filterSpeckles( Mat& img, double newVal, int maxSpeckleSize, double maxDiff, Mat& buf );
+
+CV_EXPORTS Rect getValidDisparityROI( Rect roi1, Rect roi2,
+ int minDisparity, int numberOfDisparities,
+ int SADWindowSize );
+
+CV_EXPORTS void validateDisparity( Mat& disparity, const Mat& cost,
+ int minDisparity, int numberOfDisparities,
+ int disp12MaxDisp=1 );
+
CV_EXPORTS void reprojectImageTo3D( const Mat& disparity,
Mat& _3dImage, const Mat& Q,
bool handleMissingValues=false );
};
-class CV_EXPORTS StarDetector : CvStarDetectorParams
+class CV_EXPORTS StarDetector : public CvStarDetectorParams
{
public:
StarDetector();
void step();
enum { DONE=0, STARTED=1, CALC_J=2, CHECK_ERR=3 };
- CvMat* mask;
- CvMat* prevParam;
- CvMat* param;
- CvMat* J;
- CvMat* err;
- CvMat* JtJ;
- CvMat* JtJN;
- CvMat* JtErr;
- CvMat* JtJV;
- CvMat* JtJW;
+ cv::Ptr<CvMat> mask;
+ cv::Ptr<CvMat> prevParam;
+ cv::Ptr<CvMat> param;
+ cv::Ptr<CvMat> J;
+ cv::Ptr<CvMat> err;
+ cv::Ptr<CvMat> JtJ;
+ cv::Ptr<CvMat> JtJN;
+ cv::Ptr<CvMat> JtErr;
+ cv::Ptr<CvMat> JtJV;
+ cv::Ptr<CvMat> JtJW;
double prevErrNorm, errNorm;
int lambdaLg10;
CvTermCriteria criteria;
#endif /* __cplusplus */
-#endif /* _CV_HPP_ */
+#endif
/* End of file. */