eliminated opencv_extra_api.hpp (all the functionality is moved to the regular OpenCV headers)
This commit is contained in:
@@ -216,7 +216,7 @@ CV_EXPORTS int getThreadNum();
|
||||
before and after the function call. The granularity of ticks depends on the hardware and OS used. Use
|
||||
cv::getTickFrequency() to convert ticks to seconds.
|
||||
*/
|
||||
CV_EXPORTS int64 getTickCount();
|
||||
CV_EXPORTS_W int64 getTickCount();
|
||||
|
||||
/*!
|
||||
Returns the number of ticks per seconds.
|
||||
@@ -240,7 +240,7 @@ CV_EXPORTS_W double getTickFrequency();
|
||||
one can accurately measure the execution time of very small code fragments,
|
||||
for which cv::getTickCount() granularity is not enough.
|
||||
*/
|
||||
CV_EXPORTS int64 getCPUTickCount();
|
||||
CV_EXPORTS_W int64 getCPUTickCount();
|
||||
|
||||
/*!
|
||||
Returns SSE etc. support status
|
||||
@@ -1327,6 +1327,7 @@ typedef InputArray InputArrayOfArrays;
|
||||
typedef const _OutputArray& OutputArray;
|
||||
typedef OutputArray OutputArrayOfArrays;
|
||||
typedef OutputArray InputOutputArray;
|
||||
typedef OutputArray InputOutputArrayOfArrays;
|
||||
|
||||
CV_EXPORTS OutputArray noArray();
|
||||
|
||||
@@ -2038,6 +2039,8 @@ CV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts
|
||||
const int* fromTo, size_t npairs);
|
||||
CV_EXPORTS void mixChannels(const vector<Mat>& src, vector<Mat>& dst,
|
||||
const int* fromTo, size_t npairs);
|
||||
CV_EXPORTS_W void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
|
||||
const vector<int>& fromTo);
|
||||
|
||||
//! extracts a single channel from src (coi is 0-based index)
|
||||
CV_EXPORTS_W void extractChannel(InputArray src, OutputArray dst, int coi);
|
||||
@@ -2162,6 +2165,9 @@ CV_EXPORTS bool eigen(InputArray src, OutputArray eigenvalues, int lowindex=-1,
|
||||
CV_EXPORTS bool eigen(InputArray src, OutputArray eigenvalues,
|
||||
OutputArray eigenvectors,
|
||||
int lowindex=-1, int highindex=-1);
|
||||
CV_EXPORTS_W bool eigen(InputArray src, bool computeEigenvectors,
|
||||
OutputArray eigenvalues, OutputArray eigenvectors);
|
||||
|
||||
//! computes covariation matrix of a set of samples
|
||||
CV_EXPORTS void calcCovarMatrix( const Mat* samples, int nsamples, Mat& covar, Mat& mean,
|
||||
int flags, int ctype=CV_64F);
|
||||
@@ -2246,6 +2252,16 @@ public:
|
||||
Mat mean; //!< mean value subtracted before the projection and added after the back projection
|
||||
};
|
||||
|
||||
CV_EXPORTS_W void PCACompute(InputArray data, CV_OUT InputOutputArray mean,
|
||||
OutputArray eigenvectors, int maxComponents=0);
|
||||
|
||||
CV_EXPORTS_W void PCAProject(InputArray data, InputArray mean,
|
||||
InputArray eigenvectors, OutputArray result);
|
||||
|
||||
CV_EXPORTS_W void PCABackProject(InputArray data, InputArray mean,
|
||||
InputArray eigenvectors, OutputArray result);
|
||||
|
||||
|
||||
/*!
|
||||
Singular Value Decomposition class
|
||||
|
||||
@@ -2295,6 +2311,14 @@ public:
|
||||
Mat u, w, vt;
|
||||
};
|
||||
|
||||
//! computes SVD of src
|
||||
CV_EXPORTS_W void SVDecomp( InputArray src, CV_OUT OutputArray w,
|
||||
CV_OUT OutputArray u, CV_OUT OutputArray vt, int flags=0 );
|
||||
|
||||
//! performs back substitution for the previously computed SVD
|
||||
CV_EXPORTS_W void SVBackSubst( InputArray w, InputArray u, InputArray vt,
|
||||
InputArray rhs, CV_OUT OutputArray dst );
|
||||
|
||||
//! computes Mahalanobis distance between two vectors: sqrt((v1-v2)'*icovar*(v1-v2)), where icovar is the inverse covariation matrix
|
||||
CV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar);
|
||||
//! a synonym for Mahalanobis
|
||||
@@ -2342,6 +2366,7 @@ CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev
|
||||
|
||||
//! shuffles the input array elements
|
||||
CV_EXPORTS void randShuffle(InputOutputArray dst, double iterFactor=1., RNG* rng=0);
|
||||
CV_EXPORTS_AS(randShuffle) void randShuffle_(InputOutputArray dst, double iterFactor=1.);
|
||||
|
||||
//! draws the line segment (pt1, pt2) in the image
|
||||
CV_EXPORTS_W void line(Mat& img, Point pt1, Point pt2, const Scalar& color,
|
||||
@@ -2376,6 +2401,9 @@ CV_EXPORTS_W void ellipse(Mat& img, const RotatedRect& box, const Scalar& color,
|
||||
CV_EXPORTS void fillConvexPoly(Mat& img, const Point* pts, int npts,
|
||||
const Scalar& color, int lineType=8,
|
||||
int shift=0);
|
||||
CV_EXPORTS_W void fillConvexPoly(InputOutputArray img, InputArray points,
|
||||
const Scalar& color, int lineType=8,
|
||||
int shift=0);
|
||||
|
||||
//! fills an area bounded by one or more polygons
|
||||
CV_EXPORTS void fillPoly(Mat& img, const Point** pts,
|
||||
@@ -2383,11 +2411,19 @@ CV_EXPORTS void fillPoly(Mat& img, const Point** pts,
|
||||
const Scalar& color, int lineType=8, int shift=0,
|
||||
Point offset=Point() );
|
||||
|
||||
CV_EXPORTS_W void fillPoly(InputOutputArray img, InputArrayOfArrays pts,
|
||||
const Scalar& color, int lineType=8, int shift=0,
|
||||
Point offset=Point() );
|
||||
|
||||
//! draws one or more polygonal curves
|
||||
CV_EXPORTS void polylines(Mat& img, const Point** pts, const int* npts,
|
||||
int ncontours, bool isClosed, const Scalar& color,
|
||||
int thickness=1, int lineType=8, int shift=0 );
|
||||
|
||||
CV_EXPORTS_W void polylines(InputOutputArray, InputArrayOfArrays pts,
|
||||
bool isClosed, const Scalar& color,
|
||||
int thickness=1, int lineType=8, int shift=0 );
|
||||
|
||||
//! clips the line segment by the rectangle Rect(0, 0, imgSize.width, imgSize.height)
|
||||
CV_EXPORTS bool clipLine(Size imgSize, CV_IN_OUT Point& pt1, CV_IN_OUT Point& pt2);
|
||||
|
||||
|
||||
@@ -503,6 +503,22 @@ void cv::mixChannels(const vector<Mat>& src, vector<Mat>& dst,
|
||||
!dst.empty() ? &dst[0] : 0, dst.size(), fromTo, npairs);
|
||||
}
|
||||
|
||||
void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
|
||||
const vector<int>& fromTo)
|
||||
{
|
||||
if(fromTo.empty())
|
||||
return;
|
||||
size_t i, nsrc = src.total(), ndst = dst.total();
|
||||
CV_Assert(fromTo.size()%2 == 0 && nsrc > 0 && ndst > 0);
|
||||
cv::AutoBuffer<Mat> _buf(nsrc + ndst);
|
||||
Mat* buf = _buf;
|
||||
for( i = 0; i < nsrc; i++ )
|
||||
buf[i] = src.getMat(i);
|
||||
for( i = 0; i < ndst; i++ )
|
||||
buf[nsrc + i] = dst.getMat(i);
|
||||
mixChannels(&buf[0], (int)nsrc, &buf[nsrc], (int)ndst, &fromTo[0], (int)(fromTo.size()/2));
|
||||
}
|
||||
|
||||
void cv::extractChannel(InputArray _src, OutputArray _dst, int coi)
|
||||
{
|
||||
Mat src = _src.getMat();
|
||||
|
||||
@@ -2012,6 +2012,63 @@ Size getTextSize( const string& text, int fontFace, double fontScale, int thickn
|
||||
|
||||
}
|
||||
|
||||
|
||||
void cv::fillConvexPoly(InputOutputArray _img, InputArray _points,
|
||||
const Scalar& color, int lineType, int shift)
|
||||
{
|
||||
Mat img = _img.getMat(), points = _points.getMat();
|
||||
CV_Assert(points.checkVector(2, CV_32S) >= 0);
|
||||
fillConvexPoly(img, (const Point*)points.data, points.rows*points.cols*points.channels()/2, color, lineType, shift);
|
||||
}
|
||||
|
||||
|
||||
void cv::fillPoly(InputOutputArray _img, InputArrayOfArrays pts,
|
||||
const Scalar& color, int lineType, int shift, Point offset)
|
||||
{
|
||||
Mat img = _img.getMat();
|
||||
size_t i, ncontours = pts.total();
|
||||
if( ncontours == 0 )
|
||||
return;
|
||||
AutoBuffer<Point*> _ptsptr(ncontours);
|
||||
AutoBuffer<int> _npts(ncontours);
|
||||
Point** ptsptr = _ptsptr;
|
||||
int* npts = _npts;
|
||||
|
||||
for( i = 0; i < ncontours; i++ )
|
||||
{
|
||||
Mat p = pts.getMat(i);
|
||||
CV_Assert(p.checkVector(2, CV_32S) >= 0);
|
||||
ptsptr[i] = (Point*)p.data;
|
||||
npts[i] = p.rows*p.cols*p.channels()/2;
|
||||
}
|
||||
fillPoly(img, (const Point**)ptsptr, npts, (int)ncontours, color, lineType, shift, offset);
|
||||
}
|
||||
|
||||
|
||||
void cv::polylines(InputOutputArray _img, InputArrayOfArrays pts,
|
||||
bool isClosed, const Scalar& color,
|
||||
int thickness, int lineType, int shift )
|
||||
{
|
||||
Mat img = _img.getMat();
|
||||
size_t i, ncontours = pts.total();
|
||||
if( ncontours == 0 )
|
||||
return;
|
||||
AutoBuffer<Point*> _ptsptr(ncontours);
|
||||
AutoBuffer<int> _npts(ncontours);
|
||||
Point** ptsptr = _ptsptr;
|
||||
int* npts = _npts;
|
||||
|
||||
for( i = 0; i < ncontours; i++ )
|
||||
{
|
||||
Mat p = pts.getMat(i);
|
||||
CV_Assert(p.checkVector(2, CV_32S) >= 0);
|
||||
ptsptr[i] = (Point*)p.data;
|
||||
npts[i] = p.rows*p.cols*p.channels()/2;
|
||||
}
|
||||
polylines(img, (const Point**)ptsptr, npts, (int)ncontours, isClosed, color, thickness, lineType, shift);
|
||||
}
|
||||
|
||||
|
||||
static const int CodeDeltas[8][2] =
|
||||
{ {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}, {0, 1}, {1, 1} };
|
||||
|
||||
|
||||
@@ -1398,10 +1398,7 @@ bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int meth
|
||||
|
||||
/////////////////// finding eigenvalues and eigenvectors of a symmetric matrix ///////////////
|
||||
|
||||
namespace cv
|
||||
{
|
||||
|
||||
static bool eigen( InputArray _src, OutputArray _evals, OutputArray _evects, bool computeEvects, int, int )
|
||||
bool cv::eigen( InputArray _src, bool computeEvects, OutputArray _evals, OutputArray _evects )
|
||||
{
|
||||
Mat src = _src.getMat();
|
||||
int type = src.type();
|
||||
@@ -1431,17 +1428,14 @@ static bool eigen( InputArray _src, OutputArray _evals, OutputArray _evects, boo
|
||||
return ok;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool cv::eigen( InputArray src, OutputArray evals, int lowindex, int highindex )
|
||||
bool cv::eigen( InputArray src, OutputArray evals, int, int )
|
||||
{
|
||||
return eigen(src, evals, noArray(), false, lowindex, highindex);
|
||||
return eigen(src, false, evals, noArray());
|
||||
}
|
||||
|
||||
bool cv::eigen( InputArray src, OutputArray evals, OutputArray evects,
|
||||
int lowindex, int highindex )
|
||||
bool cv::eigen( InputArray src, OutputArray evals, OutputArray evects, int, int)
|
||||
{
|
||||
return eigen(src, evals, evects, true, lowindex, highindex);
|
||||
return eigen(src, true, evals, evects);
|
||||
}
|
||||
|
||||
namespace cv
|
||||
@@ -1568,6 +1562,17 @@ void SVD::backSubst( InputArray rhs, OutputArray dst ) const
|
||||
}
|
||||
|
||||
|
||||
void cv::SVDecomp(InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags)
|
||||
{
|
||||
SVD::compute(src, w, u, vt, flags);
|
||||
}
|
||||
|
||||
void cv::SVBackSubst(InputArray w, InputArray u, InputArray vt, InputArray rhs, OutputArray dst)
|
||||
{
|
||||
SVD::backSubst(w, u, vt, rhs, dst);
|
||||
}
|
||||
|
||||
|
||||
CV_IMPL double
|
||||
cvDet( const CvArr* arr )
|
||||
{
|
||||
|
||||
@@ -2884,6 +2884,34 @@ Mat PCA::backProject(InputArray data) const
|
||||
|
||||
}
|
||||
|
||||
void cv::PCACompute(InputArray data, InputOutputArray mean,
|
||||
OutputArray eigenvectors, int maxComponents)
|
||||
{
|
||||
PCA pca;
|
||||
pca(data, mean, 0, maxComponents);
|
||||
pca.mean.copyTo(mean);
|
||||
pca.eigenvectors.copyTo(eigenvectors);
|
||||
}
|
||||
|
||||
void cv::PCAProject(InputArray data, InputArray mean,
|
||||
InputArray eigenvectors, OutputArray result)
|
||||
{
|
||||
PCA pca;
|
||||
pca.mean = mean.getMat();
|
||||
pca.eigenvectors = eigenvectors.getMat();
|
||||
pca.project(data, result);
|
||||
}
|
||||
|
||||
void cv::PCABackProject(InputArray data, InputArray mean,
|
||||
InputArray eigenvectors, OutputArray result)
|
||||
{
|
||||
PCA pca;
|
||||
pca.mean = mean.getMat();
|
||||
pca.eigenvectors = eigenvectors.getMat();
|
||||
pca.backProject(data, result);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************************\
|
||||
* Earlier API *
|
||||
\****************************************************************************************/
|
||||
|
||||
@@ -812,6 +812,11 @@ void cv::randShuffle( InputOutputArray _dst, double iterFactor, RNG* _rng )
|
||||
func( dst, rng, iterFactor );
|
||||
}
|
||||
|
||||
void cv::randShuffle_( InputOutputArray _dst, double iterFactor )
|
||||
{
|
||||
randShuffle(_dst, iterFactor);
|
||||
}
|
||||
|
||||
CV_IMPL void
|
||||
cvRandArr( CvRNG* _rng, CvArr* arr, int disttype, CvScalar param1, CvScalar param2 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user