Skip to content

Commit

Permalink
Update OpenCV.framework r7286
Browse files Browse the repository at this point in the history
  • Loading branch information
Abai committed Feb 13, 2012
1 parent 4a3b25d commit b9f6681
Show file tree
Hide file tree
Showing 35 changed files with 2,524 additions and 436 deletions.
24 changes: 18 additions & 6 deletions OpenCV.framework/Headers/opencv2/calib3d/calib3d.hpp
Expand Up @@ -86,6 +86,13 @@ CVAPI(void) cvConvertPointsHomogeneous( const CvMat* src, CvMat* dst );
#define CV_FM_RANSAC_ONLY CV_RANSAC
#define CV_FM_LMEDS CV_LMEDS
#define CV_FM_RANSAC CV_RANSAC

enum
{
CV_ITERATIVE = 0,
CV_EPNP = 1, // F.Moreno-Noguer, V.Lepetit and P.Fua "EPnP: Efficient Perspective-n-Point Camera Pose Estimation"
CV_P3P = 2 // X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang; "Complete Solution Classification for the Perspective-Three-Point Problem"
};

CVAPI(int) cvFindFundamentalMat( const CvMat* points1, const CvMat* points2,
CvMat* fundamental_matrix,
Expand Down Expand Up @@ -393,7 +400,6 @@ CVAPI(void) cvReprojectImageTo3D( const CvArr* disparityImage,
}

//////////////////////////////////////////////////////////////////////////////////////////

class CV_EXPORTS CvLevMarq
{
public:
Expand Down Expand Up @@ -432,7 +438,6 @@ class CV_EXPORTS CvLevMarq

namespace cv
{

//! converts rotation vector to rotation matrix or vice versa using Rodrigues transformation
CV_EXPORTS_W void Rodrigues(InputArray src, OutputArray dst, OutputArray jacobian=noArray());

Expand Down Expand Up @@ -489,10 +494,16 @@ CV_EXPORTS_W void projectPoints( InputArray objectPoints,
double aspectRatio=0 );

//! computes the camera pose from a few 3D points and the corresponding projections. The outliers are not handled.
CV_EXPORTS_W void solvePnP( InputArray objectPoints, InputArray imagePoints,
enum
{
ITERATIVE=CV_ITERATIVE,
EPNP=CV_EPNP,
P3P=CV_P3P
};
CV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints,
InputArray cameraMatrix, InputArray distCoeffs,
OutputArray rvec, OutputArray tvec,
bool useExtrinsicGuess=false );
bool useExtrinsicGuess=false, int flags=0);

//! computes the camera pose from a few 3D points and the corresponding projections. The outliers are possible.
CV_EXPORTS_W void solvePnPRansac( InputArray objectPoints,
Expand All @@ -501,11 +512,12 @@ CV_EXPORTS_W void solvePnPRansac( InputArray objectPoints,
InputArray distCoeffs,
OutputArray rvec,
OutputArray tvec,
bool useExtrinsicGuess = false,
bool useExtrinsicGuess = false,
int iterationsCount = 100,
float reprojectionError = 8.0,
int minInliersCount = 100,
OutputArray inliers = noArray() );
OutputArray inliers = noArray(),
int flags = 0);

//! initializes camera matrix from a few 3D points and the corresponding projections.
CV_EXPORTS_W Mat initCameraMatrix2D( InputArrayOfArrays objectPoints,
Expand Down
16 changes: 15 additions & 1 deletion OpenCV.framework/Headers/opencv2/contrib/retina.hpp
Expand Up @@ -165,6 +165,16 @@ class CV_EXPORTS Retina {

virtual ~Retina();

/**
* retreive retina input buffer size
*/
Size inputSize();

/**
* retreive retina output buffer size
*/
Size outputSize();

/**
* try to open an XML retina parameters file to adjust current retina instance setup
* => if the xml file does not exist, then default setup is applied
Expand Down Expand Up @@ -278,6 +288,10 @@ class CV_EXPORTS Retina {
*/
void getMagno(std::valarray<float> &retinaOutput_magno);

// original API level data accessors : get buffers addresses...
const std::valarray<float> & getMagno() const;
const std::valarray<float> & getParvo() const;

/**
* activate color saturation as the final step of the color demultiplexing process
* -> this saturation is a sigmoide function applied to each channel of the demultiplexed image.
Expand Down Expand Up @@ -329,7 +343,7 @@ class CV_EXPORTS Retina {
* @param outputValarrayMatrix : the output valarray
* @return the input image color mode (color=true, gray levels=false)
*/
const bool _convertCvMat2ValarrayBuffer(const cv::Mat inputMatToConvert, std::valarray<float> &outputValarrayMatrix);
bool _convertCvMat2ValarrayBuffer(const cv::Mat inputMatToConvert, std::valarray<float> &outputValarrayMatrix);

//! private method called by constructors, gathers their parameters and use them in a unified way
void _init(const Size inputSize, const bool colorMode, RETINA_COLORSAMPLINGMETHOD colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);
Expand Down
198 changes: 159 additions & 39 deletions OpenCV.framework/Headers/opencv2/core/core.hpp
Expand Up @@ -61,6 +61,7 @@
#include <new>
#include <string>
#include <vector>
#include <sstream>
#endif // SKIP_INCLUDES

/*! \namespace cv
Expand Down Expand Up @@ -90,6 +91,11 @@ class Mat;
class SparseMat;
typedef Mat MatND;

class GlBuffer;
class GlTexture;
class GlArrays;
class GlCamera;

namespace gpu {
class GpuMat;
}
Expand Down Expand Up @@ -984,7 +990,6 @@ template<typename _Tp> class DataType
typedef value_type work_type;
typedef value_type channel_type;
typedef value_type vec_type;

enum { generic_type = 1, depth = -1, channels = 1, fmt=0,
type = CV_MAKETYPE(depth, channels) };
};
Expand Down Expand Up @@ -1204,7 +1209,6 @@ template<> class DataType<Range>
type = CV_MAKETYPE(depth, channels) };
typedef Vec<channel_type, channels> vec_type;
};


//////////////////// generic_type ref-counting pointer class for C/C++ objects ////////////////////////

Expand Down Expand Up @@ -1251,6 +1255,9 @@ template<typename _Tp> class CV_EXPORTS Ptr
//! returns true iff obj==NULL
bool empty() const;

//! cast pointer to another type
template<typename _Tp2> Ptr<_Tp2> ptr();
template<typename _Tp2> const Ptr<_Tp2> ptr() const;

//! helper operators making "Ptr<T> ptr" use very similar to "T* ptr".
_Tp* operator -> ();
Expand All @@ -1259,7 +1266,6 @@ template<typename _Tp> class CV_EXPORTS Ptr
operator _Tp* ();
operator const _Tp*() const;

protected:
_Tp* obj; //< the object pointer.
int* refcount; //< the associated reference counter
};
Expand All @@ -1273,10 +1279,19 @@ template<typename _Tp> class CV_EXPORTS Ptr
class CV_EXPORTS _InputArray
{
public:
enum { KIND_SHIFT=16, NONE=0<<KIND_SHIFT, MAT=1<<KIND_SHIFT,
MATX=2<<KIND_SHIFT, STD_VECTOR=3<<KIND_SHIFT,
STD_VECTOR_VECTOR=4<<KIND_SHIFT,
STD_VECTOR_MAT=5<<KIND_SHIFT, EXPR=6<<KIND_SHIFT };
enum {
KIND_SHIFT = 16,
NONE = 0 << KIND_SHIFT,
MAT = 1 << KIND_SHIFT,
MATX = 2 << KIND_SHIFT,
STD_VECTOR = 3 << KIND_SHIFT,
STD_VECTOR_VECTOR = 4 << KIND_SHIFT,
STD_VECTOR_MAT = 5 << KIND_SHIFT,
EXPR = 6 << KIND_SHIFT,
OPENGL_BUFFER = 7 << KIND_SHIFT,
OPENGL_TEXTURE = 8 << KIND_SHIFT,
GPU_MAT = 9 << KIND_SHIFT
};
_InputArray();
_InputArray(const Mat& m);
_InputArray(const MatExpr& expr);
Expand All @@ -1287,8 +1302,16 @@ class CV_EXPORTS _InputArray
template<typename _Tp, int m, int n> _InputArray(const Matx<_Tp, m, n>& matx);
_InputArray(const Scalar& s);
_InputArray(const double& val);
_InputArray(const GlBuffer& buf);
_InputArray(const GlTexture& tex);
_InputArray(const gpu::GpuMat& d_mat);

virtual Mat getMat(int i=-1) const;
virtual void getMatVector(vector<Mat>& mv) const;
virtual GlBuffer getGlBuffer() const;
virtual GlTexture getGlTexture() const;
virtual gpu::GpuMat getGpuMat() const;

virtual int kind() const;
virtual Size size(int i=-1) const;
virtual size_t total(int i=-1) const;
Expand Down Expand Up @@ -2132,6 +2155,12 @@ CV_EXPORTS_W void log(InputArray src, OutputArray dst);
CV_EXPORTS_W float cubeRoot(float val);
//! computes the angle in degrees (0..360) of the vector (x,y)
CV_EXPORTS_W float fastAtan2(float y, float x);

CV_EXPORTS void exp(const float* src, float* dst, int n);
CV_EXPORTS void log(const float* src, float* dst, int n);
CV_EXPORTS void fastAtan2(const float* y, const float* x, float* dst, int n, bool angleInDegrees);
CV_EXPORTS void magnitude(const float* x, const float* y, float* dst, int n);

//! converts polar coordinates to Cartesian
CV_EXPORTS_W void polarToCart(InputArray magnitude, InputArray angle,
OutputArray x, OutputArray y, bool angleInDegrees=false);
Expand Down Expand Up @@ -4197,54 +4226,145 @@ template<typename _Tp> class CV_EXPORTS SeqIterator : public CvSeqReader
};


#if 0
class CV_EXPORTS AlgorithmImpl;

class CV_EXPORTS Algorithm;
class CV_EXPORTS AlgorithmInfo;
struct CV_EXPORTS AlgorithmInfoData;

template<typename _Tp> struct ParamType {};

/*!
Base class for high-level OpenCV algorithms
*/
class CV_EXPORTS Algorithm
{
public:
Algorithm();
virtual ~Algorithm();
virtual string name() const;
string name() const;

template<typename _Tp> _Tp get(int paramId) const;
template<typename _Tp> bool set(int paramId, const _Tp& value);
string paramName(int paramId) const;
string paramHelp(int paramId) const;
int paramType(int paramId) const;
int findParam(const string& name) const;
template<typename _Tp> _Tp paramDefaultValue(int paramId) const;
template<typename _Tp> bool paramRange(int paramId, _Tp& minVal, _Tp& maxVal) const;
template<typename _Tp> typename ParamType<_Tp>::member_type get(const string& name) const;
template<typename _Tp> typename ParamType<_Tp>::member_type get(const char* name) const;
template<typename _Tp> void set(const string& name,
typename ParamType<_Tp>::const_param_type value);
template<typename _Tp> void set(const char* name,
typename ParamType<_Tp>::const_param_type value);
string paramHelp(const string& name) const;
int paramType(const char* name) const;
int paramType(const string& name) const;
void getParams(vector<string>& names) const;

virtual void getParams(vector<int>& ids) const;
virtual void write(vector<uchar>& buf) const;
virtual bool read(const vector<uchar>& buf);

virtual void write(FileStorage& fs) const;
virtual void read(const FileNode& fn);

typedef Algorithm* (*Constructor)(void);
static void add(const string& name, Constructor create);
typedef int (Algorithm::*Getter)() const;
typedef void (Algorithm::*Setter)(int);

static void getList(vector<string>& algorithms);
static Ptr<Algorithm> create(const string& name);
static Ptr<Algorithm> _create(const string& name);
template<typename _Tp> static Ptr<_Tp> create(const string& name);

virtual AlgorithmInfo* info() const /* TODO: make it = 0;*/ { return 0; }
};


class CV_EXPORTS AlgorithmInfo
{
public:
AlgorithmInfo(const string& name, Algorithm::Constructor create);
~AlgorithmInfo();
void get(const Algorithm* algo, const char* name, int argType, void* value) const;
void set(Algorithm* algo, const char* name, int argType, const void* value) const;
void addParam_(const Algorithm* algo, const char* name, int argType,
const void* value, bool readOnly,
Algorithm::Getter getter, Algorithm::Setter setter,
const string& help=string());
string paramHelp(const char* name) const;
int paramType(const char* name) const;
void getParams(vector<string>& names) const;

void write(const Algorithm* algo, FileStorage& fs) const;
void read(Algorithm* algo, const FileNode& fn) const;
string name() const;

template<typename _Tp> void addParam(const Algorithm* algo, const char* name,
const typename ParamType<_Tp>::member_type& value,
bool readOnly=false,
typename ParamType<_Tp>::member_type (Algorithm::*getter)()=0,
void (Algorithm::*setter)(typename ParamType<_Tp>::const_param_type)=0,
const string& help=string());
protected:
template<typename _Tp> void addParam(int propId, _Tp& value, bool readOnly, const string& name,
const string& help=string(), const _Tp& defaultValue=_Tp(),
_Tp (Algorithm::*getter)()=0, bool (Algorithm::*setter)(const _Tp&)=0);
template<typename _Tp> void setParamRange(int propId, const _Tp& minVal, const _Tp& maxVal);

bool set_(int paramId, int argType, const void* value);
void get_(int paramId, int argType, void* value);
void paramDefaultValue_(int paramId, int argType, void* value);
void paramRange_(int paramId, int argType, void* minval, void* maxval);
void addParam_(int propId, int argType, void* value, bool readOnly, const string& name,
const string& help, const void* defaultValue, void* getter, void* setter);
void setParamRange_(int propId, int argType, const void* minVal, const void* maxVal);

Ptr<AlgorithmImpl> impl;
AlgorithmInfoData* data;
};


struct CV_EXPORTS Param
{
enum { INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, ALGORITHM=5 };

Param();
Param(int _type, bool _readonly, int _offset,
Algorithm::Getter _getter=0,
Algorithm::Setter _setter=0,
const string& _help=string());
int type;
int offset;
bool readonly;
Algorithm::Getter getter;
Algorithm::Setter setter;
string help;
};
#endif

template<> struct ParamType<bool>
{
typedef bool const_param_type;
typedef bool member_type;

enum { type = Param::BOOLEAN };
};

template<> struct ParamType<int>
{
typedef int const_param_type;
typedef int member_type;

enum { type = Param::INT };
};

template<> struct ParamType<double>
{
typedef double const_param_type;
typedef double member_type;

enum { type = Param::REAL };
};

template<> struct ParamType<string>
{
typedef const string& const_param_type;
typedef string member_type;

enum { type = Param::STRING };
};

template<> struct ParamType<Mat>
{
typedef const Mat& const_param_type;
typedef Mat member_type;

enum { type = Param::MAT };
};

template<> struct ParamType<Algorithm>
{
typedef const Ptr<Algorithm>& const_param_type;
typedef Ptr<Algorithm> member_type;

enum { type = Param::ALGORITHM };
};


/*!
"\nThe CommandLineParser class is designed for command line arguments parsing\n"
"Keys map: \n"
Expand Down
3 changes: 2 additions & 1 deletion OpenCV.framework/Headers/opencv2/core/eigen.hpp
Expand Up @@ -45,7 +45,8 @@

#ifdef __cplusplus

#include "cxcore.h"
#include <OpenCV/opencv2/core/core_c.h>
#include <OpenCV/opencv2/core/core.hpp>

namespace cv
{
Expand Down

0 comments on commit b9f6681

Please sign in to comment.