#ifndef __OPENCV_IMGPROC_HPP__
#define __OPENCV_IMGPROC_HPP__
-#include "opencv2/imgproc/types_c.h"
-
-#ifdef __cplusplus
-
#include "opencv2/core.hpp"
/*! \namespace cv
namespace cv
{
-//! various border interpolation methods
-enum { BORDER_REPLICATE=IPL_BORDER_REPLICATE, BORDER_CONSTANT=IPL_BORDER_CONSTANT,
- BORDER_REFLECT=IPL_BORDER_REFLECT, BORDER_WRAP=IPL_BORDER_WRAP,
- BORDER_REFLECT_101=IPL_BORDER_REFLECT_101, BORDER_REFLECT101=BORDER_REFLECT_101,
- BORDER_TRANSPARENT=IPL_BORDER_TRANSPARENT,
- BORDER_DEFAULT=BORDER_REFLECT_101, BORDER_ISOLATED=16 };
+//! Various border types, image boundaries are denoted with '|'
+enum {
+ BORDER_CONSTANT = 0, // iiiiii|abcdefgh|iiiiiii with some specified 'i'
+ BORDER_REPLICATE = 1, // aaaaaa|abcdefgh|hhhhhhh
+ BORDER_REFLECT = 2, // fedcba|abcdefgh|hgfedcb
+ BORDER_WRAP = 3, // cdefgh|abcdefgh|abcdefg
+ BORDER_REFLECT_101 = 4, // gfedcb|abcdefgh|gfedcba
+ BORDER_TRANSPARENT = 5, // uvwxyz|absdefgh|ijklmno
+
+ BORDER_REFLECT101 = BORDER_REFLECT_101,
+ BORDER_DEFAULT = BORDER_REFLECT_101,
+ BORDER_ISOLATED = 16 // do not look outside of ROI
+ };
+
+//! type of the kernel
+enum { KERNEL_GENERAL = 0, // the kernel is generic. No any type of symmetry or other properties.
+ KERNEL_SYMMETRICAL = 1, // kernel[i] == kernel[ksize-i-1] , and the anchor is at the center
+ KERNEL_ASYMMETRICAL = 2, // kernel[i] == -kernel[ksize-i-1] , and the anchor is at the center
+ KERNEL_SMOOTH = 4, // all the kernel elements are non-negative and summed to 1
+ KERNEL_INTEGER = 8 // all the kernel coefficients are integer numbers
+ };
+
+//! type of morphological operation
+enum { MORPH_ERODE = 0,
+ MORPH_DILATE = 1,
+ MORPH_OPEN = 2,
+ MORPH_CLOSE = 3,
+ MORPH_GRADIENT = 4,
+ MORPH_TOPHAT = 5,
+ MORPH_BLACKHAT = 6
+ };
+
+//! shape of the structuring element
+enum { MORPH_RECT = 0,
+ MORPH_CROSS = 1,
+ MORPH_ELLIPSE = 2
+ };
+
+//! interpolation algorithm
+enum { INTER_NEAREST = 0, //!< nearest neighbor interpolation
+ INTER_LINEAR = 1, //!< bilinear interpolation
+ INTER_CUBIC = 2, //!< bicubic interpolation
+ INTER_AREA = 3, //!< area-based (or super) interpolation
+ INTER_LANCZOS4 = 4, //!< Lanczos interpolation over 8x8 neighborhood
+
+ INTER_MAX = 7, //!< mask for interpolation codes
+ WARP_INVERSE_MAP = 16
+ };
+
+enum { INTER_BITS = 5,
+ INTER_BITS2 = INTER_BITS * 2,
+ INTER_TAB_SIZE = 1 << INTER_BITS,
+ INTER_TAB_SIZE2 = INTER_TAB_SIZE * INTER_TAB_SIZE
+ };
+
+//! Distance types for Distance Transform and M-estimators
+enum { DIST_USER = -1, // User defined distance
+ DIST_L1 = 1, // distance = |x1-x2| + |y1-y2|
+ DIST_L2 = 2, // the simple euclidean distance
+ DIST_C = 3, // distance = max(|x1-x2|,|y1-y2|)
+ DIST_L12 = 4, // L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1))
+ DIST_FAIR = 5, // distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998
+ DIST_WELSCH = 6, // distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846
+ DIST_HUBER = 7 // distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345
+};
+
+//! Mask size for distance transform
+enum { DIST_MASK_3 = 3,
+ DIST_MASK_5 = 5,
+ DIST_MASK_PRECISE = 0
+ };
+
+//! type of the threshold operation
+enum { THRESH_BINARY = 0, // value = value > threshold ? max_value : 0
+ THRESH_BINARY_INV = 1, // value = value > threshold ? 0 : max_value
+ THRESH_TRUNC = 2, // value = value > threshold ? threshold : value
+ THRESH_TOZERO = 3, // value = value > threshold ? value : 0
+ THRESH_TOZERO_INV = 4, // value = value > threshold ? 0 : value
+ THRESH_MASK = 7,
+ THRESH_OTSU = 8 // use Otsu algorithm to choose the optimal threshold value
+ };
+
+//! adaptive threshold algorithm
+enum { ADAPTIVE_THRESH_MEAN_C = 0,
+ ADAPTIVE_THRESH_GAUSSIAN_C = 1
+ };
+
+enum { PROJ_SPHERICAL_ORTHO = 0,
+ PROJ_SPHERICAL_EQRECT = 1
+ };
+
+//! class of the pixel in GrabCut algorithm
+enum { GC_BGD = 0, //!< background
+ GC_FGD = 1, //!< foreground
+ GC_PR_BGD = 2, //!< most probably background
+ GC_PR_FGD = 3 //!< most probably foreground
+ };
+
+//! GrabCut algorithm flags
+enum { GC_INIT_WITH_RECT = 0,
+ GC_INIT_WITH_MASK = 1,
+ GC_EVAL = 2
+};
+
+//! distanceTransform algorithm flags
+enum { DIST_LABEL_CCOMP = 0,
+ DIST_LABEL_PIXEL = 1
+ };
+
+//! floodfill algorithm flags
+enum { FLOODFILL_FIXED_RANGE = 1 << 16,
+ FLOODFILL_MASK_ONLY = 1 << 17
+ };
+
+//! type of the template matching operation
+enum { TM_SQDIFF = 0,
+ TM_SQDIFF_NORMED = 1,
+ TM_CCORR = 2,
+ TM_CCORR_NORMED = 3,
+ TM_CCOEFF = 4,
+ TM_CCOEFF_NORMED = 5
+ };
+
+//! connected components algorithm output formats
+enum { CC_STAT_LEFT = 0,
+ CC_STAT_TOP = 1,
+ CC_STAT_WIDTH = 2,
+ CC_STAT_HEIGHT = 3,
+ CC_STAT_AREA = 4,
+ CC_STAT_MAX = 5
+ };
+
+//! mode of the contour retrieval algorithm
+enum { RETR_EXTERNAL = 0, //!< retrieve only the most external (top-level) contours
+ RETR_LIST = 1, //!< retrieve all the contours without any hierarchical information
+ RETR_CCOMP = 2, //!< retrieve the connected components (that can possibly be nested)
+ RETR_TREE = 3, //!< retrieve all the contours and the whole hierarchy
+ RETR_FLOODFILL = 4
+ };
+
+//! the contour approximation algorithm
+enum { CHAIN_APPROX_NONE = 1,
+ CHAIN_APPROX_SIMPLE = 2,
+ CHAIN_APPROX_TC89_L1 = 3,
+ CHAIN_APPROX_TC89_KCOS = 4
+ };
+
+//! Variants of a Hough transform
+enum { HOUGH_STANDARD = 0,
+ HOUGH_PROBABILISTIC = 1,
+ HOUGH_MULTI_SCALE = 2,
+ HOUGH_GRADIENT = 3
+ };
+
+//! Histogram comparison methods
+enum { HISTCMP_CORREL = 0,
+ HISTCMP_CHISQR = 1,
+ HISTCMP_INTERSECT = 2,
+ HISTCMP_BHATTACHARYYA = 3,
+ HISTCMP_HELLINGER = HISTCMP_BHATTACHARYYA
+ };
+
+//! the color conversion code
+enum { COLOR_BGR2BGRA = 0,
+ COLOR_RGB2RGBA = COLOR_BGR2BGRA,
+
+ COLOR_BGRA2BGR = 1,
+ COLOR_RGBA2RGB = COLOR_BGRA2BGR,
+
+ COLOR_BGR2RGBA = 2,
+ COLOR_RGB2BGRA = COLOR_BGR2RGBA,
+
+ COLOR_RGBA2BGR = 3,
+ COLOR_BGRA2RGB = COLOR_RGBA2BGR,
+
+ COLOR_BGR2RGB = 4,
+ COLOR_RGB2BGR = COLOR_BGR2RGB,
+
+ COLOR_BGRA2RGBA = 5,
+ COLOR_RGBA2BGRA = COLOR_BGRA2RGBA,
+
+ COLOR_BGR2GRAY = 6,
+ COLOR_RGB2GRAY = 7,
+ COLOR_GRAY2BGR = 8,
+ COLOR_GRAY2RGB = COLOR_GRAY2BGR,
+ COLOR_GRAY2BGRA = 9,
+ COLOR_GRAY2RGBA = COLOR_GRAY2BGRA,
+ COLOR_BGRA2GRAY = 10,
+ COLOR_RGBA2GRAY = 11,
+
+ COLOR_BGR2BGR565 = 12,
+ COLOR_RGB2BGR565 = 13,
+ COLOR_BGR5652BGR = 14,
+ COLOR_BGR5652RGB = 15,
+ COLOR_BGRA2BGR565 = 16,
+ COLOR_RGBA2BGR565 = 17,
+ COLOR_BGR5652BGRA = 18,
+ COLOR_BGR5652RGBA = 19,
+
+ COLOR_GRAY2BGR565 = 20,
+ COLOR_BGR5652GRAY = 21,
+
+ COLOR_BGR2BGR555 = 22,
+ COLOR_RGB2BGR555 = 23,
+ COLOR_BGR5552BGR = 24,
+ COLOR_BGR5552RGB = 25,
+ COLOR_BGRA2BGR555 = 26,
+ COLOR_RGBA2BGR555 = 27,
+ COLOR_BGR5552BGRA = 28,
+ COLOR_BGR5552RGBA = 29,
+
+ COLOR_GRAY2BGR555 = 30,
+ COLOR_BGR5552GRAY = 31,
+
+ COLOR_BGR2XYZ = 32,
+ COLOR_RGB2XYZ = 33,
+ COLOR_XYZ2BGR = 34,
+ COLOR_XYZ2RGB = 35,
+
+ COLOR_BGR2YCrCb = 36,
+ COLOR_RGB2YCrCb = 37,
+ COLOR_YCrCb2BGR = 38,
+ COLOR_YCrCb2RGB = 39,
+
+ COLOR_BGR2HSV = 40,
+ COLOR_RGB2HSV = 41,
+
+ COLOR_BGR2Lab = 44,
+ COLOR_RGB2Lab = 45,
+
+ COLOR_BGR2Luv = 50,
+ COLOR_RGB2Luv = 51,
+ COLOR_BGR2HLS = 52,
+ COLOR_RGB2HLS = 53,
+
+ COLOR_HSV2BGR = 54,
+ COLOR_HSV2RGB = 55,
+
+ COLOR_Lab2BGR = 56,
+ COLOR_Lab2RGB = 57,
+ COLOR_Luv2BGR = 58,
+ COLOR_Luv2RGB = 59,
+ COLOR_HLS2BGR = 60,
+ COLOR_HLS2RGB = 61,
+
+ COLOR_BGR2HSV_FULL = 66,
+ COLOR_RGB2HSV_FULL = 67,
+ COLOR_BGR2HLS_FULL = 68,
+ COLOR_RGB2HLS_FULL = 69,
+
+ COLOR_HSV2BGR_FULL = 70,
+ COLOR_HSV2RGB_FULL = 71,
+ COLOR_HLS2BGR_FULL = 72,
+ COLOR_HLS2RGB_FULL = 73,
+
+ COLOR_LBGR2Lab = 74,
+ COLOR_LRGB2Lab = 75,
+ COLOR_LBGR2Luv = 76,
+ COLOR_LRGB2Luv = 77,
+
+ COLOR_Lab2LBGR = 78,
+ COLOR_Lab2LRGB = 79,
+ COLOR_Luv2LBGR = 80,
+ COLOR_Luv2LRGB = 81,
+
+ COLOR_BGR2YUV = 82,
+ COLOR_RGB2YUV = 83,
+ COLOR_YUV2BGR = 84,
+ COLOR_YUV2RGB = 85,
+
+ // YUV 4:2:0 family to RGB
+ COLOR_YUV2RGB_NV12 = 90,
+ COLOR_YUV2BGR_NV12 = 91,
+ COLOR_YUV2RGB_NV21 = 92,
+ COLOR_YUV2BGR_NV21 = 93,
+ COLOR_YUV420sp2RGB = COLOR_YUV2RGB_NV21,
+ COLOR_YUV420sp2BGR = COLOR_YUV2BGR_NV21,
+
+ COLOR_YUV2RGBA_NV12 = 94,
+ COLOR_YUV2BGRA_NV12 = 95,
+ COLOR_YUV2RGBA_NV21 = 96,
+ COLOR_YUV2BGRA_NV21 = 97,
+ COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21,
+ COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21,
+
+ COLOR_YUV2RGB_YV12 = 98,
+ COLOR_YUV2BGR_YV12 = 99,
+ COLOR_YUV2RGB_IYUV = 100,
+ COLOR_YUV2BGR_IYUV = 101,
+ COLOR_YUV2RGB_I420 = COLOR_YUV2RGB_IYUV,
+ COLOR_YUV2BGR_I420 = COLOR_YUV2BGR_IYUV,
+ COLOR_YUV420p2RGB = COLOR_YUV2RGB_YV12,
+ COLOR_YUV420p2BGR = COLOR_YUV2BGR_YV12,
+
+ COLOR_YUV2RGBA_YV12 = 102,
+ COLOR_YUV2BGRA_YV12 = 103,
+ COLOR_YUV2RGBA_IYUV = 104,
+ COLOR_YUV2BGRA_IYUV = 105,
+ COLOR_YUV2RGBA_I420 = COLOR_YUV2RGBA_IYUV,
+ COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV,
+ COLOR_YUV420p2RGBA = COLOR_YUV2RGBA_YV12,
+ COLOR_YUV420p2BGRA = COLOR_YUV2BGRA_YV12,
+
+ COLOR_YUV2GRAY_420 = 106,
+ COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420,
+ COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420,
+ COLOR_YUV2GRAY_YV12 = COLOR_YUV2GRAY_420,
+ COLOR_YUV2GRAY_IYUV = COLOR_YUV2GRAY_420,
+ COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420,
+ COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420,
+ COLOR_YUV420p2GRAY = COLOR_YUV2GRAY_420,
+
+ // YUV 4:2:2 family to RGB
+ COLOR_YUV2RGB_UYVY = 107,
+ COLOR_YUV2BGR_UYVY = 108,
+ //COLOR_YUV2RGB_VYUY = 109,
+ //COLOR_YUV2BGR_VYUY = 110,
+ COLOR_YUV2RGB_Y422 = COLOR_YUV2RGB_UYVY,
+ COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY,
+ COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY,
+ COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY,
+
+ COLOR_YUV2RGBA_UYVY = 111,
+ COLOR_YUV2BGRA_UYVY = 112,
+ //COLOR_YUV2RGBA_VYUY = 113,
+ //COLOR_YUV2BGRA_VYUY = 114,
+ COLOR_YUV2RGBA_Y422 = COLOR_YUV2RGBA_UYVY,
+ COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY,
+ COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY,
+ COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY,
+
+ COLOR_YUV2RGB_YUY2 = 115,
+ COLOR_YUV2BGR_YUY2 = 116,
+ COLOR_YUV2RGB_YVYU = 117,
+ COLOR_YUV2BGR_YVYU = 118,
+ COLOR_YUV2RGB_YUYV = COLOR_YUV2RGB_YUY2,
+ COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2,
+ COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2,
+ COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2,
+
+ COLOR_YUV2RGBA_YUY2 = 119,
+ COLOR_YUV2BGRA_YUY2 = 120,
+ COLOR_YUV2RGBA_YVYU = 121,
+ COLOR_YUV2BGRA_YVYU = 122,
+ COLOR_YUV2RGBA_YUYV = COLOR_YUV2RGBA_YUY2,
+ COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2,
+ COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2,
+ COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2,
+
+ COLOR_YUV2GRAY_UYVY = 123,
+ COLOR_YUV2GRAY_YUY2 = 124,
+ //CV_YUV2GRAY_VYUY = CV_YUV2GRAY_UYVY,
+ COLOR_YUV2GRAY_Y422 = COLOR_YUV2GRAY_UYVY,
+ COLOR_YUV2GRAY_UYNV = COLOR_YUV2GRAY_UYVY,
+ COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2,
+ COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2,
+ COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2,
+
+ // alpha premultiplication
+ COLOR_RGBA2mRGBA = 125,
+ COLOR_mRGBA2RGBA = 126,
+
+ // RGB to YUV 4:2:0 family
+ COLOR_RGB2YUV_I420 = 127,
+ COLOR_BGR2YUV_I420 = 128,
+ COLOR_RGB2YUV_IYUV = COLOR_RGB2YUV_I420,
+ COLOR_BGR2YUV_IYUV = COLOR_BGR2YUV_I420,
+
+ COLOR_RGBA2YUV_I420 = 129,
+ COLOR_BGRA2YUV_I420 = 130,
+ COLOR_RGBA2YUV_IYUV = COLOR_RGBA2YUV_I420,
+ COLOR_BGRA2YUV_IYUV = COLOR_BGRA2YUV_I420,
+ COLOR_RGB2YUV_YV12 = 131,
+ COLOR_BGR2YUV_YV12 = 132,
+ COLOR_RGBA2YUV_YV12 = 133,
+ COLOR_BGRA2YUV_YV12 = 134,
+
+ // Demosaicing
+ COLOR_BayerBG2BGR = 46,
+ COLOR_BayerGB2BGR = 47,
+ COLOR_BayerRG2BGR = 48,
+ COLOR_BayerGR2BGR = 49,
+
+ COLOR_BayerBG2RGB = COLOR_BayerRG2BGR,
+ COLOR_BayerGB2RGB = COLOR_BayerGR2BGR,
+ COLOR_BayerRG2RGB = COLOR_BayerBG2BGR,
+ COLOR_BayerGR2RGB = COLOR_BayerGB2BGR,
+
+ COLOR_BayerBG2GRAY = 86,
+ COLOR_BayerGB2GRAY = 87,
+ COLOR_BayerRG2GRAY = 88,
+ COLOR_BayerGR2GRAY = 89,
+
+ // Demosaicing using Variable Number of Gradients
+ COLOR_BayerBG2BGR_VNG = 62,
+ COLOR_BayerGB2BGR_VNG = 63,
+ COLOR_BayerRG2BGR_VNG = 64,
+ COLOR_BayerGR2BGR_VNG = 65,
+
+ COLOR_BayerBG2RGB_VNG = COLOR_BayerRG2BGR_VNG,
+ COLOR_BayerGB2RGB_VNG = COLOR_BayerGR2BGR_VNG,
+ COLOR_BayerRG2RGB_VNG = COLOR_BayerBG2BGR_VNG,
+ COLOR_BayerGR2RGB_VNG = COLOR_BayerGB2BGR_VNG,
+
+ // Edge-Aware Demosaicing
+ COLOR_BayerBG2BGR_EA = 135,
+ COLOR_BayerGB2BGR_EA = 136,
+ COLOR_BayerRG2BGR_EA = 137,
+ COLOR_BayerGR2BGR_EA = 138,
+
+ COLOR_BayerBG2RGB_EA = COLOR_BayerRG2BGR_EA,
+ COLOR_BayerGB2RGB_EA = COLOR_BayerGR2BGR_EA,
+ COLOR_BayerRG2RGB_EA = COLOR_BayerBG2BGR_EA,
+ COLOR_BayerGR2RGB_EA = COLOR_BayerGB2BGR_EA,
+
+
+ COLOR_COLORCVT_MAX = 139
+};
+
-//! 1D interpolation function: returns coordinate of the "donor" pixel for the specified location p.
-CV_EXPORTS_W int borderInterpolate( int p, int len, int borderType );
/*!
The Base Class for 1D or Row-wise Filters
//! the destructor
virtual ~BaseRowFilter();
//! the filtering operator. Must be overrided in the derived classes. The horizontal border interpolation is done outside of the class.
- virtual void operator()(const uchar* src, uchar* dst,
- int width, int cn) = 0;
- int ksize, anchor;
+ virtual void operator()(const uchar* src, uchar* dst, int width, int cn) = 0;
+
+ int ksize;
+ int anchor;
};
//! the destructor
virtual ~BaseColumnFilter();
//! the filtering operator. Must be overrided in the derived classes. The vertical border interpolation is done outside of the class.
- virtual void operator()(const uchar** src, uchar* dst, int dststep,
- int dstcount, int width) = 0;
+ virtual void operator()(const uchar** src, uchar* dst, int dststep, int dstcount, int width) = 0;
//! resets the internal buffers, if any
virtual void reset();
- int ksize, anchor;
+
+ int ksize;
+ int anchor;
};
+
/*!
The Base Class for Non-Separable 2D Filters.
//! the destructor
virtual ~BaseFilter();
//! the filtering operator. The horizontal and the vertical border interpolation is done outside of the class.
- virtual void operator()(const uchar** src, uchar* dst, int dststep,
- int dstcount, int width, int cn) = 0;
+ virtual void operator()(const uchar** src, uchar* dst, int dststep, int dstcount, int width, int cn) = 0;
//! resets the internal buffers, if any
virtual void reset();
+
Size ksize;
Point anchor;
};
+
/*!
The Main Class for Image Filtering.
const Ptr<BaseRowFilter>& _rowFilter,
const Ptr<BaseColumnFilter>& _columnFilter,
int srcType, int dstType, int bufType,
- int _rowBorderType=BORDER_REPLICATE,
- int _columnBorderType=-1,
- const Scalar& _borderValue=Scalar());
+ int _rowBorderType = BORDER_REPLICATE,
+ int _columnBorderType = -1,
+ const Scalar& _borderValue = Scalar());
//! the destructor
virtual ~FilterEngine();
//! reinitializes the engine. The previously assigned filters are released.
const Ptr<BaseRowFilter>& _rowFilter,
const Ptr<BaseColumnFilter>& _columnFilter,
int srcType, int dstType, int bufType,
- int _rowBorderType=BORDER_REPLICATE, int _columnBorderType=-1,
- const Scalar& _borderValue=Scalar());
+ int _rowBorderType = BORDER_REPLICATE,
+ int _columnBorderType = -1,
+ const Scalar& _borderValue = Scalar());
//! starts filtering of the specified ROI of an image of size wholeSize.
- virtual int start(Size wholeSize, Rect roi, int maxBufRows=-1);
+ virtual int start(Size wholeSize, Rect roi, int maxBufRows = -1);
//! starts filtering of the specified ROI of the specified image.
- virtual int start(const Mat& src, const Rect& srcRoi=Rect(0,0,-1,-1),
- bool isolated=false, int maxBufRows=-1);
+ virtual int start(const Mat& src, const Rect& srcRoi = Rect(0,0,-1,-1),
+ bool isolated = false, int maxBufRows = -1);
//! processes the next srcCount rows of the image.
virtual int proceed(const uchar* src, int srcStep, int srcCount,
uchar* dst, int dstStep);
//! applies filter to the specified ROI of the image. if srcRoi=(0,0,-1,-1), the whole image is filtered.
virtual void apply( const Mat& src, Mat& dst,
- const Rect& srcRoi=Rect(0,0,-1,-1),
- Point dstOfs=Point(0,0),
- bool isolated=false);
+ const Rect& srcRoi = Rect(0,0,-1,-1),
+ Point dstOfs = Point(0,0),
+ bool isolated = false);
//! returns true if the filter is separable
bool isSeparable() const { return (const BaseFilter*)filter2D == 0; }
//! returns the number
int remainingInputRows() const;
int remainingOutputRows() const;
- int srcType, dstType, bufType;
+ int srcType;
+ int dstType;
+ int bufType;
Size ksize;
Point anchor;
int maxWidth;
Size wholeSize;
Rect roi;
- int dx1, dx2;
- int rowBorderType, columnBorderType;
+ int dx1;
+ int dx2;
+ int rowBorderType;
+ int columnBorderType;
std::vector<int> borderTab;
int borderElemSize;
std::vector<uchar> ringBuf;
std::vector<uchar> srcRow;
std::vector<uchar> constBorderValue;
std::vector<uchar> constBorderRow;
- int bufStep, startY, startY0, endY, rowCount, dstY;
+ int bufStep;
+ int startY;
+ int startY0;
+ int endY;
+ int rowCount;
+ int dstY;
std::vector<uchar*> rows;
Ptr<BaseFilter> filter2D;
Ptr<BaseColumnFilter> columnFilter;
};
-//! type of the kernel
-enum { KERNEL_GENERAL=0, KERNEL_SYMMETRICAL=1, KERNEL_ASYMMETRICAL=2,
- KERNEL_SMOOTH=4, KERNEL_INTEGER=8 };
+
+//! finds arbitrary template in the grayscale image using Generalized Hough Transform
+//! Ballard, D.H. (1981). Generalizing the Hough transform to detect arbitrary shapes. Pattern Recognition 13 (2): 111-122.
+//! Guil, N., González-Linares, J.M. and Zapata, E.L. (1999). Bidimensional shape detection using an invariant approach. Pattern Recognition 32 (6): 1025-1038.
+class CV_EXPORTS GeneralizedHough : public Algorithm
+{
+public:
+ enum { GHT_POSITION = 0,
+ GHT_SCALE = 1,
+ GHT_ROTATION = 2
+ };
+
+ static Ptr<GeneralizedHough> create(int method);
+
+ virtual ~GeneralizedHough();
+
+ //! set template to search
+ void setTemplate(InputArray templ, int cannyThreshold = 100, Point templCenter = Point(-1, -1));
+ void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter = Point(-1, -1));
+
+ //! find template on image
+ void detect(InputArray image, OutputArray positions, OutputArray votes = cv::noArray(), int cannyThreshold = 100);
+ void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes = cv::noArray());
+
+ void release();
+
+protected:
+ virtual void setTemplateImpl(const Mat& edges, const Mat& dx, const Mat& dy, Point templCenter) = 0;
+ virtual void detectImpl(const Mat& edges, const Mat& dx, const Mat& dy, OutputArray positions, OutputArray votes) = 0;
+ virtual void releaseImpl() = 0;
+
+private:
+ Mat edges_;
+ Mat dx_;
+ Mat dy_;
+};
+
+
+class CV_EXPORTS CLAHE : public Algorithm
+{
+public:
+ virtual void apply(InputArray src, OutputArray dst) = 0;
+
+ virtual void setClipLimit(double clipLimit) = 0;
+ virtual double getClipLimit() const = 0;
+
+ virtual void setTilesGridSize(Size tileGridSize) = 0;
+ virtual Size getTilesGridSize() const = 0;
+
+ virtual void collectGarbage() = 0;
+};
+
+
+//! raster image moments
+class CV_EXPORTS_W_MAP Moments
+{
+public:
+ //! the default constructor
+ Moments();
+ //! the full constructor
+ Moments(double m00, double m10, double m01, double m20, double m11,
+ double m02, double m30, double m21, double m12, double m03 );
+ ////! the conversion from CvMoments
+ //Moments( const CvMoments& moments );
+ ////! the conversion to CvMoments
+ //operator CvMoments() const;
+
+ //! spatial moments
+ CV_PROP_RW double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03;
+ //! central moments
+ CV_PROP_RW double mu20, mu11, mu02, mu30, mu21, mu12, mu03;
+ //! central normalized moments
+ CV_PROP_RW double nu20, nu11, nu02, nu30, nu21, nu12, nu03;
+};
+
+
+class CV_EXPORTS_W Subdiv2D
+{
+public:
+ enum { PTLOC_ERROR = -2,
+ PTLOC_OUTSIDE_RECT = -1,
+ PTLOC_INSIDE = 0,
+ PTLOC_VERTEX = 1,
+ PTLOC_ON_EDGE = 2
+ };
+
+ enum { NEXT_AROUND_ORG = 0x00,
+ NEXT_AROUND_DST = 0x22,
+ PREV_AROUND_ORG = 0x11,
+ PREV_AROUND_DST = 0x33,
+ NEXT_AROUND_LEFT = 0x13,
+ NEXT_AROUND_RIGHT = 0x31,
+ PREV_AROUND_LEFT = 0x20,
+ PREV_AROUND_RIGHT = 0x02
+ };
+
+ CV_WRAP Subdiv2D();
+ CV_WRAP Subdiv2D(Rect rect);
+ CV_WRAP void initDelaunay(Rect rect);
+
+ CV_WRAP int insert(Point2f pt);
+ CV_WRAP void insert(const std::vector<Point2f>& ptvec);
+ CV_WRAP int locate(Point2f pt, CV_OUT int& edge, CV_OUT int& vertex);
+
+ CV_WRAP int findNearest(Point2f pt, CV_OUT Point2f* nearestPt = 0);
+ CV_WRAP void getEdgeList(CV_OUT std::vector<Vec4f>& edgeList) const;
+ CV_WRAP void getTriangleList(CV_OUT std::vector<Vec6f>& triangleList) const;
+ CV_WRAP void getVoronoiFacetList(const std::vector<int>& idx, CV_OUT std::vector<std::vector<Point2f> >& facetList,
+ CV_OUT std::vector<Point2f>& facetCenters);
+
+ CV_WRAP Point2f getVertex(int vertex, CV_OUT int* firstEdge = 0) const;
+
+ CV_WRAP int getEdge( int edge, int nextEdgeType ) const;
+ CV_WRAP int nextEdge(int edge) const;
+ CV_WRAP int rotateEdge(int edge, int rotate) const;
+ CV_WRAP int symEdge(int edge) const;
+ CV_WRAP int edgeOrg(int edge, CV_OUT Point2f* orgpt = 0) const;
+ CV_WRAP int edgeDst(int edge, CV_OUT Point2f* dstpt = 0) const;
+
+protected:
+ int newEdge();
+ void deleteEdge(int edge);
+ int newPoint(Point2f pt, bool isvirtual, int firstEdge = 0);
+ void deletePoint(int vtx);
+ void setEdgePoints( int edge, int orgPt, int dstPt );
+ void splice( int edgeA, int edgeB );
+ int connectEdges( int edgeA, int edgeB );
+ void swapEdges( int edge );
+ int isRightOf(Point2f pt, int edge) const;
+ void calcVoronoi();
+ void clearVoronoi();
+ void checkSubdiv() const;
+
+ struct CV_EXPORTS Vertex
+ {
+ Vertex();
+ Vertex(Point2f pt, bool _isvirtual, int _firstEdge=0);
+ bool isvirtual() const;
+ bool isfree() const;
+
+ int firstEdge;
+ int type;
+ Point2f pt;
+ };
+
+ struct CV_EXPORTS QuadEdge
+ {
+ QuadEdge();
+ QuadEdge(int edgeidx);
+ bool isfree() const;
+
+ int next[4];
+ int pt[4];
+ };
+
+ std::vector<Vertex> vtx;
+ std::vector<QuadEdge> qedges;
+ int freeQEdge;
+ int freePoint;
+ bool validGeometry;
+
+ int recentEdge;
+ Point2f topLeft;
+ Point2f bottomRight;
+};
+
+
//! returns type (one of KERNEL_*) of 1D or 2D kernel specified by its coefficients.
CV_EXPORTS int getKernelType(InputArray kernel, Point anchor);
//! returns the primitive column filter with the specified kernel
CV_EXPORTS Ptr<BaseColumnFilter> getLinearColumnFilter(int bufType, int dstType,
InputArray kernel, int anchor,
- int symmetryType, double delta=0,
- int bits=0);
+ int symmetryType, double delta = 0,
+ int bits = 0);
//! returns 2D filter with the specified kernel
CV_EXPORTS Ptr<BaseFilter> getLinearFilter(int srcType, int dstType,
InputArray kernel,
- Point anchor=Point(-1,-1),
- double delta=0, int bits=0);
+ Point anchor = Point(-1,-1),
+ double delta = 0, int bits = 0);
//! returns the separable linear filter engine
CV_EXPORTS Ptr<FilterEngine> createSeparableLinearFilter(int srcType, int dstType,
InputArray rowKernel, InputArray columnKernel,
- Point anchor=Point(-1,-1), double delta=0,
- int rowBorderType=BORDER_DEFAULT,
- int columnBorderType=-1,
- const Scalar& borderValue=Scalar());
+ Point anchor = Point(-1,-1), double delta = 0,
+ int rowBorderType = BORDER_DEFAULT,
+ int columnBorderType = -1,
+ const Scalar& borderValue = Scalar());
//! returns the non-separable linear filter engine
CV_EXPORTS Ptr<FilterEngine> createLinearFilter(int srcType, int dstType,
- InputArray kernel, Point _anchor=Point(-1,-1),
- double delta=0, int rowBorderType=BORDER_DEFAULT,
- int columnBorderType=-1, const Scalar& borderValue=Scalar());
+ InputArray kernel, Point _anchor = Point(-1,-1),
+ double delta = 0, int rowBorderType = BORDER_DEFAULT,
+ int columnBorderType = -1, const Scalar& borderValue = Scalar());
//! returns the Gaussian kernel with the specified parameters
-CV_EXPORTS_W Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F );
+CV_EXPORTS_W Mat getGaussianKernel( int ksize, double sigma, int ktype = CV_64F );
//! returns the Gaussian filter engine
CV_EXPORTS Ptr<FilterEngine> createGaussianFilter( int type, Size ksize,
- double sigma1, double sigma2=0,
- int borderType=BORDER_DEFAULT);
+ double sigma1, double sigma2 = 0,
+ int borderType = BORDER_DEFAULT);
+
//! initializes kernels of the generalized Sobel operator
CV_EXPORTS_W void getDerivKernels( OutputArray kx, OutputArray ky,
int dx, int dy, int ksize,
- bool normalize=false, int ktype=CV_32F );
+ bool normalize = false, int ktype = CV_32F );
+
//! returns filter engine for the generalized Sobel operator
CV_EXPORTS Ptr<FilterEngine> createDerivFilter( int srcType, int dstType,
int dx, int dy, int ksize,
- int borderType=BORDER_DEFAULT );
+ int borderType = BORDER_DEFAULT );
+
//! returns horizontal 1D box filter
CV_EXPORTS Ptr<BaseRowFilter> getRowSumFilter(int srcType, int sumType,
- int ksize, int anchor=-1);
+ int ksize, int anchor = -1);
+
//! returns vertical 1D box filter
CV_EXPORTS Ptr<BaseColumnFilter> getColumnSumFilter( int sumType, int dstType,
- int ksize, int anchor=-1,
- double scale=1);
+ int ksize, int anchor = -1,
+ double scale = 1);
//! returns box filter engine
CV_EXPORTS Ptr<FilterEngine> createBoxFilter( int srcType, int dstType, Size ksize,
- Point anchor=Point(-1,-1),
- bool normalize=true,
- int borderType=BORDER_DEFAULT);
+ Point anchor = Point(-1,-1),
+ bool normalize = true,
+ int borderType = BORDER_DEFAULT);
//! returns the Gabor kernel with the specified parameters
CV_EXPORTS_W Mat getGaborKernel( Size ksize, double sigma, double theta, double lambd,
- double gamma, double psi=CV_PI*0.5, int ktype=CV_64F );
-
-//! type of morphological operation
-enum { MORPH_ERODE=CV_MOP_ERODE, MORPH_DILATE=CV_MOP_DILATE,
- MORPH_OPEN=CV_MOP_OPEN, MORPH_CLOSE=CV_MOP_CLOSE,
- MORPH_GRADIENT=CV_MOP_GRADIENT, MORPH_TOPHAT=CV_MOP_TOPHAT,
- MORPH_BLACKHAT=CV_MOP_BLACKHAT };
+ double gamma, double psi = CV_PI*0.5, int ktype = CV_64F );
//! returns horizontal 1D morphological filter
-CV_EXPORTS Ptr<BaseRowFilter> getMorphologyRowFilter(int op, int type, int ksize, int anchor=-1);
+CV_EXPORTS Ptr<BaseRowFilter> getMorphologyRowFilter(int op, int type, int ksize, int anchor = -1);
+
//! returns vertical 1D morphological filter
-CV_EXPORTS Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int ksize, int anchor=-1);
+CV_EXPORTS Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int ksize, int anchor = -1);
+
//! returns 2D morphological filter
CV_EXPORTS Ptr<BaseFilter> getMorphologyFilter(int op, int type, InputArray kernel,
- Point anchor=Point(-1,-1));
+ Point anchor = Point(-1,-1));
//! returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.
static inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); }
//! returns morphological filter engine. Only MORPH_ERODE and MORPH_DILATE are supported.
CV_EXPORTS Ptr<FilterEngine> createMorphologyFilter(int op, int type, InputArray kernel,
- Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT,
- int columnBorderType=-1,
- const Scalar& borderValue=morphologyDefaultBorderValue());
+ Point anchor = Point(-1,-1), int rowBorderType = BORDER_CONSTANT,
+ int columnBorderType = -1, const Scalar& borderValue = morphologyDefaultBorderValue());
-//! shape of the structuring element
-enum { MORPH_RECT=0, MORPH_CROSS=1, MORPH_ELLIPSE=2 };
//! returns structuring element of the specified shape and size
-CV_EXPORTS_W Mat getStructuringElement(int shape, Size ksize, Point anchor=Point(-1,-1));
+CV_EXPORTS_W Mat getStructuringElement(int shape, Size ksize, Point anchor = Point(-1,-1));
-template<> CV_EXPORTS void Ptr<IplConvKernel>::delete_obj();
+//! 1D interpolation function: returns coordinate of the "donor" pixel for the specified location p.
+CV_EXPORTS_W int borderInterpolate( int p, int len, int borderType );
//! copies 2D array to a larger destination array with extrapolation of the outer part of src using the specified border mode
CV_EXPORTS_W void copyMakeBorder( InputArray src, OutputArray dst,
int top, int bottom, int left, int right,
- int borderType, const Scalar& value=Scalar() );
+ int borderType, const Scalar& value = Scalar() );
//! smooths the image using median filter.
CV_EXPORTS_W void medianBlur( InputArray src, OutputArray dst, int ksize );
+
//! smooths the image using Gaussian filter.
-CV_EXPORTS_W void GaussianBlur( InputArray src,
- OutputArray dst, Size ksize,
- double sigmaX, double sigmaY=0,
- int borderType=BORDER_DEFAULT );
+CV_EXPORTS_W void GaussianBlur( InputArray src, OutputArray dst, Size ksize,
+ double sigmaX, double sigmaY = 0,
+ int borderType = BORDER_DEFAULT );
+
//! smooths the image using bilateral filter
CV_EXPORTS_W void bilateralFilter( InputArray src, OutputArray dst, int d,
double sigmaColor, double sigmaSpace,
- int borderType=BORDER_DEFAULT );
+ int borderType = BORDER_DEFAULT );
+
//! smooths the image using the box filter. Each pixel is processed in O(1) time
CV_EXPORTS_W void boxFilter( InputArray src, OutputArray dst, int ddepth,
- Size ksize, Point anchor=Point(-1,-1),
- bool normalize=true,
- int borderType=BORDER_DEFAULT );
+ Size ksize, Point anchor = Point(-1,-1),
+ bool normalize = true,
+ int borderType = BORDER_DEFAULT );
+
//! a synonym for normalized box filter
CV_EXPORTS_W void blur( InputArray src, OutputArray dst,
- Size ksize, Point anchor=Point(-1,-1),
- int borderType=BORDER_DEFAULT );
+ Size ksize, Point anchor = Point(-1,-1),
+ int borderType = BORDER_DEFAULT );
//! applies non-separable 2D linear filter to the image
CV_EXPORTS_W void filter2D( InputArray src, OutputArray dst, int ddepth,
- InputArray kernel, Point anchor=Point(-1,-1),
- double delta=0, int borderType=BORDER_DEFAULT );
+ InputArray kernel, Point anchor = Point(-1,-1),
+ double delta = 0, int borderType = BORDER_DEFAULT );
//! applies separable 2D linear filter to the image
CV_EXPORTS_W void sepFilter2D( InputArray src, OutputArray dst, int ddepth,
InputArray kernelX, InputArray kernelY,
- Point anchor=Point(-1,-1),
- double delta=0, int borderType=BORDER_DEFAULT );
+ Point anchor = Point(-1,-1),
+ double delta = 0, int borderType = BORDER_DEFAULT );
//! applies generalized Sobel operator to the image
CV_EXPORTS_W void Sobel( InputArray src, OutputArray dst, int ddepth,
- int dx, int dy, int ksize=3,
- double scale=1, double delta=0,
- int borderType=BORDER_DEFAULT );
+ int dx, int dy, int ksize = 3,
+ double scale = 1, double delta = 0,
+ int borderType = BORDER_DEFAULT );
//! applies the vertical or horizontal Scharr operator to the image
CV_EXPORTS_W void Scharr( InputArray src, OutputArray dst, int ddepth,
- int dx, int dy, double scale=1, double delta=0,
- int borderType=BORDER_DEFAULT );
+ int dx, int dy, double scale = 1, double delta = 0,
+ int borderType = BORDER_DEFAULT );
//! applies Laplacian operator to the image
CV_EXPORTS_W void Laplacian( InputArray src, OutputArray dst, int ddepth,
- int ksize=1, double scale=1, double delta=0,
- int borderType=BORDER_DEFAULT );
+ int ksize = 1, double scale = 1, double delta = 0,
+ int borderType = BORDER_DEFAULT );
//! applies Canny edge detector and produces the edge map.
CV_EXPORTS_W void Canny( InputArray image, OutputArray edges,
double threshold1, double threshold2,
- int apertureSize=3, bool L2gradient=false );
+ int apertureSize = 3, bool L2gradient = false );
//! computes minimum eigen value of 2x2 derivative covariation matrix at each pixel - the cornerness criteria
CV_EXPORTS_W void cornerMinEigenVal( InputArray src, OutputArray dst,
- int blockSize, int ksize=3,
- int borderType=BORDER_DEFAULT );
+ int blockSize, int ksize = 3,
+ int borderType = BORDER_DEFAULT );
//! computes Harris cornerness criteria at each image pixel
CV_EXPORTS_W void cornerHarris( InputArray src, OutputArray dst, int blockSize,
int ksize, double k,
- int borderType=BORDER_DEFAULT );
-
-// low-level function for computing eigenvalues and eigenvectors of 2x2 matrices
-CV_EXPORTS void eigen2x2( const float* a, float* e, int n );
+ int borderType = BORDER_DEFAULT );
//! computes both eigenvalues and the eigenvectors of 2x2 derivative covariation matrix at each pixel. The output is stored as 6-channel matrix.
CV_EXPORTS_W void cornerEigenValsAndVecs( InputArray src, OutputArray dst,
int blockSize, int ksize,
- int borderType=BORDER_DEFAULT );
+ int borderType = BORDER_DEFAULT );
//! computes another complex cornerness criteria at each pixel
CV_EXPORTS_W void preCornerDetect( InputArray src, OutputArray dst, int ksize,
- int borderType=BORDER_DEFAULT );
+ int borderType = BORDER_DEFAULT );
//! adjusts the corner locations with sub-pixel accuracy to maximize the certain cornerness criteria
CV_EXPORTS_W void cornerSubPix( InputArray image, InputOutputArray corners,
//! finds the strong enough corners where the cornerMinEigenVal() or cornerHarris() report the local maxima
CV_EXPORTS_W void goodFeaturesToTrack( InputArray image, OutputArray corners,
int maxCorners, double qualityLevel, double minDistance,
- InputArray mask=noArray(), int blockSize=3,
- bool useHarrisDetector=false, double k=0.04 );
+ InputArray mask = noArray(), int blockSize = 3,
+ bool useHarrisDetector = false, double k = 0.04 );
//! finds lines in the black-n-white image using the standard or pyramid Hough transform
CV_EXPORTS_W void HoughLines( InputArray image, OutputArray lines,
double rho, double theta, int threshold,
- double srn=0, double stn=0 );
+ double srn = 0, double stn = 0 );
//! finds line segments in the black-n-white image using probabalistic Hough transform
CV_EXPORTS_W void HoughLinesP( InputArray image, OutputArray lines,
double rho, double theta, int threshold,
- double minLineLength=0, double maxLineGap=0 );
+ double minLineLength = 0, double maxLineGap = 0 );
//! finds circles in the grayscale image using 2+1 gradient Hough transform
CV_EXPORTS_W void HoughCircles( InputArray image, OutputArray circles,
int method, double dp, double minDist,
- double param1=100, double param2=100,
- int minRadius=0, int maxRadius=0 );
-
-enum
-{
- GHT_POSITION = 0,
- GHT_SCALE = 1,
- GHT_ROTATION = 2
-};
-
-//! finds arbitrary template in the grayscale image using Generalized Hough Transform
-//! Ballard, D.H. (1981). Generalizing the Hough transform to detect arbitrary shapes. Pattern Recognition 13 (2): 111-122.
-//! Guil, N., González-Linares, J.M. and Zapata, E.L. (1999). Bidimensional shape detection using an invariant approach. Pattern Recognition 32 (6): 1025-1038.
-class CV_EXPORTS GeneralizedHough : public Algorithm
-{
-public:
- static Ptr<GeneralizedHough> create(int method);
-
- virtual ~GeneralizedHough();
-
- //! set template to search
- void setTemplate(InputArray templ, int cannyThreshold = 100, Point templCenter = Point(-1, -1));
- void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter = Point(-1, -1));
-
- //! find template on image
- void detect(InputArray image, OutputArray positions, OutputArray votes = cv::noArray(), int cannyThreshold = 100);
- void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes = cv::noArray());
-
- void release();
-
-protected:
- virtual void setTemplateImpl(const Mat& edges, const Mat& dx, const Mat& dy, Point templCenter) = 0;
- virtual void detectImpl(const Mat& edges, const Mat& dx, const Mat& dy, OutputArray positions, OutputArray votes) = 0;
- virtual void releaseImpl() = 0;
-
-private:
- Mat edges_, dx_, dy_;
-};
+ double param1 = 100, double param2 = 100,
+ int minRadius = 0, int maxRadius = 0 );
//! erodes the image (applies the local minimum operator)
CV_EXPORTS_W void erode( InputArray src, OutputArray dst, InputArray kernel,
- Point anchor=Point(-1,-1), int iterations=1,
- int borderType=BORDER_CONSTANT,
- const Scalar& borderValue=morphologyDefaultBorderValue() );
+ Point anchor = Point(-1,-1), int iterations = 1,
+ int borderType = BORDER_CONSTANT,
+ const Scalar& borderValue = morphologyDefaultBorderValue() );
//! dilates the image (applies the local maximum operator)
CV_EXPORTS_W void dilate( InputArray src, OutputArray dst, InputArray kernel,
- Point anchor=Point(-1,-1), int iterations=1,
- int borderType=BORDER_CONSTANT,
- const Scalar& borderValue=morphologyDefaultBorderValue() );
+ Point anchor = Point(-1,-1), int iterations = 1,
+ int borderType = BORDER_CONSTANT,
+ const Scalar& borderValue = morphologyDefaultBorderValue() );
//! applies an advanced morphological operation to the image
CV_EXPORTS_W void morphologyEx( InputArray src, OutputArray dst,
int op, InputArray kernel,
- Point anchor=Point(-1,-1), int iterations=1,
- int borderType=BORDER_CONSTANT,
- const Scalar& borderValue=morphologyDefaultBorderValue() );
-
-//! interpolation algorithm
-enum
-{
- INTER_NEAREST=CV_INTER_NN, //!< nearest neighbor interpolation
- INTER_LINEAR=CV_INTER_LINEAR, //!< bilinear interpolation
- INTER_CUBIC=CV_INTER_CUBIC, //!< bicubic interpolation
- INTER_AREA=CV_INTER_AREA, //!< area-based (or super) interpolation
- INTER_LANCZOS4=CV_INTER_LANCZOS4, //!< Lanczos interpolation over 8x8 neighborhood
- INTER_MAX=7,
- WARP_INVERSE_MAP=CV_WARP_INVERSE_MAP
-};
+ Point anchor = Point(-1,-1), int iterations = 1,
+ int borderType = BORDER_CONSTANT,
+ const Scalar& borderValue = morphologyDefaultBorderValue() );
//! resizes the image
CV_EXPORTS_W void resize( InputArray src, OutputArray dst,
- Size dsize, double fx=0, double fy=0,
- int interpolation=INTER_LINEAR );
+ Size dsize, double fx = 0, double fy = 0,
+ int interpolation = INTER_LINEAR );
//! warps the image using affine transformation
CV_EXPORTS_W void warpAffine( InputArray src, OutputArray dst,
InputArray M, Size dsize,
- int flags=INTER_LINEAR,
- int borderMode=BORDER_CONSTANT,
- const Scalar& borderValue=Scalar());
+ int flags = INTER_LINEAR,
+ int borderMode = BORDER_CONSTANT,
+ const Scalar& borderValue = Scalar());
//! warps the image using perspective transformation
CV_EXPORTS_W void warpPerspective( InputArray src, OutputArray dst,
InputArray M, Size dsize,
- int flags=INTER_LINEAR,
- int borderMode=BORDER_CONSTANT,
- const Scalar& borderValue=Scalar());
-
-enum
-{
- INTER_BITS=5, INTER_BITS2=INTER_BITS*2,
- INTER_TAB_SIZE=(1<<INTER_BITS),
- INTER_TAB_SIZE2=INTER_TAB_SIZE*INTER_TAB_SIZE
-};
+ int flags = INTER_LINEAR,
+ int borderMode = BORDER_CONSTANT,
+ const Scalar& borderValue = Scalar());
//! warps the image using the precomputed maps. The maps are stored in either floating-point or integer fixed-point format
CV_EXPORTS_W void remap( InputArray src, OutputArray dst,
InputArray map1, InputArray map2,
- int interpolation, int borderMode=BORDER_CONSTANT,
- const Scalar& borderValue=Scalar());
+ int interpolation, int borderMode = BORDER_CONSTANT,
+ const Scalar& borderValue = Scalar());
//! converts maps for remap from floating-point to fixed-point format or backwards
CV_EXPORTS_W void convertMaps( InputArray map1, InputArray map2,
OutputArray dstmap1, OutputArray dstmap2,
- int dstmap1type, bool nninterpolation=false );
+ int dstmap1type, bool nninterpolation = false );
//! returns 2x3 affine transformation matrix for the planar rotation.
CV_EXPORTS_W Mat getRotationMatrix2D( Point2f center, double angle, double scale );
+
//! returns 3x3 perspective transformation for the corresponding 4 point pairs.
CV_EXPORTS Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] );
+
//! returns 2x3 affine transformation for the corresponding 3 point pairs.
CV_EXPORTS Mat getAffineTransform( const Point2f src[], const Point2f dst[] );
+
//! computes 2x3 affine transformation matrix that is inverse to the specified 2x3 affine transformation.
CV_EXPORTS_W void invertAffineTransform( InputArray M, OutputArray iM );
CV_EXPORTS_W Mat getPerspectiveTransform( InputArray src, InputArray dst );
+
CV_EXPORTS_W Mat getAffineTransform( InputArray src, InputArray dst );
//! extracts rectangle from the image at sub-pixel location
CV_EXPORTS_W void getRectSubPix( InputArray image, Size patchSize,
- Point2f center, OutputArray patch, int patchType=-1 );
+ Point2f center, OutputArray patch, int patchType = -1 );
//! computes the integral image
-CV_EXPORTS_W void integral( InputArray src, OutputArray sum, int sdepth=-1 );
+CV_EXPORTS_W void integral( InputArray src, OutputArray sum, int sdepth = -1 );
//! computes the integral image and integral for the squared image
CV_EXPORTS_AS(integral2) void integral( InputArray src, OutputArray sum,
- OutputArray sqsum, int sdepth=-1 );
+ OutputArray sqsum, int sdepth = -1 );
+
//! computes the integral image, integral for the squared image and the tilted integral image
CV_EXPORTS_AS(integral3) void integral( InputArray src, OutputArray sum,
OutputArray sqsum, OutputArray tilted,
- int sdepth=-1 );
+ int sdepth = -1 );
//! adds image to the accumulator (dst += src). Unlike cv::add, dst and src can have different types.
CV_EXPORTS_W void accumulate( InputArray src, InputOutputArray dst,
- InputArray mask=noArray() );
+ InputArray mask = noArray() );
+
//! adds squared src image to the accumulator (dst += src*src).
CV_EXPORTS_W void accumulateSquare( InputArray src, InputOutputArray dst,
- InputArray mask=noArray() );
+ InputArray mask = noArray() );
//! adds product of the 2 images to the accumulator (dst += src1*src2).
CV_EXPORTS_W void accumulateProduct( InputArray src1, InputArray src2,
InputOutputArray dst, InputArray mask=noArray() );
+
//! updates the running average (dst = dst*(1-alpha) + src*alpha)
CV_EXPORTS_W void accumulateWeighted( InputArray src, InputOutputArray dst,
- double alpha, InputArray mask=noArray() );
+ double alpha, InputArray mask = noArray() );
//! computes PSNR image/video quality metric
CV_EXPORTS_W double PSNR(InputArray src1, InputArray src2);
CV_EXPORTS_W Point2d phaseCorrelate(InputArray src1, InputArray src2,
- InputArray window = noArray(), CV_OUT double* response=0);
-CV_EXPORTS_W void createHanningWindow(OutputArray dst, Size winSize, int type);
+ InputArray window = noArray(), CV_OUT double* response = 0);
-//! type of the threshold operation
-enum { THRESH_BINARY=CV_THRESH_BINARY, THRESH_BINARY_INV=CV_THRESH_BINARY_INV,
- THRESH_TRUNC=CV_THRESH_TRUNC, THRESH_TOZERO=CV_THRESH_TOZERO,
- THRESH_TOZERO_INV=CV_THRESH_TOZERO_INV, THRESH_MASK=CV_THRESH_MASK,
- THRESH_OTSU=CV_THRESH_OTSU };
+CV_EXPORTS_W void createHanningWindow(OutputArray dst, Size winSize, int type);
//! applies fixed threshold to the image
CV_EXPORTS_W double threshold( InputArray src, OutputArray dst,
double thresh, double maxval, int type );
-//! adaptive threshold algorithm
-enum { ADAPTIVE_THRESH_MEAN_C=0, ADAPTIVE_THRESH_GAUSSIAN_C=1 };
//! applies variable (adaptive) threshold to the image
CV_EXPORTS_W void adaptiveThreshold( InputArray src, OutputArray dst,
//! smooths and downsamples the image
CV_EXPORTS_W void pyrDown( InputArray src, OutputArray dst,
- const Size& dstsize=Size(), int borderType=BORDER_DEFAULT );
+ const Size& dstsize = Size(), int borderType = BORDER_DEFAULT );
+
//! upsamples and smoothes the image
CV_EXPORTS_W void pyrUp( InputArray src, OutputArray dst,
- const Size& dstsize=Size(), int borderType=BORDER_DEFAULT );
+ const Size& dstsize = Size(), int borderType = BORDER_DEFAULT );
//! builds the gaussian pyramid using pyrDown() as a basic operation
CV_EXPORTS void buildPyramid( InputArray src, OutputArrayOfArrays dst,
- int maxlevel, int borderType=BORDER_DEFAULT );
+ int maxlevel, int borderType = BORDER_DEFAULT );
//! corrects lens distortion for the given camera matrix and distortion coefficients
CV_EXPORTS_W void undistort( InputArray src, OutputArray dst,
InputArray cameraMatrix,
InputArray distCoeffs,
- InputArray newCameraMatrix=noArray() );
+ InputArray newCameraMatrix = noArray() );
//! initializes maps for cv::remap() to correct lens distortion and optionally rectify the image
CV_EXPORTS_W void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs,
InputArray R, InputArray newCameraMatrix,
Size size, int m1type, OutputArray map1, OutputArray map2 );
-enum
-{
- PROJ_SPHERICAL_ORTHO = 0,
- PROJ_SPHERICAL_EQRECT = 1
-};
-
//! initializes maps for cv::remap() for wide-angle
CV_EXPORTS_W float initWideAngleProjMap( InputArray cameraMatrix, InputArray distCoeffs,
Size imageSize, int destImageWidth,
int m1type, OutputArray map1, OutputArray map2,
- int projType=PROJ_SPHERICAL_EQRECT, double alpha=0);
+ int projType = PROJ_SPHERICAL_EQRECT, double alpha = 0);
//! returns the default new camera matrix (by default it is the same as cameraMatrix unless centerPricipalPoint=true)
-CV_EXPORTS_W Mat getDefaultNewCameraMatrix( InputArray cameraMatrix, Size imgsize=Size(),
- bool centerPrincipalPoint=false );
+CV_EXPORTS_W Mat getDefaultNewCameraMatrix( InputArray cameraMatrix, Size imgsize = Size(),
+ bool centerPrincipalPoint = false );
//! returns points' coordinates after lens distortion correction
CV_EXPORTS_W void undistortPoints( InputArray src, OutputArray dst,
InputArray cameraMatrix, InputArray distCoeffs,
- InputArray R=noArray(), InputArray P=noArray());
-
-template<> CV_EXPORTS void Ptr<CvHistogram>::delete_obj();
+ InputArray R = noArray(), InputArray P = noArray());
//! computes the joint dense histogram for a set of images.
CV_EXPORTS void calcHist( const Mat* images, int nimages,
const int* channels, InputArray mask,
OutputArray hist, int dims, const int* histSize,
- const float** ranges, bool uniform=true, bool accumulate=false );
+ const float** ranges, bool uniform = true, bool accumulate = false );
//! computes the joint sparse histogram for a set of images.
CV_EXPORTS void calcHist( const Mat* images, int nimages,
const int* channels, InputArray mask,
SparseMat& hist, int dims,
const int* histSize, const float** ranges,
- bool uniform=true, bool accumulate=false );
+ bool uniform = true, bool accumulate = false );
CV_EXPORTS_W void calcHist( InputArrayOfArrays images,
const std::vector<int>& channels,
InputArray mask, OutputArray hist,
const std::vector<int>& histSize,
const std::vector<float>& ranges,
- bool accumulate=false );
+ bool accumulate = false );
//! computes back projection for the set of images
CV_EXPORTS void calcBackProject( const Mat* images, int nimages,
const int* channels, InputArray hist,
OutputArray backProject, const float** ranges,
- double scale=1, bool uniform=true );
+ double scale = 1, bool uniform = true );
//! computes back projection for the set of images
CV_EXPORTS void calcBackProject( const Mat* images, int nimages,
const int* channels, const SparseMat& hist,
OutputArray backProject, const float** ranges,
- double scale=1, bool uniform=true );
+ double scale = 1, bool uniform = true );
CV_EXPORTS_W void calcBackProject( InputArrayOfArrays images, const std::vector<int>& channels,
InputArray hist, OutputArray dst,
const std::vector<float>& ranges,
double scale );
-/*CV_EXPORTS void calcBackProjectPatch( const Mat* images, int nimages, const int* channels,
- InputArray hist, OutputArray dst, Size patchSize,
- int method, double factor=1 );
-
-CV_EXPORTS_W void calcBackProjectPatch( InputArrayOfArrays images, const std::vector<int>& channels,
- InputArray hist, OutputArray dst, Size patchSize,
- int method, double factor=1 );*/
-
//! compares two histograms stored in dense arrays
CV_EXPORTS_W double compareHist( InputArray H1, InputArray H2, int method );
//! normalizes the grayscale image brightness and contrast by normalizing its histogram
CV_EXPORTS_W void equalizeHist( InputArray src, OutputArray dst );
-class CV_EXPORTS CLAHE : public Algorithm
-{
-public:
- virtual void apply(InputArray src, OutputArray dst) = 0;
-
- virtual void setClipLimit(double clipLimit) = 0;
- virtual double getClipLimit() const = 0;
-
- virtual void setTilesGridSize(Size tileGridSize) = 0;
- virtual Size getTilesGridSize() const = 0;
-
- virtual void collectGarbage() = 0;
-};
-CV_EXPORTS Ptr<CLAHE> createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8));
-
CV_EXPORTS float EMD( InputArray signature1, InputArray signature2,
int distType, InputArray cost=noArray(),
- float* lowerBound=0, OutputArray flow=noArray() );
+ float* lowerBound = 0, OutputArray flow = noArray() );
//! segments the image using watershed algorithm
CV_EXPORTS_W void watershed( InputArray image, InputOutputArray markers );
//! filters image using meanshift algorithm
CV_EXPORTS_W void pyrMeanShiftFiltering( InputArray src, OutputArray dst,
- double sp, double sr, int maxLevel=1,
- TermCriteria termcrit=TermCriteria(
- TermCriteria::MAX_ITER+TermCriteria::EPS,5,1) );
-
-//! class of the pixel in GrabCut algorithm
-enum
-{
- GC_BGD = 0, //!< background
- GC_FGD = 1, //!< foreground
- GC_PR_BGD = 2, //!< most probably background
- GC_PR_FGD = 3 //!< most probably foreground
-};
-
-//! GrabCut algorithm flags
-enum
-{
- GC_INIT_WITH_RECT = 0,
- GC_INIT_WITH_MASK = 1,
- GC_EVAL = 2
-};
+ double sp, double sr, int maxLevel = 1,
+ TermCriteria termcrit=TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5,1) );
//! segments the image using GrabCut algorithm
CV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, Rect rect,
InputOutputArray bgdModel, InputOutputArray fgdModel,
int iterCount, int mode = GC_EVAL );
-enum
-{
- DIST_LABEL_CCOMP = 0,
- DIST_LABEL_PIXEL = 1
-};
//! builds the discrete Voronoi diagram
CV_EXPORTS_AS(distanceTransformWithLabels) void distanceTransform( InputArray src, OutputArray dst,
OutputArray labels, int distanceType, int maskSize,
- int labelType=DIST_LABEL_CCOMP );
+ int labelType = DIST_LABEL_CCOMP );
//! computes the distance transform map
CV_EXPORTS_W void distanceTransform( InputArray src, OutputArray dst,
int distanceType, int maskSize );
-enum { FLOODFILL_FIXED_RANGE = 1 << 16, FLOODFILL_MASK_ONLY = 1 << 17 };
//! fills the semi-uniform image region starting from the specified seed point
CV_EXPORTS int floodFill( InputOutputArray image,
- Point seedPoint, Scalar newVal, CV_OUT Rect* rect=0,
- Scalar loDiff=Scalar(), Scalar upDiff=Scalar(),
- int flags=4 );
+ Point seedPoint, Scalar newVal, CV_OUT Rect* rect = 0,
+ Scalar loDiff = Scalar(), Scalar upDiff = Scalar(),
+ int flags = 4 );
//! fills the semi-uniform image region and/or the mask starting from the specified seed point
CV_EXPORTS_W int floodFill( InputOutputArray image, InputOutputArray mask,
Point seedPoint, Scalar newVal, CV_OUT Rect* rect=0,
- Scalar loDiff=Scalar(), Scalar upDiff=Scalar(),
- int flags=4 );
-
-
-enum
-{
- COLOR_BGR2BGRA =0,
- COLOR_RGB2RGBA =COLOR_BGR2BGRA,
-
- COLOR_BGRA2BGR =1,
- COLOR_RGBA2RGB =COLOR_BGRA2BGR,
-
- COLOR_BGR2RGBA =2,
- COLOR_RGB2BGRA =COLOR_BGR2RGBA,
-
- COLOR_RGBA2BGR =3,
- COLOR_BGRA2RGB =COLOR_RGBA2BGR,
-
- COLOR_BGR2RGB =4,
- COLOR_RGB2BGR =COLOR_BGR2RGB,
-
- COLOR_BGRA2RGBA =5,
- COLOR_RGBA2BGRA =COLOR_BGRA2RGBA,
-
- COLOR_BGR2GRAY =6,
- COLOR_RGB2GRAY =7,
- COLOR_GRAY2BGR =8,
- COLOR_GRAY2RGB =COLOR_GRAY2BGR,
- COLOR_GRAY2BGRA =9,
- COLOR_GRAY2RGBA =COLOR_GRAY2BGRA,
- COLOR_BGRA2GRAY =10,
- COLOR_RGBA2GRAY =11,
-
- COLOR_BGR2BGR565 =12,
- COLOR_RGB2BGR565 =13,
- COLOR_BGR5652BGR =14,
- COLOR_BGR5652RGB =15,
- COLOR_BGRA2BGR565 =16,
- COLOR_RGBA2BGR565 =17,
- COLOR_BGR5652BGRA =18,
- COLOR_BGR5652RGBA =19,
-
- COLOR_GRAY2BGR565 =20,
- COLOR_BGR5652GRAY =21,
-
- COLOR_BGR2BGR555 =22,
- COLOR_RGB2BGR555 =23,
- COLOR_BGR5552BGR =24,
- COLOR_BGR5552RGB =25,
- COLOR_BGRA2BGR555 =26,
- COLOR_RGBA2BGR555 =27,
- COLOR_BGR5552BGRA =28,
- COLOR_BGR5552RGBA =29,
-
- COLOR_GRAY2BGR555 =30,
- COLOR_BGR5552GRAY =31,
-
- COLOR_BGR2XYZ =32,
- COLOR_RGB2XYZ =33,
- COLOR_XYZ2BGR =34,
- COLOR_XYZ2RGB =35,
-
- COLOR_BGR2YCrCb =36,
- COLOR_RGB2YCrCb =37,
- COLOR_YCrCb2BGR =38,
- COLOR_YCrCb2RGB =39,
-
- COLOR_BGR2HSV =40,
- COLOR_RGB2HSV =41,
-
- COLOR_BGR2Lab =44,
- COLOR_RGB2Lab =45,
-
- COLOR_BayerBG2BGR =46,
- COLOR_BayerGB2BGR =47,
- COLOR_BayerRG2BGR =48,
- COLOR_BayerGR2BGR =49,
-
- COLOR_BayerBG2RGB =COLOR_BayerRG2BGR,
- COLOR_BayerGB2RGB =COLOR_BayerGR2BGR,
- COLOR_BayerRG2RGB =COLOR_BayerBG2BGR,
- COLOR_BayerGR2RGB =COLOR_BayerGB2BGR,
-
- COLOR_BGR2Luv =50,
- COLOR_RGB2Luv =51,
- COLOR_BGR2HLS =52,
- COLOR_RGB2HLS =53,
-
- COLOR_HSV2BGR =54,
- COLOR_HSV2RGB =55,
-
- COLOR_Lab2BGR =56,
- COLOR_Lab2RGB =57,
- COLOR_Luv2BGR =58,
- COLOR_Luv2RGB =59,
- COLOR_HLS2BGR =60,
- COLOR_HLS2RGB =61,
-
- COLOR_BayerBG2BGR_VNG =62,
- COLOR_BayerGB2BGR_VNG =63,
- COLOR_BayerRG2BGR_VNG =64,
- COLOR_BayerGR2BGR_VNG =65,
-
- COLOR_BayerBG2RGB_VNG =COLOR_BayerRG2BGR_VNG,
- COLOR_BayerGB2RGB_VNG =COLOR_BayerGR2BGR_VNG,
- COLOR_BayerRG2RGB_VNG =COLOR_BayerBG2BGR_VNG,
- COLOR_BayerGR2RGB_VNG =COLOR_BayerGB2BGR_VNG,
-
- COLOR_BGR2HSV_FULL = 66,
- COLOR_RGB2HSV_FULL = 67,
- COLOR_BGR2HLS_FULL = 68,
- COLOR_RGB2HLS_FULL = 69,
-
- COLOR_HSV2BGR_FULL = 70,
- COLOR_HSV2RGB_FULL = 71,
- COLOR_HLS2BGR_FULL = 72,
- COLOR_HLS2RGB_FULL = 73,
-
- COLOR_LBGR2Lab = 74,
- COLOR_LRGB2Lab = 75,
- COLOR_LBGR2Luv = 76,
- COLOR_LRGB2Luv = 77,
-
- COLOR_Lab2LBGR = 78,
- COLOR_Lab2LRGB = 79,
- COLOR_Luv2LBGR = 80,
- COLOR_Luv2LRGB = 81,
-
- COLOR_BGR2YUV = 82,
- COLOR_RGB2YUV = 83,
- COLOR_YUV2BGR = 84,
- COLOR_YUV2RGB = 85,
-
- COLOR_BayerBG2GRAY = 86,
- COLOR_BayerGB2GRAY = 87,
- COLOR_BayerRG2GRAY = 88,
- COLOR_BayerGR2GRAY = 89,
-
- //YUV 4:2:0 formats family
- COLOR_YUV2RGB_NV12 = 90,
- COLOR_YUV2BGR_NV12 = 91,
- COLOR_YUV2RGB_NV21 = 92,
- COLOR_YUV2BGR_NV21 = 93,
- COLOR_YUV420sp2RGB = COLOR_YUV2RGB_NV21,
- COLOR_YUV420sp2BGR = COLOR_YUV2BGR_NV21,
-
- COLOR_YUV2RGBA_NV12 = 94,
- COLOR_YUV2BGRA_NV12 = 95,
- COLOR_YUV2RGBA_NV21 = 96,
- COLOR_YUV2BGRA_NV21 = 97,
- COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21,
- COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21,
-
- COLOR_YUV2RGB_YV12 = 98,
- COLOR_YUV2BGR_YV12 = 99,
- COLOR_YUV2RGB_IYUV = 100,
- COLOR_YUV2BGR_IYUV = 101,
- COLOR_YUV2RGB_I420 = COLOR_YUV2RGB_IYUV,
- COLOR_YUV2BGR_I420 = COLOR_YUV2BGR_IYUV,
- COLOR_YUV420p2RGB = COLOR_YUV2RGB_YV12,
- COLOR_YUV420p2BGR = COLOR_YUV2BGR_YV12,
-
- COLOR_YUV2RGBA_YV12 = 102,
- COLOR_YUV2BGRA_YV12 = 103,
- COLOR_YUV2RGBA_IYUV = 104,
- COLOR_YUV2BGRA_IYUV = 105,
- COLOR_YUV2RGBA_I420 = COLOR_YUV2RGBA_IYUV,
- COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV,
- COLOR_YUV420p2RGBA = COLOR_YUV2RGBA_YV12,
- COLOR_YUV420p2BGRA = COLOR_YUV2BGRA_YV12,
-
- COLOR_YUV2GRAY_420 = 106,
- COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420,
- COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420,
- COLOR_YUV2GRAY_YV12 = COLOR_YUV2GRAY_420,
- COLOR_YUV2GRAY_IYUV = COLOR_YUV2GRAY_420,
- COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420,
- COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420,
- COLOR_YUV420p2GRAY = COLOR_YUV2GRAY_420,
-
- //YUV 4:2:2 formats family
- COLOR_YUV2RGB_UYVY = 107,
- COLOR_YUV2BGR_UYVY = 108,
- //COLOR_YUV2RGB_VYUY = 109,
- //COLOR_YUV2BGR_VYUY = 110,
- COLOR_YUV2RGB_Y422 = COLOR_YUV2RGB_UYVY,
- COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY,
- COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY,
- COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY,
-
- COLOR_YUV2RGBA_UYVY = 111,
- COLOR_YUV2BGRA_UYVY = 112,
- //COLOR_YUV2RGBA_VYUY = 113,
- //COLOR_YUV2BGRA_VYUY = 114,
- COLOR_YUV2RGBA_Y422 = COLOR_YUV2RGBA_UYVY,
- COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY,
- COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY,
- COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY,
-
- COLOR_YUV2RGB_YUY2 = 115,
- COLOR_YUV2BGR_YUY2 = 116,
- COLOR_YUV2RGB_YVYU = 117,
- COLOR_YUV2BGR_YVYU = 118,
- COLOR_YUV2RGB_YUYV = COLOR_YUV2RGB_YUY2,
- COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2,
- COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2,
- COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2,
-
- COLOR_YUV2RGBA_YUY2 = 119,
- COLOR_YUV2BGRA_YUY2 = 120,
- COLOR_YUV2RGBA_YVYU = 121,
- COLOR_YUV2BGRA_YVYU = 122,
- COLOR_YUV2RGBA_YUYV = COLOR_YUV2RGBA_YUY2,
- COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2,
- COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2,
- COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2,
-
- COLOR_YUV2GRAY_UYVY = 123,
- COLOR_YUV2GRAY_YUY2 = 124,
- //COLOR_YUV2GRAY_VYUY = COLOR_YUV2GRAY_UYVY,
- COLOR_YUV2GRAY_Y422 = COLOR_YUV2GRAY_UYVY,
- COLOR_YUV2GRAY_UYNV = COLOR_YUV2GRAY_UYVY,
- COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2,
- COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2,
- COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2,
-
- // alpha premultiplication
- COLOR_RGBA2mRGBA = 125,
- COLOR_mRGBA2RGBA = 126,
-
- COLOR_RGB2YUV_I420 = 127,
- COLOR_BGR2YUV_I420 = 128,
- COLOR_RGB2YUV_IYUV = COLOR_RGB2YUV_I420,
- COLOR_BGR2YUV_IYUV = COLOR_BGR2YUV_I420,
-
- COLOR_RGBA2YUV_I420 = 129,
- COLOR_BGRA2YUV_I420 = 130,
- COLOR_RGBA2YUV_IYUV = COLOR_RGBA2YUV_I420,
- COLOR_BGRA2YUV_IYUV = COLOR_BGRA2YUV_I420,
- COLOR_RGB2YUV_YV12 = 131,
- COLOR_BGR2YUV_YV12 = 132,
- COLOR_RGBA2YUV_YV12 = 133,
- COLOR_BGRA2YUV_YV12 = 134,
-
- // Edge-Aware Demosaicing
- COLOR_BayerBG2BGR_EA = 135,
- COLOR_BayerGB2BGR_EA = 136,
- COLOR_BayerRG2BGR_EA = 137,
- COLOR_BayerGR2BGR_EA = 138,
-
- COLOR_BayerBG2RGB_EA = COLOR_BayerRG2BGR_EA,
- COLOR_BayerGB2RGB_EA = COLOR_BayerGR2BGR_EA,
- COLOR_BayerRG2RGB_EA = COLOR_BayerBG2BGR_EA,
- COLOR_BayerGR2RGB_EA = COLOR_BayerGB2BGR_EA,
-
- COLOR_COLORCVT_MAX = 139
-};
-
+ Scalar loDiff = Scalar(), Scalar upDiff = Scalar(),
+ int flags = 4 );
//! converts image from one color space to another
-CV_EXPORTS_W void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 );
-
-//! raster image moments
-class CV_EXPORTS_W_MAP Moments
-{
-public:
- //! the default constructor
- Moments();
- //! the full constructor
- Moments(double m00, double m10, double m01, double m20, double m11,
- double m02, double m30, double m21, double m12, double m03 );
- //! the conversion from CvMoments
- Moments( const CvMoments& moments );
- //! the conversion to CvMoments
- operator CvMoments() const;
+CV_EXPORTS_W void cvtColor( InputArray src, OutputArray dst, int code, int dstCn = 0 );
- //! spatial moments
- CV_PROP_RW double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03;
- //! central moments
- CV_PROP_RW double mu20, mu11, mu02, mu30, mu21, mu12, mu03;
- //! central normalized moments
- CV_PROP_RW double nu20, nu11, nu02, nu30, nu21, nu12, nu03;
-};
+// main function for all demosaicing procceses
+CV_EXPORTS_W void demosaicing(InputArray _src, OutputArray _dst, int code, int dcn = 0);
//! computes moments of the rasterized shape or a vector of points
-CV_EXPORTS_W Moments moments( InputArray array, bool binaryImage=false );
+CV_EXPORTS_W Moments moments( InputArray array, bool binaryImage = false );
//! computes 7 Hu invariants from the moments
CV_EXPORTS void HuMoments( const Moments& moments, double hu[7] );
-CV_EXPORTS_W void HuMoments( const Moments& m, OutputArray hu );
-//! type of the template matching operation
-enum { TM_SQDIFF=0, TM_SQDIFF_NORMED=1, TM_CCORR=2, TM_CCORR_NORMED=3, TM_CCOEFF=4, TM_CCOEFF_NORMED=5 };
+CV_EXPORTS_W void HuMoments( const Moments& m, OutputArray hu );
//! computes the proximity map for the raster template and the image where the template is searched for
CV_EXPORTS_W void matchTemplate( InputArray image, InputArray templ,
OutputArray result, int method );
-enum { CC_STAT_LEFT=0, CC_STAT_TOP=1, CC_STAT_WIDTH=2, CC_STAT_HEIGHT=3, CC_STAT_AREA=4, CC_STAT_MAX = 5};
// computes the connected components labeled image of boolean image ``image``
// with 4 or 8 way connectivity - returns N, the total
// consideration based on the total number of labels or
// alternatively the total number of pixels in the source image.
CV_EXPORTS_W int connectedComponents(InputArray image, OutputArray labels,
- int connectivity = 8, int ltype=CV_32S);
+ int connectivity = 8, int ltype = CV_32S);
+
CV_EXPORTS_W int connectedComponentsWithStats(InputArray image, OutputArray labels,
OutputArray stats, OutputArray centroids,
- int connectivity = 8, int ltype=CV_32S);
+ int connectivity = 8, int ltype = CV_32S);
-//! mode of the contour retrieval algorithm
-enum
-{
- RETR_EXTERNAL=CV_RETR_EXTERNAL, //!< retrieve only the most external (top-level) contours
- RETR_LIST=CV_RETR_LIST, //!< retrieve all the contours without any hierarchical information
- RETR_CCOMP=CV_RETR_CCOMP, //!< retrieve the connected components (that can possibly be nested)
- RETR_TREE=CV_RETR_TREE, //!< retrieve all the contours and the whole hierarchy
- RETR_FLOODFILL=CV_RETR_FLOODFILL
-};
-
-//! the contour approximation algorithm
-enum
-{
- CHAIN_APPROX_NONE=CV_CHAIN_APPROX_NONE,
- CHAIN_APPROX_SIMPLE=CV_CHAIN_APPROX_SIMPLE,
- CHAIN_APPROX_TC89_L1=CV_CHAIN_APPROX_TC89_L1,
- CHAIN_APPROX_TC89_KCOS=CV_CHAIN_APPROX_TC89_KCOS
-};
//! retrieves contours and the hierarchical information from black-n-white image.
CV_EXPORTS_W void findContours( InputOutputArray image, OutputArrayOfArrays contours,
OutputArray hierarchy, int mode,
- int method, Point offset=Point());
+ int method, Point offset = Point());
//! retrieves contours from black-n-white image.
CV_EXPORTS void findContours( InputOutputArray image, OutputArrayOfArrays contours,
- int mode, int method, Point offset=Point());
+ int mode, int method, Point offset = Point());
//! approximates contour or a curve using Douglas-Peucker algorithm
CV_EXPORTS_W void approxPolyDP( InputArray curve,
//! computes the contour perimeter (closed=true) or a curve length
CV_EXPORTS_W double arcLength( InputArray curve, bool closed );
+
//! computes the bounding rectangle for a contour
CV_EXPORTS_W Rect boundingRect( InputArray points );
+
//! computes the contour area
-CV_EXPORTS_W double contourArea( InputArray contour, bool oriented=false );
+CV_EXPORTS_W double contourArea( InputArray contour, bool oriented = false );
+
//! computes the minimal rotated rectangle for a set of points
CV_EXPORTS_W RotatedRect minAreaRect( InputArray points );
+
//! computes the minimal enclosing circle for a set of points
CV_EXPORTS_W void minEnclosingCircle( InputArray points,
CV_OUT Point2f& center, CV_OUT float& radius );
+
//! matches two contours using one of the available algorithms
CV_EXPORTS_W double matchShapes( InputArray contour1, InputArray contour2,
int method, double parameter );
+
//! computes convex hull for a set of 2D points.
CV_EXPORTS_W void convexHull( InputArray points, OutputArray hull,
- bool clockwise=false, bool returnPoints=true );
+ bool clockwise = false, bool returnPoints = true );
+
//! computes the contour convexity defects
CV_EXPORTS_W void convexityDefects( InputArray contour, InputArray convexhull, OutputArray convexityDefects );
//! finds intersection of two convex polygons
CV_EXPORTS_W float intersectConvexConvex( InputArray _p1, InputArray _p2,
- OutputArray _p12, bool handleNested=true );
+ OutputArray _p12, bool handleNested = true );
//! fits ellipse to the set of 2D points
CV_EXPORTS_W RotatedRect fitEllipse( InputArray points );
//! fits line to the set of 2D points using M-estimator algorithm
CV_EXPORTS_W void fitLine( InputArray points, OutputArray line, int distType,
double param, double reps, double aeps );
+
//! checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary
CV_EXPORTS_W double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist );
+CV_EXPORTS Ptr<CLAHE> createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8));
-class CV_EXPORTS_W Subdiv2D
-{
-public:
- enum
- {
- PTLOC_ERROR = -2,
- PTLOC_OUTSIDE_RECT = -1,
- PTLOC_INSIDE = 0,
- PTLOC_VERTEX = 1,
- PTLOC_ON_EDGE = 2
- };
-
- enum
- {
- NEXT_AROUND_ORG = 0x00,
- NEXT_AROUND_DST = 0x22,
- PREV_AROUND_ORG = 0x11,
- PREV_AROUND_DST = 0x33,
- NEXT_AROUND_LEFT = 0x13,
- NEXT_AROUND_RIGHT = 0x31,
- PREV_AROUND_LEFT = 0x20,
- PREV_AROUND_RIGHT = 0x02
- };
-
- CV_WRAP Subdiv2D();
- CV_WRAP Subdiv2D(Rect rect);
- CV_WRAP void initDelaunay(Rect rect);
-
- CV_WRAP int insert(Point2f pt);
- CV_WRAP void insert(const std::vector<Point2f>& ptvec);
- CV_WRAP int locate(Point2f pt, CV_OUT int& edge, CV_OUT int& vertex);
-
- CV_WRAP int findNearest(Point2f pt, CV_OUT Point2f* nearestPt=0);
- CV_WRAP void getEdgeList(CV_OUT std::vector<Vec4f>& edgeList) const;
- CV_WRAP void getTriangleList(CV_OUT std::vector<Vec6f>& triangleList) const;
- CV_WRAP void getVoronoiFacetList(const std::vector<int>& idx, CV_OUT std::vector<std::vector<Point2f> >& facetList,
- CV_OUT std::vector<Point2f>& facetCenters);
-
- CV_WRAP Point2f getVertex(int vertex, CV_OUT int* firstEdge=0) const;
-
- CV_WRAP int getEdge( int edge, int nextEdgeType ) const;
- CV_WRAP int nextEdge(int edge) const;
- CV_WRAP int rotateEdge(int edge, int rotate) const;
- CV_WRAP int symEdge(int edge) const;
- CV_WRAP int edgeOrg(int edge, CV_OUT Point2f* orgpt=0) const;
- CV_WRAP int edgeDst(int edge, CV_OUT Point2f* dstpt=0) const;
-
-protected:
- int newEdge();
- void deleteEdge(int edge);
- int newPoint(Point2f pt, bool isvirtual, int firstEdge=0);
- void deletePoint(int vtx);
- void setEdgePoints( int edge, int orgPt, int dstPt );
- void splice( int edgeA, int edgeB );
- int connectEdges( int edgeA, int edgeB );
- void swapEdges( int edge );
- int isRightOf(Point2f pt, int edge) const;
- void calcVoronoi();
- void clearVoronoi();
- void checkSubdiv() const;
-
- struct CV_EXPORTS Vertex
- {
- Vertex();
- Vertex(Point2f pt, bool _isvirtual, int _firstEdge=0);
- bool isvirtual() const;
- bool isfree() const;
- int firstEdge;
- int type;
- Point2f pt;
- };
- struct CV_EXPORTS QuadEdge
- {
- QuadEdge();
- QuadEdge(int edgeidx);
- bool isfree() const;
- int next[4];
- int pt[4];
- };
-
- std::vector<Vertex> vtx;
- std::vector<QuadEdge> qedges;
- int freeQEdge;
- int freePoint;
- bool validGeometry;
-
- int recentEdge;
- Point2f topLeft;
- Point2f bottomRight;
-};
-
-// main function for all demosaicing procceses
-CV_EXPORTS_W void demosaicing(InputArray _src, OutputArray _dst, int code, int dcn = 0);
-
-}
-
-#endif /* __cplusplus */
+} // cv
#endif
-
-/* End of file. */
//extra color conversions supported implicitly
enum
{
- CX_BGRA2HLS = CV_COLORCVT_MAX + CV_BGR2HLS,
- CX_BGRA2HLS_FULL = CV_COLORCVT_MAX + CV_BGR2HLS_FULL,
- CX_BGRA2HSV = CV_COLORCVT_MAX + CV_BGR2HSV,
- CX_BGRA2HSV_FULL = CV_COLORCVT_MAX + CV_BGR2HSV_FULL,
- CX_BGRA2Lab = CV_COLORCVT_MAX + CV_BGR2Lab,
- CX_BGRA2Luv = CV_COLORCVT_MAX + CV_BGR2Luv,
- CX_BGRA2XYZ = CV_COLORCVT_MAX + CV_BGR2XYZ,
- CX_BGRA2YCrCb = CV_COLORCVT_MAX + CV_BGR2YCrCb,
- CX_BGRA2YUV = CV_COLORCVT_MAX + CV_BGR2YUV,
- CX_HLS2BGRA = CV_COLORCVT_MAX + CV_HLS2BGR,
- CX_HLS2BGRA_FULL = CV_COLORCVT_MAX + CV_HLS2BGR_FULL,
- CX_HLS2RGBA = CV_COLORCVT_MAX + CV_HLS2RGB,
- CX_HLS2RGBA_FULL = CV_COLORCVT_MAX + CV_HLS2RGB_FULL,
- CX_HSV2BGRA = CV_COLORCVT_MAX + CV_HSV2BGR,
- CX_HSV2BGRA_FULL = CV_COLORCVT_MAX + CV_HSV2BGR_FULL,
- CX_HSV2RGBA = CV_COLORCVT_MAX + CV_HSV2RGB,
- CX_HSV2RGBA_FULL = CV_COLORCVT_MAX + CV_HSV2RGB_FULL,
- CX_Lab2BGRA = CV_COLORCVT_MAX + CV_Lab2BGR,
- CX_Lab2LBGRA = CV_COLORCVT_MAX + CV_Lab2LBGR,
- CX_Lab2LRGBA = CV_COLORCVT_MAX + CV_Lab2LRGB,
- CX_Lab2RGBA = CV_COLORCVT_MAX + CV_Lab2RGB,
- CX_LBGRA2Lab = CV_COLORCVT_MAX + CV_LBGR2Lab,
- CX_LBGRA2Luv = CV_COLORCVT_MAX + CV_LBGR2Luv,
- CX_LRGBA2Lab = CV_COLORCVT_MAX + CV_LRGB2Lab,
- CX_LRGBA2Luv = CV_COLORCVT_MAX + CV_LRGB2Luv,
- CX_Luv2BGRA = CV_COLORCVT_MAX + CV_Luv2BGR,
- CX_Luv2LBGRA = CV_COLORCVT_MAX + CV_Luv2LBGR,
- CX_Luv2LRGBA = CV_COLORCVT_MAX + CV_Luv2LRGB,
- CX_Luv2RGBA = CV_COLORCVT_MAX + CV_Luv2RGB,
- CX_RGBA2HLS = CV_COLORCVT_MAX + CV_RGB2HLS,
- CX_RGBA2HLS_FULL = CV_COLORCVT_MAX + CV_RGB2HLS_FULL,
- CX_RGBA2HSV = CV_COLORCVT_MAX + CV_RGB2HSV,
- CX_RGBA2HSV_FULL = CV_COLORCVT_MAX + CV_RGB2HSV_FULL,
- CX_RGBA2Lab = CV_COLORCVT_MAX + CV_RGB2Lab,
- CX_RGBA2Luv = CV_COLORCVT_MAX + CV_RGB2Luv,
- CX_RGBA2XYZ = CV_COLORCVT_MAX + CV_RGB2XYZ,
- CX_RGBA2YCrCb = CV_COLORCVT_MAX + CV_RGB2YCrCb,
- CX_RGBA2YUV = CV_COLORCVT_MAX + CV_RGB2YUV,
- CX_XYZ2BGRA = CV_COLORCVT_MAX + CV_XYZ2BGR,
- CX_XYZ2RGBA = CV_COLORCVT_MAX + CV_XYZ2RGB,
- CX_YCrCb2BGRA = CV_COLORCVT_MAX + CV_YCrCb2BGR,
- CX_YCrCb2RGBA = CV_COLORCVT_MAX + CV_YCrCb2RGB,
- CX_YUV2BGRA = CV_COLORCVT_MAX + CV_YUV2BGR,
- CX_YUV2RGBA = CV_COLORCVT_MAX + CV_YUV2RGB
+ CX_BGRA2HLS = COLOR_COLORCVT_MAX + COLOR_BGR2HLS,
+ CX_BGRA2HLS_FULL = COLOR_COLORCVT_MAX + COLOR_BGR2HLS_FULL,
+ CX_BGRA2HSV = COLOR_COLORCVT_MAX + COLOR_BGR2HSV,
+ CX_BGRA2HSV_FULL = COLOR_COLORCVT_MAX + COLOR_BGR2HSV_FULL,
+ CX_BGRA2Lab = COLOR_COLORCVT_MAX + COLOR_BGR2Lab,
+ CX_BGRA2Luv = COLOR_COLORCVT_MAX + COLOR_BGR2Luv,
+ CX_BGRA2XYZ = COLOR_COLORCVT_MAX + COLOR_BGR2XYZ,
+ CX_BGRA2YCrCb = COLOR_COLORCVT_MAX + COLOR_BGR2YCrCb,
+ CX_BGRA2YUV = COLOR_COLORCVT_MAX + COLOR_BGR2YUV,
+ CX_HLS2BGRA = COLOR_COLORCVT_MAX + COLOR_HLS2BGR,
+ CX_HLS2BGRA_FULL = COLOR_COLORCVT_MAX + COLOR_HLS2BGR_FULL,
+ CX_HLS2RGBA = COLOR_COLORCVT_MAX + COLOR_HLS2RGB,
+ CX_HLS2RGBA_FULL = COLOR_COLORCVT_MAX + COLOR_HLS2RGB_FULL,
+ CX_HSV2BGRA = COLOR_COLORCVT_MAX + COLOR_HSV2BGR,
+ CX_HSV2BGRA_FULL = COLOR_COLORCVT_MAX + COLOR_HSV2BGR_FULL,
+ CX_HSV2RGBA = COLOR_COLORCVT_MAX + COLOR_HSV2RGB,
+ CX_HSV2RGBA_FULL = COLOR_COLORCVT_MAX + COLOR_HSV2RGB_FULL,
+ CX_Lab2BGRA = COLOR_COLORCVT_MAX + COLOR_Lab2BGR,
+ CX_Lab2LBGRA = COLOR_COLORCVT_MAX + COLOR_Lab2LBGR,
+ CX_Lab2LRGBA = COLOR_COLORCVT_MAX + COLOR_Lab2LRGB,
+ CX_Lab2RGBA = COLOR_COLORCVT_MAX + COLOR_Lab2RGB,
+ CX_LBGRA2Lab = COLOR_COLORCVT_MAX + COLOR_LBGR2Lab,
+ CX_LBGRA2Luv = COLOR_COLORCVT_MAX + COLOR_LBGR2Luv,
+ CX_LRGBA2Lab = COLOR_COLORCVT_MAX + COLOR_LRGB2Lab,
+ CX_LRGBA2Luv = COLOR_COLORCVT_MAX + COLOR_LRGB2Luv,
+ CX_Luv2BGRA = COLOR_COLORCVT_MAX + COLOR_Luv2BGR,
+ CX_Luv2LBGRA = COLOR_COLORCVT_MAX + COLOR_Luv2LBGR,
+ CX_Luv2LRGBA = COLOR_COLORCVT_MAX + COLOR_Luv2LRGB,
+ CX_Luv2RGBA = COLOR_COLORCVT_MAX + COLOR_Luv2RGB,
+ CX_RGBA2HLS = COLOR_COLORCVT_MAX + COLOR_RGB2HLS,
+ CX_RGBA2HLS_FULL = COLOR_COLORCVT_MAX + COLOR_RGB2HLS_FULL,
+ CX_RGBA2HSV = COLOR_COLORCVT_MAX + COLOR_RGB2HSV,
+ CX_RGBA2HSV_FULL = COLOR_COLORCVT_MAX + COLOR_RGB2HSV_FULL,
+ CX_RGBA2Lab = COLOR_COLORCVT_MAX + COLOR_RGB2Lab,
+ CX_RGBA2Luv = COLOR_COLORCVT_MAX + COLOR_RGB2Luv,
+ CX_RGBA2XYZ = COLOR_COLORCVT_MAX + COLOR_RGB2XYZ,
+ CX_RGBA2YCrCb = COLOR_COLORCVT_MAX + COLOR_RGB2YCrCb,
+ CX_RGBA2YUV = COLOR_COLORCVT_MAX + COLOR_RGB2YUV,
+ CX_XYZ2BGRA = COLOR_COLORCVT_MAX + COLOR_XYZ2BGR,
+ CX_XYZ2RGBA = COLOR_COLORCVT_MAX + COLOR_XYZ2RGB,
+ CX_YCrCb2BGRA = COLOR_COLORCVT_MAX + COLOR_YCrCb2BGR,
+ CX_YCrCb2RGBA = COLOR_COLORCVT_MAX + COLOR_YCrCb2RGB,
+ CX_YUV2BGRA = COLOR_COLORCVT_MAX + COLOR_YUV2BGR,
+ CX_YUV2RGBA = COLOR_COLORCVT_MAX + COLOR_YUV2RGB
};
CV_ENUM(CvtMode,
- CV_BGR2BGR555, CV_BGR2BGR565, CV_BGR2BGRA, CV_BGR2GRAY,
- CV_BGR2HLS, CV_BGR2HLS_FULL, CV_BGR2HSV, CV_BGR2HSV_FULL,
- CV_BGR2Lab, CV_BGR2Luv, CV_BGR2RGB, CV_BGR2RGBA, CV_BGR2XYZ,
- CV_BGR2YCrCb, CV_BGR2YUV, CV_BGR5552BGR, CV_BGR5552BGRA,
+ COLOR_BGR2BGR555, COLOR_BGR2BGR565, COLOR_BGR2BGRA, COLOR_BGR2GRAY,
+ COLOR_BGR2HLS, COLOR_BGR2HLS_FULL, COLOR_BGR2HSV, COLOR_BGR2HSV_FULL,
+ COLOR_BGR2Lab, COLOR_BGR2Luv, COLOR_BGR2RGB, COLOR_BGR2RGBA, COLOR_BGR2XYZ,
+ COLOR_BGR2YCrCb, COLOR_BGR2YUV, COLOR_BGR5552BGR, COLOR_BGR5552BGRA,
- CV_BGR5552GRAY, CV_BGR5552RGB, CV_BGR5552RGBA, CV_BGR5652BGR,
- CV_BGR5652BGRA, CV_BGR5652GRAY, CV_BGR5652RGB, CV_BGR5652RGBA,
+ COLOR_BGR5552GRAY, COLOR_BGR5552RGB, COLOR_BGR5552RGBA, COLOR_BGR5652BGR,
+ COLOR_BGR5652BGRA, COLOR_BGR5652GRAY, COLOR_BGR5652RGB, COLOR_BGR5652RGBA,
- CV_BGRA2BGR, CV_BGRA2BGR555, CV_BGRA2BGR565, CV_BGRA2GRAY, CV_BGRA2RGBA,
+ COLOR_BGRA2BGR, COLOR_BGRA2BGR555, COLOR_BGRA2BGR565, COLOR_BGRA2GRAY, COLOR_BGRA2RGBA,
CX_BGRA2HLS, CX_BGRA2HLS_FULL, CX_BGRA2HSV, CX_BGRA2HSV_FULL,
CX_BGRA2Lab, CX_BGRA2Luv, CX_BGRA2XYZ,
CX_BGRA2YCrCb, CX_BGRA2YUV,
- CV_GRAY2BGR, CV_GRAY2BGR555, CV_GRAY2BGR565, CV_GRAY2BGRA,
+ COLOR_GRAY2BGR, COLOR_GRAY2BGR555, COLOR_GRAY2BGR565, COLOR_GRAY2BGRA,
- CV_HLS2BGR, CV_HLS2BGR_FULL, CV_HLS2RGB, CV_HLS2RGB_FULL,
+ COLOR_HLS2BGR, COLOR_HLS2BGR_FULL, COLOR_HLS2RGB, COLOR_HLS2RGB_FULL,
CX_HLS2BGRA, CX_HLS2BGRA_FULL, CX_HLS2RGBA, CX_HLS2RGBA_FULL,
- CV_HSV2BGR, CV_HSV2BGR_FULL, CV_HSV2RGB, CV_HSV2RGB_FULL,
+ COLOR_HSV2BGR, COLOR_HSV2BGR_FULL, COLOR_HSV2RGB, COLOR_HSV2RGB_FULL,
CX_HSV2BGRA, CX_HSV2BGRA_FULL, CX_HSV2RGBA, CX_HSV2RGBA_FULL,
- CV_Lab2BGR, CV_Lab2LBGR, CV_Lab2LRGB, CV_Lab2RGB,
+ COLOR_Lab2BGR, COLOR_Lab2LBGR, COLOR_Lab2LRGB, COLOR_Lab2RGB,
CX_Lab2BGRA, CX_Lab2LBGRA, CX_Lab2LRGBA, CX_Lab2RGBA,
- CV_LBGR2Lab, CV_LBGR2Luv, CV_LRGB2Lab, CV_LRGB2Luv,
+ COLOR_LBGR2Lab, COLOR_LBGR2Luv, COLOR_LRGB2Lab, COLOR_LRGB2Luv,
CX_LBGRA2Lab, CX_LBGRA2Luv, CX_LRGBA2Lab, CX_LRGBA2Luv,
- CV_Luv2BGR, CV_Luv2LBGR, CV_Luv2LRGB, CV_Luv2RGB,
+ COLOR_Luv2BGR, COLOR_Luv2LBGR, COLOR_Luv2LRGB, COLOR_Luv2RGB,
CX_Luv2BGRA, CX_Luv2LBGRA, CX_Luv2LRGBA, CX_Luv2RGBA,
- CV_RGB2BGR555, CV_RGB2BGR565, CV_RGB2GRAY,
- CV_RGB2HLS, CV_RGB2HLS_FULL, CV_RGB2HSV, CV_RGB2HSV_FULL,
- CV_RGB2Lab, CV_RGB2Luv, CV_RGB2XYZ, CV_RGB2YCrCb, CV_RGB2YUV,
+ COLOR_RGB2BGR555, COLOR_RGB2BGR565, COLOR_RGB2GRAY,
+ COLOR_RGB2HLS, COLOR_RGB2HLS_FULL, COLOR_RGB2HSV, COLOR_RGB2HSV_FULL,
+ COLOR_RGB2Lab, COLOR_RGB2Luv, COLOR_RGB2XYZ, COLOR_RGB2YCrCb, COLOR_RGB2YUV,
- CV_RGBA2BGR, CV_RGBA2BGR555, CV_RGBA2BGR565, CV_RGBA2GRAY,
+ COLOR_RGBA2BGR, COLOR_RGBA2BGR555, COLOR_RGBA2BGR565, COLOR_RGBA2GRAY,
CX_RGBA2HLS, CX_RGBA2HLS_FULL, CX_RGBA2HSV, CX_RGBA2HSV_FULL,
CX_RGBA2Lab, CX_RGBA2Luv, CX_RGBA2XYZ,
CX_RGBA2YCrCb, CX_RGBA2YUV,
- CV_XYZ2BGR, CV_XYZ2RGB, CX_XYZ2BGRA, CX_XYZ2RGBA,
+ COLOR_XYZ2BGR, COLOR_XYZ2RGB, CX_XYZ2BGRA, CX_XYZ2RGBA,
- CV_YCrCb2BGR, CV_YCrCb2RGB, CX_YCrCb2BGRA, CX_YCrCb2RGBA,
- CV_YUV2BGR, CV_YUV2RGB, CX_YUV2BGRA, CX_YUV2RGBA
+ COLOR_YCrCb2BGR, COLOR_YCrCb2RGB, CX_YCrCb2BGRA, CX_YCrCb2RGBA,
+ COLOR_YUV2BGR, COLOR_YUV2RGB, CX_YUV2BGRA, CX_YUV2RGBA
)
CV_ENUM(CvtModeBayer,
- CV_BayerBG2BGR, CV_BayerBG2BGR_VNG, CV_BayerBG2GRAY,
- CV_BayerGB2BGR, CV_BayerGB2BGR_VNG, CV_BayerGB2GRAY,
- CV_BayerGR2BGR, CV_BayerGR2BGR_VNG, CV_BayerGR2GRAY,
- CV_BayerRG2BGR, CV_BayerRG2BGR_VNG, CV_BayerRG2GRAY
+ COLOR_BayerBG2BGR, COLOR_BayerBG2BGR_VNG, COLOR_BayerBG2GRAY,
+ COLOR_BayerGB2BGR, COLOR_BayerGB2BGR_VNG, COLOR_BayerGB2GRAY,
+ COLOR_BayerGR2BGR, COLOR_BayerGR2BGR_VNG, COLOR_BayerGR2GRAY,
+ COLOR_BayerRG2BGR, COLOR_BayerRG2BGR_VNG, COLOR_BayerRG2GRAY
)
-CV_ENUM(CvtMode2, CV_YUV2BGR_NV12, CV_YUV2BGRA_NV12, CV_YUV2RGB_NV12, CV_YUV2RGBA_NV12, CV_YUV2BGR_NV21, CV_YUV2BGRA_NV21, CV_YUV2RGB_NV21, CV_YUV2RGBA_NV21,
- CV_YUV2BGR_YV12, CV_YUV2BGRA_YV12, CV_YUV2RGB_YV12, CV_YUV2RGBA_YV12, CV_YUV2BGR_IYUV, CV_YUV2BGRA_IYUV, CV_YUV2RGB_IYUV, CV_YUV2RGBA_IYUV,
- COLOR_YUV2GRAY_420, CV_YUV2RGB_UYVY, CV_YUV2BGR_UYVY, CV_YUV2RGBA_UYVY, CV_YUV2BGRA_UYVY, CV_YUV2RGB_YUY2, CV_YUV2BGR_YUY2, CV_YUV2RGB_YVYU,
- CV_YUV2BGR_YVYU, CV_YUV2RGBA_YUY2, CV_YUV2BGRA_YUY2, CV_YUV2RGBA_YVYU, CV_YUV2BGRA_YVYU)
+CV_ENUM(CvtMode2, COLOR_YUV2BGR_NV12, COLOR_YUV2BGRA_NV12, COLOR_YUV2RGB_NV12, COLOR_YUV2RGBA_NV12, COLOR_YUV2BGR_NV21, COLOR_YUV2BGRA_NV21, COLOR_YUV2RGB_NV21, COLOR_YUV2RGBA_NV21,
+ COLOR_YUV2BGR_YV12, COLOR_YUV2BGRA_YV12, COLOR_YUV2RGB_YV12, COLOR_YUV2RGBA_YV12, COLOR_YUV2BGR_IYUV, COLOR_YUV2BGRA_IYUV, COLOR_YUV2RGB_IYUV, COLOR_YUV2RGBA_IYUV,
+ COLOR_YUV2GRAY_420, COLOR_YUV2RGB_UYVY, COLOR_YUV2BGR_UYVY, COLOR_YUV2RGBA_UYVY, COLOR_YUV2BGRA_UYVY, COLOR_YUV2RGB_YUY2, COLOR_YUV2BGR_YUY2, COLOR_YUV2RGB_YVYU,
+ COLOR_YUV2BGR_YVYU, COLOR_YUV2RGBA_YUY2, COLOR_YUV2BGRA_YUY2, COLOR_YUV2RGBA_YVYU, COLOR_YUV2BGRA_YVYU)
-CV_ENUM(CvtMode3, CV_RGB2YUV_IYUV, CV_BGR2YUV_IYUV, CV_RGBA2YUV_IYUV, CV_BGRA2YUV_IYUV,
- CV_RGB2YUV_YV12, CV_BGR2YUV_YV12, CV_RGBA2YUV_YV12, CV_BGRA2YUV_YV12)
+CV_ENUM(CvtMode3, COLOR_RGB2YUV_IYUV, COLOR_BGR2YUV_IYUV, COLOR_RGBA2YUV_IYUV, COLOR_BGRA2YUV_IYUV,
+ COLOR_RGB2YUV_YV12, COLOR_BGR2YUV_YV12, COLOR_RGBA2YUV_YV12, COLOR_BGRA2YUV_YV12)
struct ChPair
{
{
switch(cvtMode)
{
- case CV_BayerBG2GRAY: case CV_BayerGB2GRAY:
- case CV_BayerGR2GRAY: case CV_BayerRG2GRAY:
- case CV_YUV2GRAY_420:
+ case COLOR_BayerBG2GRAY: case COLOR_BayerGB2GRAY:
+ case COLOR_BayerGR2GRAY: case COLOR_BayerRG2GRAY:
+ case COLOR_YUV2GRAY_420:
return ChPair(1,1);
- case CV_GRAY2BGR555: case CV_GRAY2BGR565:
+ case COLOR_GRAY2BGR555: case COLOR_GRAY2BGR565:
return ChPair(1,2);
- case CV_BayerBG2BGR: case CV_BayerBG2BGR_VNG:
- case CV_BayerGB2BGR: case CV_BayerGB2BGR_VNG:
- case CV_BayerGR2BGR: case CV_BayerGR2BGR_VNG:
- case CV_BayerRG2BGR: case CV_BayerRG2BGR_VNG:
- case CV_GRAY2BGR:
- case CV_YUV2BGR_NV12: case CV_YUV2RGB_NV12:
- case CV_YUV2BGR_NV21: case CV_YUV2RGB_NV21:
- case CV_YUV2BGR_YV12: case CV_YUV2RGB_YV12:
- case CV_YUV2BGR_IYUV: case CV_YUV2RGB_IYUV:
+ case COLOR_BayerBG2BGR: case COLOR_BayerBG2BGR_VNG:
+ case COLOR_BayerGB2BGR: case COLOR_BayerGB2BGR_VNG:
+ case COLOR_BayerGR2BGR: case COLOR_BayerGR2BGR_VNG:
+ case COLOR_BayerRG2BGR: case COLOR_BayerRG2BGR_VNG:
+ case COLOR_GRAY2BGR:
+ case COLOR_YUV2BGR_NV12: case COLOR_YUV2RGB_NV12:
+ case COLOR_YUV2BGR_NV21: case COLOR_YUV2RGB_NV21:
+ case COLOR_YUV2BGR_YV12: case COLOR_YUV2RGB_YV12:
+ case COLOR_YUV2BGR_IYUV: case COLOR_YUV2RGB_IYUV:
return ChPair(1,3);
- case CV_GRAY2BGRA:
- case CV_YUV2BGRA_NV12: case CV_YUV2RGBA_NV12:
- case CV_YUV2BGRA_NV21: case CV_YUV2RGBA_NV21:
- case CV_YUV2BGRA_YV12: case CV_YUV2RGBA_YV12:
- case CV_YUV2BGRA_IYUV: case CV_YUV2RGBA_IYUV:
+ case COLOR_GRAY2BGRA:
+ case COLOR_YUV2BGRA_NV12: case COLOR_YUV2RGBA_NV12:
+ case COLOR_YUV2BGRA_NV21: case COLOR_YUV2RGBA_NV21:
+ case COLOR_YUV2BGRA_YV12: case COLOR_YUV2RGBA_YV12:
+ case COLOR_YUV2BGRA_IYUV: case COLOR_YUV2RGBA_IYUV:
return ChPair(1,4);
- case CV_BGR5552GRAY: case CV_BGR5652GRAY:
+ case COLOR_BGR5552GRAY: case COLOR_BGR5652GRAY:
return ChPair(2,1);
- case CV_BGR5552BGR: case CV_BGR5552RGB:
- case CV_BGR5652BGR: case CV_BGR5652RGB:
- case CV_YUV2RGB_UYVY: case CV_YUV2BGR_UYVY:
- case CV_YUV2RGBA_UYVY: case CV_YUV2BGRA_UYVY:
- case CV_YUV2RGB_YUY2: case CV_YUV2BGR_YUY2:
- case CV_YUV2RGB_YVYU: case CV_YUV2BGR_YVYU:
- case CV_YUV2RGBA_YUY2: case CV_YUV2BGRA_YUY2:
- case CV_YUV2RGBA_YVYU: case CV_YUV2BGRA_YVYU:
+ case COLOR_BGR5552BGR: case COLOR_BGR5552RGB:
+ case COLOR_BGR5652BGR: case COLOR_BGR5652RGB:
+ case COLOR_YUV2RGB_UYVY: case COLOR_YUV2BGR_UYVY:
+ case COLOR_YUV2RGBA_UYVY: case COLOR_YUV2BGRA_UYVY:
+ case COLOR_YUV2RGB_YUY2: case COLOR_YUV2BGR_YUY2:
+ case COLOR_YUV2RGB_YVYU: case COLOR_YUV2BGR_YVYU:
+ case COLOR_YUV2RGBA_YUY2: case COLOR_YUV2BGRA_YUY2:
+ case COLOR_YUV2RGBA_YVYU: case COLOR_YUV2BGRA_YVYU:
return ChPair(2,3);
- case CV_BGR5552BGRA: case CV_BGR5552RGBA:
- case CV_BGR5652BGRA: case CV_BGR5652RGBA:
+ case COLOR_BGR5552BGRA: case COLOR_BGR5552RGBA:
+ case COLOR_BGR5652BGRA: case COLOR_BGR5652RGBA:
return ChPair(2,4);
- case CV_BGR2GRAY: case CV_RGB2GRAY:
- case CV_RGB2YUV_IYUV: case CV_RGB2YUV_YV12:
- case CV_BGR2YUV_IYUV: case CV_BGR2YUV_YV12:
+ case COLOR_BGR2GRAY: case COLOR_RGB2GRAY:
+ case COLOR_RGB2YUV_IYUV: case COLOR_RGB2YUV_YV12:
+ case COLOR_BGR2YUV_IYUV: case COLOR_BGR2YUV_YV12:
return ChPair(3,1);
- case CV_BGR2BGR555: case CV_BGR2BGR565:
- case CV_RGB2BGR555: case CV_RGB2BGR565:
+ case COLOR_BGR2BGR555: case COLOR_BGR2BGR565:
+ case COLOR_RGB2BGR555: case COLOR_RGB2BGR565:
return ChPair(3,2);
- case CV_BGR2HLS: case CV_BGR2HLS_FULL:
- case CV_BGR2HSV: case CV_BGR2HSV_FULL:
- case CV_BGR2Lab: case CV_BGR2Luv:
- case CV_BGR2RGB: case CV_BGR2XYZ:
- case CV_BGR2YCrCb: case CV_BGR2YUV:
- case CV_HLS2BGR: case CV_HLS2BGR_FULL:
- case CV_HLS2RGB: case CV_HLS2RGB_FULL:
- case CV_HSV2BGR: case CV_HSV2BGR_FULL:
- case CV_HSV2RGB: case CV_HSV2RGB_FULL:
- case CV_Lab2BGR: case CV_Lab2LBGR:
- case CV_Lab2LRGB: case CV_Lab2RGB:
- case CV_LBGR2Lab: case CV_LBGR2Luv:
- case CV_LRGB2Lab: case CV_LRGB2Luv:
- case CV_Luv2BGR: case CV_Luv2LBGR:
- case CV_Luv2LRGB: case CV_Luv2RGB:
- case CV_RGB2HLS: case CV_RGB2HLS_FULL:
- case CV_RGB2HSV: case CV_RGB2HSV_FULL:
- case CV_RGB2Lab: case CV_RGB2Luv:
- case CV_RGB2XYZ: case CV_RGB2YCrCb:
- case CV_RGB2YUV: case CV_XYZ2BGR:
- case CV_XYZ2RGB: case CV_YCrCb2BGR:
- case CV_YCrCb2RGB: case CV_YUV2BGR:
- case CV_YUV2RGB:
+ case COLOR_BGR2HLS: case COLOR_BGR2HLS_FULL:
+ case COLOR_BGR2HSV: case COLOR_BGR2HSV_FULL:
+ case COLOR_BGR2Lab: case COLOR_BGR2Luv:
+ case COLOR_BGR2RGB: case COLOR_BGR2XYZ:
+ case COLOR_BGR2YCrCb: case COLOR_BGR2YUV:
+ case COLOR_HLS2BGR: case COLOR_HLS2BGR_FULL:
+ case COLOR_HLS2RGB: case COLOR_HLS2RGB_FULL:
+ case COLOR_HSV2BGR: case COLOR_HSV2BGR_FULL:
+ case COLOR_HSV2RGB: case COLOR_HSV2RGB_FULL:
+ case COLOR_Lab2BGR: case COLOR_Lab2LBGR:
+ case COLOR_Lab2LRGB: case COLOR_Lab2RGB:
+ case COLOR_LBGR2Lab: case COLOR_LBGR2Luv:
+ case COLOR_LRGB2Lab: case COLOR_LRGB2Luv:
+ case COLOR_Luv2BGR: case COLOR_Luv2LBGR:
+ case COLOR_Luv2LRGB: case COLOR_Luv2RGB:
+ case COLOR_RGB2HLS: case COLOR_RGB2HLS_FULL:
+ case COLOR_RGB2HSV: case COLOR_RGB2HSV_FULL:
+ case COLOR_RGB2Lab: case COLOR_RGB2Luv:
+ case COLOR_RGB2XYZ: case COLOR_RGB2YCrCb:
+ case COLOR_RGB2YUV: case COLOR_XYZ2BGR:
+ case COLOR_XYZ2RGB: case COLOR_YCrCb2BGR:
+ case COLOR_YCrCb2RGB: case COLOR_YUV2BGR:
+ case COLOR_YUV2RGB:
return ChPair(3,3);
- case CV_BGR2BGRA: case CV_BGR2RGBA:
+ case COLOR_BGR2BGRA: case COLOR_BGR2RGBA:
case CX_HLS2BGRA: case CX_HLS2BGRA_FULL:
case CX_HLS2RGBA: case CX_HLS2RGBA_FULL:
case CX_HSV2BGRA: case CX_HSV2BGRA_FULL:
case CX_YCrCb2BGRA: case CX_YCrCb2RGBA:
case CX_YUV2BGRA: case CX_YUV2RGBA:
return ChPair(3,4);
- case CV_BGRA2GRAY: case CV_RGBA2GRAY:
- case CV_RGBA2YUV_IYUV: case CV_RGBA2YUV_YV12:
- case CV_BGRA2YUV_IYUV: case CV_BGRA2YUV_YV12:
+ case COLOR_BGRA2GRAY: case COLOR_RGBA2GRAY:
+ case COLOR_RGBA2YUV_IYUV: case COLOR_RGBA2YUV_YV12:
+ case COLOR_BGRA2YUV_IYUV: case COLOR_BGRA2YUV_YV12:
return ChPair(4,1);
- case CV_BGRA2BGR555: case CV_BGRA2BGR565:
- case CV_RGBA2BGR555: case CV_RGBA2BGR565:
+ case COLOR_BGRA2BGR555: case COLOR_BGRA2BGR565:
+ case COLOR_RGBA2BGR555: case COLOR_RGBA2BGR565:
return ChPair(4,2);
- case CV_BGRA2BGR: case CX_BGRA2HLS:
+ case COLOR_BGRA2BGR: case CX_BGRA2HLS:
case CX_BGRA2HLS_FULL: case CX_BGRA2HSV:
case CX_BGRA2HSV_FULL: case CX_BGRA2Lab:
case CX_BGRA2Luv: case CX_BGRA2XYZ:
case CX_BGRA2YCrCb: case CX_BGRA2YUV:
case CX_LBGRA2Lab: case CX_LBGRA2Luv:
case CX_LRGBA2Lab: case CX_LRGBA2Luv:
- case CV_RGBA2BGR: case CX_RGBA2HLS:
+ case COLOR_RGBA2BGR: case CX_RGBA2HLS:
case CX_RGBA2HLS_FULL: case CX_RGBA2HSV:
case CX_RGBA2HSV_FULL: case CX_RGBA2Lab:
case CX_RGBA2Luv: case CX_RGBA2XYZ:
case CX_RGBA2YCrCb: case CX_RGBA2YUV:
return ChPair(4,3);
- case CV_BGRA2RGBA:
+ case COLOR_BGRA2RGBA:
return ChPair(4,4);
default:
ADD_FAILURE() << "Unknown conversion type";
Size sz = get<0>(GetParam());
int mode = get<1>(GetParam());
ChPair ch = getConversionInfo(mode);
- mode %= CV_COLORCVT_MAX;
+ mode %= COLOR_COLORCVT_MAX;
Mat src(sz, CV_8UC(ch.scn));
Mat dst(sz, CV_8UC(ch.dcn));
Size sz = get<0>(GetParam());
int mode = get<1>(GetParam());
ChPair ch = getConversionInfo(mode);
- mode %= CV_COLORCVT_MAX;
+ mode %= COLOR_COLORCVT_MAX;
Mat src(sz, CV_8UC(ch.scn));
Mat dst(sz, CV_8UC(ch.dcn));