mirror of
https://github.com/storytold/LiveScan3D.git
synced 2026-10-17 00:23:00 +00:00
Moved to Visual Studio 2015, OpenCV 3.2.0, x64
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
||||
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of the copyright holders may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#ifndef OPENCV_IMGPROC_DETAIL_DISTORTION_MODEL_HPP
|
||||
#define OPENCV_IMGPROC_DETAIL_DISTORTION_MODEL_HPP
|
||||
|
||||
//! @cond IGNORED
|
||||
|
||||
namespace cv { namespace detail {
|
||||
/**
|
||||
Computes the matrix for the projection onto a tilted image sensor
|
||||
\param tauX angular parameter rotation around x-axis
|
||||
\param tauY angular parameter rotation around y-axis
|
||||
\param matTilt if not NULL returns the matrix
|
||||
\f[
|
||||
\vecthreethree{R_{33}(\tau_x, \tau_y)}{0}{-R_{13}((\tau_x, \tau_y)}
|
||||
{0}{R_{33}(\tau_x, \tau_y)}{-R_{23}(\tau_x, \tau_y)}
|
||||
{0}{0}{1} R(\tau_x, \tau_y)
|
||||
\f]
|
||||
where
|
||||
\f[
|
||||
R(\tau_x, \tau_y) =
|
||||
\vecthreethree{\cos(\tau_y)}{0}{-\sin(\tau_y)}{0}{1}{0}{\sin(\tau_y)}{0}{\cos(\tau_y)}
|
||||
\vecthreethree{1}{0}{0}{0}{\cos(\tau_x)}{\sin(\tau_x)}{0}{-\sin(\tau_x)}{\cos(\tau_x)} =
|
||||
\vecthreethree{\cos(\tau_y)}{\sin(\tau_y)\sin(\tau_x)}{-\sin(\tau_y)\cos(\tau_x)}
|
||||
{0}{\cos(\tau_x)}{\sin(\tau_x)}
|
||||
{\sin(\tau_y)}{-\cos(\tau_y)\sin(\tau_x)}{\cos(\tau_y)\cos(\tau_x)}.
|
||||
\f]
|
||||
\param dMatTiltdTauX if not NULL it returns the derivative of matTilt with
|
||||
respect to \f$\tau_x\f$.
|
||||
\param dMatTiltdTauY if not NULL it returns the derivative of matTilt with
|
||||
respect to \f$\tau_y\f$.
|
||||
\param invMatTilt if not NULL it returns the inverse of matTilt
|
||||
**/
|
||||
template <typename FLOAT>
|
||||
void computeTiltProjectionMatrix(FLOAT tauX,
|
||||
FLOAT tauY,
|
||||
Matx<FLOAT, 3, 3>* matTilt = 0,
|
||||
Matx<FLOAT, 3, 3>* dMatTiltdTauX = 0,
|
||||
Matx<FLOAT, 3, 3>* dMatTiltdTauY = 0,
|
||||
Matx<FLOAT, 3, 3>* invMatTilt = 0)
|
||||
{
|
||||
FLOAT cTauX = cos(tauX);
|
||||
FLOAT sTauX = sin(tauX);
|
||||
FLOAT cTauY = cos(tauY);
|
||||
FLOAT sTauY = sin(tauY);
|
||||
Matx<FLOAT, 3, 3> matRotX = Matx<FLOAT, 3, 3>(1,0,0,0,cTauX,sTauX,0,-sTauX,cTauX);
|
||||
Matx<FLOAT, 3, 3> matRotY = Matx<FLOAT, 3, 3>(cTauY,0,-sTauY,0,1,0,sTauY,0,cTauY);
|
||||
Matx<FLOAT, 3, 3> matRotXY = matRotY * matRotX;
|
||||
Matx<FLOAT, 3, 3> matProjZ = Matx<FLOAT, 3, 3>(matRotXY(2,2),0,-matRotXY(0,2),0,matRotXY(2,2),-matRotXY(1,2),0,0,1);
|
||||
if (matTilt)
|
||||
{
|
||||
// Matrix for trapezoidal distortion of tilted image sensor
|
||||
*matTilt = matProjZ * matRotXY;
|
||||
}
|
||||
if (dMatTiltdTauX)
|
||||
{
|
||||
// Derivative with respect to tauX
|
||||
Matx<FLOAT, 3, 3> dMatRotXYdTauX = matRotY * Matx<FLOAT, 3, 3>(0,0,0,0,-sTauX,cTauX,0,-cTauX,-sTauX);
|
||||
Matx<FLOAT, 3, 3> dMatProjZdTauX = Matx<FLOAT, 3, 3>(dMatRotXYdTauX(2,2),0,-dMatRotXYdTauX(0,2),
|
||||
0,dMatRotXYdTauX(2,2),-dMatRotXYdTauX(1,2),0,0,0);
|
||||
*dMatTiltdTauX = (matProjZ * dMatRotXYdTauX) + (dMatProjZdTauX * matRotXY);
|
||||
}
|
||||
if (dMatTiltdTauY)
|
||||
{
|
||||
// Derivative with respect to tauY
|
||||
Matx<FLOAT, 3, 3> dMatRotXYdTauY = Matx<FLOAT, 3, 3>(-sTauY,0,-cTauY,0,0,0,cTauY,0,-sTauY) * matRotX;
|
||||
Matx<FLOAT, 3, 3> dMatProjZdTauY = Matx<FLOAT, 3, 3>(dMatRotXYdTauY(2,2),0,-dMatRotXYdTauY(0,2),
|
||||
0,dMatRotXYdTauY(2,2),-dMatRotXYdTauY(1,2),0,0,0);
|
||||
*dMatTiltdTauY = (matProjZ * dMatRotXYdTauY) + (dMatProjZdTauY * matRotXY);
|
||||
}
|
||||
if (invMatTilt)
|
||||
{
|
||||
FLOAT inv = 1./matRotXY(2,2);
|
||||
Matx<FLOAT, 3, 3> invMatProjZ = Matx<FLOAT, 3, 3>(inv,0,inv*matRotXY(0,2),0,inv,inv*matRotXY(1,2),0,0,1);
|
||||
*invMatTilt = matRotXY.t()*invMatProjZ;
|
||||
}
|
||||
}
|
||||
}} // namespace detail, cv
|
||||
|
||||
|
||||
//! @endcond
|
||||
|
||||
#endif // OPENCV_IMGPROC_DETAIL_DISTORTION_MODEL_HPP
|
||||
@@ -0,0 +1,189 @@
|
||||
#ifndef CV_IMGPROC_HAL_HPP
|
||||
#define CV_IMGPROC_HAL_HPP
|
||||
|
||||
#include "opencv2/core/cvdef.h"
|
||||
#include "opencv2/core/cvstd.hpp"
|
||||
#include "opencv2/core/hal/interface.h"
|
||||
|
||||
namespace cv { namespace hal {
|
||||
|
||||
//! @addtogroup imgproc_hal_functions
|
||||
//! @{
|
||||
|
||||
struct CV_EXPORTS Filter2D
|
||||
{
|
||||
static Ptr<hal::Filter2D> create(uchar * kernel_data, size_t kernel_step, int kernel_type,
|
||||
int kernel_width, int kernel_height,
|
||||
int max_width, int max_height,
|
||||
int stype, int dtype,
|
||||
int borderType, double delta,
|
||||
int anchor_x, int anchor_y,
|
||||
bool isSubmatrix, bool isInplace);
|
||||
virtual void apply(uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int full_width, int full_height,
|
||||
int offset_x, int offset_y) = 0;
|
||||
virtual ~Filter2D() {}
|
||||
};
|
||||
|
||||
struct CV_EXPORTS SepFilter2D
|
||||
{
|
||||
static Ptr<hal::SepFilter2D> create(int stype, int dtype, int ktype,
|
||||
uchar * kernelx_data, int kernelx_len,
|
||||
uchar * kernely_data, int kernely_len,
|
||||
int anchor_x, int anchor_y,
|
||||
double delta, int borderType);
|
||||
virtual void apply(uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int full_width, int full_height,
|
||||
int offset_x, int offset_y) = 0;
|
||||
virtual ~SepFilter2D() {}
|
||||
};
|
||||
|
||||
|
||||
struct CV_EXPORTS Morph
|
||||
{
|
||||
static Ptr<Morph> create(int op, int src_type, int dst_type, int max_width, int max_height,
|
||||
int kernel_type, uchar * kernel_data, size_t kernel_step,
|
||||
int kernel_width, int kernel_height,
|
||||
int anchor_x, int anchor_y,
|
||||
int borderType, const double borderValue[4],
|
||||
int iterations, bool isSubmatrix, bool allowInplace);
|
||||
virtual void apply(uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height,
|
||||
int roi_width, int roi_height, int roi_x, int roi_y,
|
||||
int roi_width2, int roi_height2, int roi_x2, int roi_y2) = 0;
|
||||
virtual ~Morph() {}
|
||||
};
|
||||
|
||||
|
||||
CV_EXPORTS void resize(int src_type,
|
||||
const uchar * src_data, size_t src_step, int src_width, int src_height,
|
||||
uchar * dst_data, size_t dst_step, int dst_width, int dst_height,
|
||||
double inv_scale_x, double inv_scale_y, int interpolation);
|
||||
|
||||
CV_EXPORTS void warpAffine(int src_type,
|
||||
const uchar * src_data, size_t src_step, int src_width, int src_height,
|
||||
uchar * dst_data, size_t dst_step, int dst_width, int dst_height,
|
||||
const double M[6], int interpolation, int borderType, const double borderValue[4]);
|
||||
|
||||
CV_EXPORTS void warpPerspectve(int src_type,
|
||||
const uchar * src_data, size_t src_step, int src_width, int src_height,
|
||||
uchar * dst_data, size_t dst_step, int dst_width, int dst_height,
|
||||
const double M[9], int interpolation, int borderType, const double borderValue[4]);
|
||||
|
||||
CV_EXPORTS void cvtBGRtoBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int scn, int dcn, bool swapBlue);
|
||||
|
||||
CV_EXPORTS void cvtBGRtoBGR5x5(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int scn, bool swapBlue, int greenBits);
|
||||
|
||||
CV_EXPORTS void cvtBGR5x5toBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int dcn, bool swapBlue, int greenBits);
|
||||
|
||||
CV_EXPORTS void cvtBGRtoGray(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int scn, bool swapBlue);
|
||||
|
||||
CV_EXPORTS void cvtGraytoBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int dcn);
|
||||
|
||||
CV_EXPORTS void cvtBGR5x5toGray(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int greenBits);
|
||||
|
||||
CV_EXPORTS void cvtGraytoBGR5x5(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int greenBits);
|
||||
CV_EXPORTS void cvtBGRtoYUV(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int scn, bool swapBlue, bool isCbCr);
|
||||
|
||||
CV_EXPORTS void cvtYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int dcn, bool swapBlue, bool isCbCr);
|
||||
|
||||
CV_EXPORTS void cvtBGRtoXYZ(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int scn, bool swapBlue);
|
||||
|
||||
CV_EXPORTS void cvtXYZtoBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int dcn, bool swapBlue);
|
||||
|
||||
CV_EXPORTS void cvtBGRtoHSV(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int scn, bool swapBlue, bool isFullRange, bool isHSV);
|
||||
|
||||
CV_EXPORTS void cvtHSVtoBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int dcn, bool swapBlue, bool isFullRange, bool isHSV);
|
||||
|
||||
CV_EXPORTS void cvtBGRtoLab(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int scn, bool swapBlue, bool isLab, bool srgb);
|
||||
|
||||
CV_EXPORTS void cvtLabtoBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int depth, int dcn, bool swapBlue, bool isLab, bool srgb);
|
||||
|
||||
CV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int dst_width, int dst_height,
|
||||
int dcn, bool swapBlue, int uIdx);
|
||||
|
||||
CV_EXPORTS void cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int dst_width, int dst_height,
|
||||
int dcn, bool swapBlue, int uIdx);
|
||||
|
||||
CV_EXPORTS void cvtBGRtoThreePlaneYUV(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int scn, bool swapBlue, int uIdx);
|
||||
|
||||
CV_EXPORTS void cvtOnePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height,
|
||||
int dcn, bool swapBlue, int uIdx, int ycn);
|
||||
|
||||
CV_EXPORTS void cvtRGBAtoMultipliedRGBA(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height);
|
||||
|
||||
CV_EXPORTS void cvtMultipliedRGBAtoRGBA(const uchar * src_data, size_t src_step,
|
||||
uchar * dst_data, size_t dst_step,
|
||||
int width, int height);
|
||||
|
||||
CV_EXPORTS void integral(int depth, int sdepth, int sqdepth,
|
||||
const uchar* src, size_t srcstep,
|
||||
uchar* sum, size_t sumstep,
|
||||
uchar* sqsum, size_t sqsumstep,
|
||||
uchar* tilted, size_t tstep,
|
||||
int width, int height, int cn);
|
||||
|
||||
//! @}
|
||||
|
||||
}}
|
||||
|
||||
#endif // CV_IMGPROC_HAL_HPP
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef OPENCV_IMGPROC_HAL_INTERFACE_H
|
||||
#define OPENCV_IMGPROC_HAL_INTERFACE_H
|
||||
|
||||
//! @addtogroup imgproc_hal_interface
|
||||
//! @{
|
||||
|
||||
//! @name Interpolation modes
|
||||
//! @sa cv::InterpolationFlags
|
||||
//! @{
|
||||
#define CV_HAL_INTER_NEAREST 0
|
||||
#define CV_HAL_INTER_LINEAR 1
|
||||
#define CV_HAL_INTER_CUBIC 2
|
||||
#define CV_HAL_INTER_AREA 3
|
||||
#define CV_HAL_INTER_LANCZOS4 4
|
||||
//! @}
|
||||
|
||||
//! @name Morphology operations
|
||||
//! @sa cv::MorphTypes
|
||||
//! @{
|
||||
#define MORPH_ERODE 0
|
||||
#define MORPH_DILATE 1
|
||||
//! @}
|
||||
|
||||
//! @}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
+721
-134
File diff suppressed because it is too large
Load Diff
+126
-140
@@ -40,8 +40,8 @@
|
||||
//
|
||||
//M*/
|
||||
|
||||
#ifndef __OPENCV_IMGPROC_TYPES_C_H__
|
||||
#define __OPENCV_IMGPROC_TYPES_C_H__
|
||||
#ifndef OPENCV_IMGPROC_TYPES_C_H
|
||||
#define OPENCV_IMGPROC_TYPES_C_H
|
||||
|
||||
#include "opencv2/core/core_c.h"
|
||||
|
||||
@@ -49,41 +49,55 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Connected component structure */
|
||||
/** @addtogroup imgproc_c
|
||||
@{
|
||||
*/
|
||||
|
||||
/** Connected component structure */
|
||||
typedef struct CvConnectedComp
|
||||
{
|
||||
double area; /* area of the connected component */
|
||||
CvScalar value; /* average color of the connected component */
|
||||
CvRect rect; /* ROI of the component */
|
||||
CvSeq* contour; /* optional component boundary
|
||||
double area; /**<area of the connected component */
|
||||
CvScalar value; /**<average color of the connected component */
|
||||
CvRect rect; /**<ROI of the component */
|
||||
CvSeq* contour; /**<optional component boundary
|
||||
(the contour might have child contours corresponding to the holes)*/
|
||||
}
|
||||
CvConnectedComp;
|
||||
|
||||
/* Image smooth methods */
|
||||
enum
|
||||
/** Image smooth methods */
|
||||
enum SmoothMethod_c
|
||||
{
|
||||
/** linear convolution with \f$\texttt{size1}\times\texttt{size2}\f$ box kernel (all 1's). If
|
||||
you want to smooth different pixels with different-size box kernels, you can use the integral
|
||||
image that is computed using integral */
|
||||
CV_BLUR_NO_SCALE =0,
|
||||
/** linear convolution with \f$\texttt{size1}\times\texttt{size2}\f$ box kernel (all
|
||||
1's) with subsequent scaling by \f$1/(\texttt{size1}\cdot\texttt{size2})\f$ */
|
||||
CV_BLUR =1,
|
||||
/** linear convolution with a \f$\texttt{size1}\times\texttt{size2}\f$ Gaussian kernel */
|
||||
CV_GAUSSIAN =2,
|
||||
/** median filter with a \f$\texttt{size1}\times\texttt{size1}\f$ square aperture */
|
||||
CV_MEDIAN =3,
|
||||
/** bilateral filter with a \f$\texttt{size1}\times\texttt{size1}\f$ square aperture, color
|
||||
sigma= sigma1 and spatial sigma= sigma2. If size1=0, the aperture square side is set to
|
||||
cvRound(sigma2\*1.5)\*2+1. See cv::bilateralFilter */
|
||||
CV_BILATERAL =4
|
||||
};
|
||||
|
||||
/* Filters used in pyramid decomposition */
|
||||
/** Filters used in pyramid decomposition */
|
||||
enum
|
||||
{
|
||||
CV_GAUSSIAN_5x5 = 7
|
||||
};
|
||||
|
||||
/* Special filters */
|
||||
/** Special filters */
|
||||
enum
|
||||
{
|
||||
CV_SCHARR =-1,
|
||||
CV_MAX_SOBEL_KSIZE =7
|
||||
};
|
||||
|
||||
/* Constants for color conversion */
|
||||
/** Constants for color conversion */
|
||||
enum
|
||||
{
|
||||
CV_BGR2BGRA =0,
|
||||
@@ -324,11 +338,22 @@ enum
|
||||
CV_RGBA2YUV_YV12 = 133,
|
||||
CV_BGRA2YUV_YV12 = 134,
|
||||
|
||||
CV_COLORCVT_MAX = 135
|
||||
// Edge-Aware Demosaicing
|
||||
CV_BayerBG2BGR_EA = 135,
|
||||
CV_BayerGB2BGR_EA = 136,
|
||||
CV_BayerRG2BGR_EA = 137,
|
||||
CV_BayerGR2BGR_EA = 138,
|
||||
|
||||
CV_BayerBG2RGB_EA = CV_BayerRG2BGR_EA,
|
||||
CV_BayerGB2RGB_EA = CV_BayerGR2BGR_EA,
|
||||
CV_BayerRG2RGB_EA = CV_BayerBG2BGR_EA,
|
||||
CV_BayerGR2RGB_EA = CV_BayerGB2BGR_EA,
|
||||
|
||||
CV_COLORCVT_MAX = 139
|
||||
};
|
||||
|
||||
|
||||
/* Sub-pixel interpolation methods */
|
||||
/** Sub-pixel interpolation methods */
|
||||
enum
|
||||
{
|
||||
CV_INTER_NN =0,
|
||||
@@ -338,23 +363,25 @@ enum
|
||||
CV_INTER_LANCZOS4 =4
|
||||
};
|
||||
|
||||
/* ... and other image warping flags */
|
||||
/** ... and other image warping flags */
|
||||
enum
|
||||
{
|
||||
CV_WARP_FILL_OUTLIERS =8,
|
||||
CV_WARP_INVERSE_MAP =16
|
||||
};
|
||||
|
||||
/* Shapes of a structuring element for morphological operations */
|
||||
enum
|
||||
/** Shapes of a structuring element for morphological operations
|
||||
@see cv::MorphShapes, cv::getStructuringElement
|
||||
*/
|
||||
enum MorphShapes_c
|
||||
{
|
||||
CV_SHAPE_RECT =0,
|
||||
CV_SHAPE_CROSS =1,
|
||||
CV_SHAPE_ELLIPSE =2,
|
||||
CV_SHAPE_CUSTOM =100
|
||||
CV_SHAPE_CUSTOM =100 //!< custom structuring element
|
||||
};
|
||||
|
||||
/* Morphological operations */
|
||||
/** Morphological operations */
|
||||
enum
|
||||
{
|
||||
CV_MOP_ERODE =0,
|
||||
@@ -366,23 +393,41 @@ enum
|
||||
CV_MOP_BLACKHAT =6
|
||||
};
|
||||
|
||||
/* Spatial and central moments */
|
||||
/** Spatial and central moments */
|
||||
typedef struct CvMoments
|
||||
{
|
||||
double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; /* spatial moments */
|
||||
double mu20, mu11, mu02, mu30, mu21, mu12, mu03; /* central moments */
|
||||
double inv_sqrt_m00; /* m00 != 0 ? 1/sqrt(m00) : 0 */
|
||||
double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; /**< spatial moments */
|
||||
double mu20, mu11, mu02, mu30, mu21, mu12, mu03; /**< central moments */
|
||||
double inv_sqrt_m00; /**< m00 != 0 ? 1/sqrt(m00) : 0 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
CvMoments(){}
|
||||
CvMoments(const cv::Moments& m)
|
||||
{
|
||||
m00 = m.m00; m10 = m.m10; m01 = m.m01;
|
||||
m20 = m.m20; m11 = m.m11; m02 = m.m02;
|
||||
m30 = m.m30; m21 = m.m21; m12 = m.m12; m03 = m.m03;
|
||||
mu20 = m.mu20; mu11 = m.mu11; mu02 = m.mu02;
|
||||
mu30 = m.mu30; mu21 = m.mu21; mu12 = m.mu12; mu03 = m.mu03;
|
||||
double am00 = std::abs(m.m00);
|
||||
inv_sqrt_m00 = am00 > DBL_EPSILON ? 1./std::sqrt(am00) : 0;
|
||||
}
|
||||
operator cv::Moments() const
|
||||
{
|
||||
return cv::Moments(m00, m10, m01, m20, m11, m02, m30, m21, m12, m03);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
CvMoments;
|
||||
|
||||
/* Hu invariants */
|
||||
/** Hu invariants */
|
||||
typedef struct CvHuMoments
|
||||
{
|
||||
double hu1, hu2, hu3, hu4, hu5, hu6, hu7; /* Hu invariants */
|
||||
double hu1, hu2, hu3, hu4, hu5, hu6, hu7; /**< Hu invariants */
|
||||
}
|
||||
CvHuMoments;
|
||||
|
||||
/* Template matching methods */
|
||||
/** Template matching methods */
|
||||
enum
|
||||
{
|
||||
CV_TM_SQDIFF =0,
|
||||
@@ -395,7 +440,7 @@ enum
|
||||
|
||||
typedef float (CV_CDECL * CvDistanceFunction)( const float* a, const float* b, void* user_param );
|
||||
|
||||
/* Contour retrieval modes */
|
||||
/** Contour retrieval modes */
|
||||
enum
|
||||
{
|
||||
CV_RETR_EXTERNAL=0,
|
||||
@@ -405,7 +450,7 @@ enum
|
||||
CV_RETR_FLOODFILL=4
|
||||
};
|
||||
|
||||
/* Contour approximation methods */
|
||||
/** Contour approximation methods */
|
||||
enum
|
||||
{
|
||||
CV_CHAIN_CODE=0,
|
||||
@@ -417,12 +462,12 @@ enum
|
||||
};
|
||||
|
||||
/*
|
||||
Internal structure that is used for sequental retrieving contours from the image.
|
||||
Internal structure that is used for sequential retrieving contours from the image.
|
||||
It supports both hierarchical and plane variants of Suzuki algorithm.
|
||||
*/
|
||||
typedef struct _CvContourScanner* CvContourScanner;
|
||||
|
||||
/* Freeman chain reader state */
|
||||
/** Freeman chain reader state */
|
||||
typedef struct CvChainPtReader
|
||||
{
|
||||
CV_SEQ_READER_FIELDS()
|
||||
@@ -432,7 +477,7 @@ typedef struct CvChainPtReader
|
||||
}
|
||||
CvChainPtReader;
|
||||
|
||||
/* initializes 8-element array for fast access to 3x3 neighborhood of a pixel */
|
||||
/** initializes 8-element array for fast access to 3x3 neighborhood of a pixel */
|
||||
#define CV_INIT_3X3_DELTAS( deltas, step, nch ) \
|
||||
((deltas)[0] = (nch), (deltas)[1] = -(step) + (nch), \
|
||||
(deltas)[2] = -(step), (deltas)[3] = -(step) - (nch), \
|
||||
@@ -440,94 +485,28 @@ CvChainPtReader;
|
||||
(deltas)[6] = (step), (deltas)[7] = (step) + (nch))
|
||||
|
||||
|
||||
/****************************************************************************************\
|
||||
* Planar subdivisions *
|
||||
\****************************************************************************************/
|
||||
|
||||
typedef size_t CvSubdiv2DEdge;
|
||||
|
||||
#define CV_QUADEDGE2D_FIELDS() \
|
||||
int flags; \
|
||||
struct CvSubdiv2DPoint* pt[4]; \
|
||||
CvSubdiv2DEdge next[4];
|
||||
|
||||
#define CV_SUBDIV2D_POINT_FIELDS()\
|
||||
int flags; \
|
||||
CvSubdiv2DEdge first; \
|
||||
CvPoint2D32f pt; \
|
||||
int id;
|
||||
|
||||
#define CV_SUBDIV2D_VIRTUAL_POINT_FLAG (1 << 30)
|
||||
|
||||
typedef struct CvQuadEdge2D
|
||||
{
|
||||
CV_QUADEDGE2D_FIELDS()
|
||||
}
|
||||
CvQuadEdge2D;
|
||||
|
||||
typedef struct CvSubdiv2DPoint
|
||||
{
|
||||
CV_SUBDIV2D_POINT_FIELDS()
|
||||
}
|
||||
CvSubdiv2DPoint;
|
||||
|
||||
#define CV_SUBDIV2D_FIELDS() \
|
||||
CV_GRAPH_FIELDS() \
|
||||
int quad_edges; \
|
||||
int is_geometry_valid; \
|
||||
CvSubdiv2DEdge recent_edge; \
|
||||
CvPoint2D32f topleft; \
|
||||
CvPoint2D32f bottomright;
|
||||
|
||||
typedef struct CvSubdiv2D
|
||||
{
|
||||
CV_SUBDIV2D_FIELDS()
|
||||
}
|
||||
CvSubdiv2D;
|
||||
|
||||
|
||||
typedef enum CvSubdiv2DPointLocation
|
||||
{
|
||||
CV_PTLOC_ERROR = -2,
|
||||
CV_PTLOC_OUTSIDE_RECT = -1,
|
||||
CV_PTLOC_INSIDE = 0,
|
||||
CV_PTLOC_VERTEX = 1,
|
||||
CV_PTLOC_ON_EDGE = 2
|
||||
}
|
||||
CvSubdiv2DPointLocation;
|
||||
|
||||
typedef enum CvNextEdgeType
|
||||
{
|
||||
CV_NEXT_AROUND_ORG = 0x00,
|
||||
CV_NEXT_AROUND_DST = 0x22,
|
||||
CV_PREV_AROUND_ORG = 0x11,
|
||||
CV_PREV_AROUND_DST = 0x33,
|
||||
CV_NEXT_AROUND_LEFT = 0x13,
|
||||
CV_NEXT_AROUND_RIGHT = 0x31,
|
||||
CV_PREV_AROUND_LEFT = 0x20,
|
||||
CV_PREV_AROUND_RIGHT = 0x02
|
||||
}
|
||||
CvNextEdgeType;
|
||||
|
||||
/* get the next edge with the same origin point (counterwise) */
|
||||
#define CV_SUBDIV2D_NEXT_EDGE( edge ) (((CvQuadEdge2D*)((edge) & ~3))->next[(edge)&3])
|
||||
|
||||
|
||||
/* Contour approximation algorithms */
|
||||
/** Contour approximation algorithms */
|
||||
enum
|
||||
{
|
||||
CV_POLY_APPROX_DP = 0
|
||||
};
|
||||
|
||||
/* Shape matching methods */
|
||||
enum
|
||||
/** @brief Shape matching methods
|
||||
|
||||
\f$A\f$ denotes object1,\f$B\f$ denotes object2
|
||||
|
||||
\f$\begin{array}{l} m^A_i = \mathrm{sign} (h^A_i) \cdot \log{h^A_i} \\ m^B_i = \mathrm{sign} (h^B_i) \cdot \log{h^B_i} \end{array}\f$
|
||||
|
||||
and \f$h^A_i, h^B_i\f$ are the Hu moments of \f$A\f$ and \f$B\f$ , respectively.
|
||||
*/
|
||||
enum ShapeMatchModes
|
||||
{
|
||||
CV_CONTOURS_MATCH_I1 =1,
|
||||
CV_CONTOURS_MATCH_I2 =2,
|
||||
CV_CONTOURS_MATCH_I3 =3
|
||||
CV_CONTOURS_MATCH_I1 =1, //!< \f[I_1(A,B) = \sum _{i=1...7} \left | \frac{1}{m^A_i} - \frac{1}{m^B_i} \right |\f]
|
||||
CV_CONTOURS_MATCH_I2 =2, //!< \f[I_2(A,B) = \sum _{i=1...7} \left | m^A_i - m^B_i \right |\f]
|
||||
CV_CONTOURS_MATCH_I3 =3 //!< \f[I_3(A,B) = \max _{i=1...7} \frac{ \left| m^A_i - m^B_i \right| }{ \left| m^A_i \right| }\f]
|
||||
};
|
||||
|
||||
/* Shape orientation */
|
||||
/** Shape orientation */
|
||||
enum
|
||||
{
|
||||
CV_CLOCKWISE =1,
|
||||
@@ -535,27 +514,29 @@ enum
|
||||
};
|
||||
|
||||
|
||||
/* Convexity defect */
|
||||
/** Convexity defect */
|
||||
typedef struct CvConvexityDefect
|
||||
{
|
||||
CvPoint* start; /* point of the contour where the defect begins */
|
||||
CvPoint* end; /* point of the contour where the defect ends */
|
||||
CvPoint* depth_point; /* the farthest from the convex hull point within the defect */
|
||||
float depth; /* distance between the farthest point and the convex hull */
|
||||
CvPoint* start; /**< point of the contour where the defect begins */
|
||||
CvPoint* end; /**< point of the contour where the defect ends */
|
||||
CvPoint* depth_point; /**< the farthest from the convex hull point within the defect */
|
||||
float depth; /**< distance between the farthest point and the convex hull */
|
||||
} CvConvexityDefect;
|
||||
|
||||
|
||||
/* Histogram comparison methods */
|
||||
/** Histogram comparison methods */
|
||||
enum
|
||||
{
|
||||
CV_COMP_CORREL =0,
|
||||
CV_COMP_CHISQR =1,
|
||||
CV_COMP_INTERSECT =2,
|
||||
CV_COMP_BHATTACHARYYA =3,
|
||||
CV_COMP_HELLINGER =CV_COMP_BHATTACHARYYA
|
||||
CV_COMP_HELLINGER =CV_COMP_BHATTACHARYYA,
|
||||
CV_COMP_CHISQR_ALT =4,
|
||||
CV_COMP_KL_DIV =5
|
||||
};
|
||||
|
||||
/* Mask size for distance transform */
|
||||
/** Mask size for distance transform */
|
||||
enum
|
||||
{
|
||||
CV_DIST_MASK_3 =3,
|
||||
@@ -563,48 +544,51 @@ enum
|
||||
CV_DIST_MASK_PRECISE =0
|
||||
};
|
||||
|
||||
/* Content of output label array: connected components or pixels */
|
||||
/** Content of output label array: connected components or pixels */
|
||||
enum
|
||||
{
|
||||
CV_DIST_LABEL_CCOMP = 0,
|
||||
CV_DIST_LABEL_PIXEL = 1
|
||||
};
|
||||
|
||||
/* Distance types for Distance Transform and M-estimators */
|
||||
/** Distance types for Distance Transform and M-estimators */
|
||||
enum
|
||||
{
|
||||
CV_DIST_USER =-1, /* User defined distance */
|
||||
CV_DIST_L1 =1, /* distance = |x1-x2| + |y1-y2| */
|
||||
CV_DIST_L2 =2, /* the simple euclidean distance */
|
||||
CV_DIST_C =3, /* distance = max(|x1-x2|,|y1-y2|) */
|
||||
CV_DIST_L12 =4, /* L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) */
|
||||
CV_DIST_FAIR =5, /* distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 */
|
||||
CV_DIST_WELSCH =6, /* distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 */
|
||||
CV_DIST_HUBER =7 /* distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345 */
|
||||
CV_DIST_USER =-1, /**< User defined distance */
|
||||
CV_DIST_L1 =1, /**< distance = |x1-x2| + |y1-y2| */
|
||||
CV_DIST_L2 =2, /**< the simple euclidean distance */
|
||||
CV_DIST_C =3, /**< distance = max(|x1-x2|,|y1-y2|) */
|
||||
CV_DIST_L12 =4, /**< L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) */
|
||||
CV_DIST_FAIR =5, /**< distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 */
|
||||
CV_DIST_WELSCH =6, /**< distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 */
|
||||
CV_DIST_HUBER =7 /**< distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345 */
|
||||
};
|
||||
|
||||
|
||||
/* Threshold types */
|
||||
/** Threshold types */
|
||||
enum
|
||||
{
|
||||
CV_THRESH_BINARY =0, /* value = value > threshold ? max_value : 0 */
|
||||
CV_THRESH_BINARY_INV =1, /* value = value > threshold ? 0 : max_value */
|
||||
CV_THRESH_TRUNC =2, /* value = value > threshold ? threshold : value */
|
||||
CV_THRESH_TOZERO =3, /* value = value > threshold ? value : 0 */
|
||||
CV_THRESH_TOZERO_INV =4, /* value = value > threshold ? 0 : value */
|
||||
CV_THRESH_BINARY =0, /**< value = value > threshold ? max_value : 0 */
|
||||
CV_THRESH_BINARY_INV =1, /**< value = value > threshold ? 0 : max_value */
|
||||
CV_THRESH_TRUNC =2, /**< value = value > threshold ? threshold : value */
|
||||
CV_THRESH_TOZERO =3, /**< value = value > threshold ? value : 0 */
|
||||
CV_THRESH_TOZERO_INV =4, /**< value = value > threshold ? 0 : value */
|
||||
CV_THRESH_MASK =7,
|
||||
CV_THRESH_OTSU =8 /* use Otsu algorithm to choose the optimal threshold value;
|
||||
CV_THRESH_OTSU =8, /**< use Otsu algorithm to choose the optimal threshold value;
|
||||
combine the flag with one of the above CV_THRESH_* values */
|
||||
CV_THRESH_TRIANGLE =16 /**< use Triangle algorithm to choose the optimal threshold value;
|
||||
combine the flag with one of the above CV_THRESH_* values, but not
|
||||
with CV_THRESH_OTSU */
|
||||
};
|
||||
|
||||
/* Adaptive threshold methods */
|
||||
/** Adaptive threshold methods */
|
||||
enum
|
||||
{
|
||||
CV_ADAPTIVE_THRESH_MEAN_C =0,
|
||||
CV_ADAPTIVE_THRESH_GAUSSIAN_C =1
|
||||
};
|
||||
|
||||
/* FloodFill flags */
|
||||
/** FloodFill flags */
|
||||
enum
|
||||
{
|
||||
CV_FLOODFILL_FIXED_RANGE =(1 << 16),
|
||||
@@ -612,13 +596,13 @@ enum
|
||||
};
|
||||
|
||||
|
||||
/* Canny edge detector flags */
|
||||
/** Canny edge detector flags */
|
||||
enum
|
||||
{
|
||||
CV_CANNY_L2_GRADIENT =(1 << 31)
|
||||
};
|
||||
|
||||
/* Variants of a Hough transform */
|
||||
/** Variants of a Hough transform */
|
||||
enum
|
||||
{
|
||||
CV_HOUGH_STANDARD =0,
|
||||
@@ -633,6 +617,8 @@ struct CvFeatureTree;
|
||||
struct CvLSH;
|
||||
struct CvLSHOperations;
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user