2010-05-12 01:44:00 +08:00
|
|
|
/*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*/
|
|
|
|
|
2010-06-29 23:12:07 +08:00
|
|
|
#ifndef __OPENCV_PRECOMP_H__
|
|
|
|
#define __OPENCV_PRECOMP_H__
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2013-03-13 20:22:44 +08:00
|
|
|
#include "opencv2/imgproc.hpp"
|
2013-03-15 00:10:54 +08:00
|
|
|
#include "opencv2/core/utility.hpp"
|
2013-04-10 19:54:14 +08:00
|
|
|
|
|
|
|
#include "opencv2/imgproc/imgproc_c.h"
|
2013-04-01 21:29:10 +08:00
|
|
|
#include "opencv2/core/private.hpp"
|
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
#include <math.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <float.h>
|
|
|
|
|
2011-05-12 23:22:55 +08:00
|
|
|
#ifdef HAVE_TEGRA_OPTIMIZATION
|
|
|
|
#include "opencv2/imgproc/imgproc_tegra.hpp"
|
2011-12-27 19:32:56 +08:00
|
|
|
#else
|
|
|
|
#define GET_OPTIMIZED(func) (func)
|
2011-05-12 23:22:55 +08:00
|
|
|
#endif
|
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
/* helper tables */
|
|
|
|
extern const uchar icvSaturate8u_cv[];
|
|
|
|
#define CV_FAST_CAST_8U(t) (assert(-256 <= (t) || (t) <= 512), icvSaturate8u_cv[(t)+256])
|
|
|
|
#define CV_CALC_MIN_8U(a,b) (a) -= CV_FAST_CAST_8U((a) - (b))
|
|
|
|
#define CV_CALC_MAX_8U(a,b) (a) += CV_FAST_CAST_8U((b) - (a))
|
|
|
|
|
|
|
|
// -256.f ... 511.f
|
|
|
|
extern const float icv8x32fTab_cv[];
|
|
|
|
#define CV_8TO32F(x) icv8x32fTab_cv[(x)+256]
|
|
|
|
|
|
|
|
// (-128.f)^2 ... (255.f)^2
|
|
|
|
extern const float icv8x32fSqrTab[];
|
|
|
|
#define CV_8TO32F_SQR(x) icv8x32fSqrTab[(x)+128]
|
|
|
|
|
|
|
|
namespace cv
|
|
|
|
{
|
|
|
|
|
|
|
|
static inline Point normalizeAnchor( Point anchor, Size ksize )
|
|
|
|
{
|
|
|
|
if( anchor.x == -1 )
|
|
|
|
anchor.x = ksize.width/2;
|
|
|
|
if( anchor.y == -1 )
|
|
|
|
anchor.y = ksize.height/2;
|
|
|
|
CV_Assert( anchor.inside(Rect(0, 0, ksize.width, ksize.height)) );
|
|
|
|
return anchor;
|
|
|
|
}
|
|
|
|
|
2013-02-25 00:14:01 +08:00
|
|
|
void preprocess2DKernel( const Mat& kernel, std::vector<Point>& coords, std::vector<uchar>& coeffs );
|
2010-05-12 01:44:00 +08:00
|
|
|
void crossCorr( const Mat& src, const Mat& templ, Mat& dst,
|
2010-11-13 04:55:32 +08:00
|
|
|
Size corrsize, int ctype,
|
2010-05-12 01:44:00 +08:00
|
|
|
Point anchor=Point(0,0), double delta=0,
|
|
|
|
int borderType=BORDER_REFLECT_101 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct CvPyramid
|
|
|
|
{
|
|
|
|
uchar **ptr;
|
|
|
|
CvSize *sz;
|
|
|
|
double *rate;
|
|
|
|
int *step;
|
|
|
|
uchar *state;
|
|
|
|
int level;
|
|
|
|
}
|
|
|
|
CvPyramid;
|
|
|
|
|
|
|
|
#define CV_COPY( dst, src, len, idx ) \
|
|
|
|
for( (idx) = 0; (idx) < (len); (idx)++) (dst)[idx] = (src)[idx]
|
|
|
|
|
|
|
|
#define CV_SET( dst, val, len, idx ) \
|
|
|
|
for( (idx) = 0; (idx) < (len); (idx)++) (dst)[idx] = (val)
|
|
|
|
|
|
|
|
#undef CV_CALC_MIN
|
|
|
|
#define CV_CALC_MIN(a, b) if((a) > (b)) (a) = (b)
|
|
|
|
|
|
|
|
#undef CV_CALC_MAX
|
|
|
|
#define CV_CALC_MAX(a, b) if((a) < (b)) (a) = (b)
|
|
|
|
|
|
|
|
#include "_geom.h"
|
|
|
|
|
|
|
|
#endif /*__OPENCV_CV_INTERNAL_H_*/
|