init: 64 bits version of the webcam
This commit is contained in:
123
include/opencv2/imgproc/detail/distortion_model.hpp
Normal file
123
include/opencv2/imgproc/detail/distortion_model.hpp
Normal file
@ -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
|
||||
241
include/opencv2/imgproc/hal/hal.hpp
Normal file
241
include/opencv2/imgproc/hal/hal.hpp
Normal file
@ -0,0 +1,241 @@
|
||||
#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
|
||||
//! @{
|
||||
|
||||
//---------------------------
|
||||
//! @cond IGNORED
|
||||
|
||||
struct CV_EXPORTS Filter2D
|
||||
{
|
||||
CV_DEPRECATED static Ptr<hal::Filter2D> create(uchar * , size_t , int ,
|
||||
int , int ,
|
||||
int , int ,
|
||||
int , int ,
|
||||
int , double ,
|
||||
int , int ,
|
||||
bool , bool );
|
||||
virtual void apply(uchar * , size_t ,
|
||||
uchar * , size_t ,
|
||||
int , int ,
|
||||
int , int ,
|
||||
int , int ) = 0;
|
||||
virtual ~Filter2D() {}
|
||||
};
|
||||
|
||||
struct CV_EXPORTS SepFilter2D
|
||||
{
|
||||
CV_DEPRECATED static Ptr<hal::SepFilter2D> create(int , int , int ,
|
||||
uchar * , int ,
|
||||
uchar * , int ,
|
||||
int , int ,
|
||||
double , int );
|
||||
virtual void apply(uchar * , size_t ,
|
||||
uchar * , size_t ,
|
||||
int , int ,
|
||||
int , int ,
|
||||
int , int ) = 0;
|
||||
virtual ~SepFilter2D() {}
|
||||
};
|
||||
|
||||
|
||||
struct CV_EXPORTS Morph
|
||||
{
|
||||
CV_DEPRECATED static Ptr<hal::Morph> create(int , int , int , int , int ,
|
||||
int , uchar * , size_t ,
|
||||
int , int ,
|
||||
int , int ,
|
||||
int , const double *,
|
||||
int , bool , bool );
|
||||
virtual void apply(uchar * , size_t , uchar * , size_t , int , int ,
|
||||
int , int , int , int ,
|
||||
int , int , int , int ) = 0;
|
||||
virtual ~Morph() {}
|
||||
};
|
||||
|
||||
//! @endcond
|
||||
//---------------------------
|
||||
|
||||
CV_EXPORTS void filter2D(int stype, int dtype, int kernel_type,
|
||||
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,
|
||||
uchar * kernel_data, size_t kernel_step,
|
||||
int kernel_width, int kernel_height,
|
||||
int anchor_x, int anchor_y,
|
||||
double delta, int borderType,
|
||||
bool isSubmatrix);
|
||||
|
||||
CV_EXPORTS void sepFilter2D(int stype, int dtype, int ktype,
|
||||
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,
|
||||
uchar * kernelx_data, int kernelx_len,
|
||||
uchar * kernely_data, int kernely_len,
|
||||
int anchor_x, int anchor_y,
|
||||
double delta, int borderType);
|
||||
|
||||
CV_EXPORTS void morph(int op, int src_type, int dst_type,
|
||||
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,
|
||||
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);
|
||||
|
||||
|
||||
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);
|
||||
|
||||
//! Separate Y and UV planes
|
||||
CV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * y_data, const uchar * uv_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);
|
||||
|
||||
//! Separate Y and UV planes
|
||||
CV_EXPORTS void cvtBGRtoTwoPlaneYUV(const uchar * src_data, size_t src_step,
|
||||
uchar * y_data, uchar * uv_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
|
||||
46
include/opencv2/imgproc/hal/interface.h
Normal file
46
include/opencv2/imgproc/hal/interface.h
Normal file
@ -0,0 +1,46 @@
|
||||
#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 CV_HAL_MORPH_ERODE 0
|
||||
#define CV_HAL_MORPH_DILATE 1
|
||||
//! @}
|
||||
|
||||
//! @name Threshold types
|
||||
//! @sa cv::ThresholdTypes
|
||||
//! @{
|
||||
#define CV_HAL_THRESH_BINARY 0
|
||||
#define CV_HAL_THRESH_BINARY_INV 1
|
||||
#define CV_HAL_THRESH_TRUNC 2
|
||||
#define CV_HAL_THRESH_TOZERO 3
|
||||
#define CV_HAL_THRESH_TOZERO_INV 4
|
||||
#define CV_HAL_THRESH_MASK 7
|
||||
#define CV_HAL_THRESH_OTSU 8
|
||||
#define CV_HAL_THRESH_TRIANGLE 16
|
||||
//! @}
|
||||
|
||||
//! @name Adaptive threshold algorithm
|
||||
//! @sa cv::AdaptiveThresholdTypes
|
||||
//! @{
|
||||
#define CV_HAL_ADAPTIVE_THRESH_MEAN_C 0
|
||||
#define CV_HAL_ADAPTIVE_THRESH_GAUSSIAN_C 1
|
||||
//! @}
|
||||
|
||||
//! @}
|
||||
|
||||
#endif
|
||||
@ -40,8 +40,8 @@
|
||||
//
|
||||
//M*/
|
||||
|
||||
#ifndef __OPENCV_IMGPROC_IMGPROC_C_H__
|
||||
#define __OPENCV_IMGPROC_IMGPROC_C_H__
|
||||
#ifndef OPENCV_IMGPROC_IMGPROC_C_H
|
||||
#define OPENCV_IMGPROC_IMGPROC_C_H
|
||||
|
||||
#include "opencv2/imgproc/types_c.h"
|
||||
|
||||
@ -260,14 +260,14 @@ CVAPI(void) cvConvertMaps( const CvArr* mapx, const CvArr* mapy,
|
||||
CvArr* mapxy, CvArr* mapalpha );
|
||||
|
||||
/** @brief Performs forward or inverse log-polar image transform
|
||||
@see cv::logPolar
|
||||
@see cv::warpPolar
|
||||
*/
|
||||
CVAPI(void) cvLogPolar( const CvArr* src, CvArr* dst,
|
||||
CvPoint2D32f center, double M,
|
||||
int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS));
|
||||
|
||||
/** Performs forward or inverse linear-polar image transform
|
||||
@see cv::linearPolar
|
||||
@see cv::warpPolar
|
||||
*/
|
||||
CVAPI(void) cvLinearPolar( const CvArr* src, CvArr* dst,
|
||||
CvPoint2D32f center, double maxRadius,
|
||||
@ -982,7 +982,6 @@ CVAPI(void) cvFitLine( const CvArr* points, int dist_type, double param,
|
||||
* If a drawn figure is partially or completely outside of the image, it is clipped.*
|
||||
\****************************************************************************************/
|
||||
|
||||
#define CV_RGB( r, g, b ) cvScalar( (b), (g), (r), 0 )
|
||||
#define CV_FILLED -1
|
||||
|
||||
#define CV_AA 16
|
||||
@ -1037,9 +1036,10 @@ CV_INLINE void cvEllipseBox( CvArr* img, CvBox2D box, CvScalar color,
|
||||
int thickness CV_DEFAULT(1),
|
||||
int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) )
|
||||
{
|
||||
CvSize axes;
|
||||
axes.width = cvRound(box.size.width*0.5);
|
||||
axes.height = cvRound(box.size.height*0.5);
|
||||
CvSize axes = cvSize(
|
||||
cvRound(box.size.width*0.5),
|
||||
cvRound(box.size.height*0.5)
|
||||
);
|
||||
|
||||
cvEllipse( img, cvPointFrom32f( box.center ), axes, box.angle,
|
||||
0, 360, color, thickness, line_type, shift );
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -349,7 +349,17 @@ enum
|
||||
CV_BayerRG2RGB_EA = CV_BayerBG2BGR_EA,
|
||||
CV_BayerGR2RGB_EA = CV_BayerGB2BGR_EA,
|
||||
|
||||
CV_COLORCVT_MAX = 139
|
||||
CV_BayerBG2BGRA =139,
|
||||
CV_BayerGB2BGRA =140,
|
||||
CV_BayerRG2BGRA =141,
|
||||
CV_BayerGR2BGRA =142,
|
||||
|
||||
CV_BayerBG2RGBA =CV_BayerRG2BGRA,
|
||||
CV_BayerGB2RGBA =CV_BayerGR2BGRA,
|
||||
CV_BayerRG2RGBA =CV_BayerBG2BGRA,
|
||||
CV_BayerGR2RGBA =CV_BayerGB2BGRA,
|
||||
|
||||
CV_COLORCVT_MAX = 143
|
||||
};
|
||||
|
||||
|
||||
@ -400,7 +410,7 @@ typedef struct CvMoments
|
||||
double mu20, mu11, mu02, mu30, mu21, mu12, mu03; /**< central moments */
|
||||
double inv_sqrt_m00; /**< m00 != 0 ? 1/sqrt(m00) : 0 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)
|
||||
CvMoments(){}
|
||||
CvMoments(const cv::Moments& m)
|
||||
{
|
||||
@ -420,6 +430,36 @@ typedef struct CvMoments
|
||||
}
|
||||
CvMoments;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
CV_INLINE CvMoments cvMoments()
|
||||
{
|
||||
#if !defined(CV__ENABLE_C_API_CTORS)
|
||||
CvMoments self = CV_STRUCT_INITIALIZER; return self;
|
||||
#else
|
||||
return CvMoments();
|
||||
#endif
|
||||
}
|
||||
|
||||
CV_INLINE CvMoments cvMoments(const cv::Moments& m)
|
||||
{
|
||||
#if !defined(CV__ENABLE_C_API_CTORS)
|
||||
double am00 = std::abs(m.m00);
|
||||
CvMoments self = {
|
||||
m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03,
|
||||
m.mu20, m.mu11, m.mu02, m.mu30, m.mu21, m.mu12, m.mu03,
|
||||
am00 > DBL_EPSILON ? 1./std::sqrt(am00) : 0
|
||||
};
|
||||
return self;
|
||||
#else
|
||||
return CvMoments(m);
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/** Hu invariants */
|
||||
typedef struct CvHuMoments
|
||||
{
|
||||
@ -491,15 +531,8 @@ enum
|
||||
CV_POLY_APPROX_DP = 0
|
||||
};
|
||||
|
||||
/** @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
|
||||
/** Shape matching methods */
|
||||
enum
|
||||
{
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user