mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
updated 3rd party libs: CLapack 3.1.1.1 => 3.2.1, zlib 1.2.3 => 1.2.5, libpng 1.2.x => 1.4.3, libtiff 3.7.x => 3.9.4. fixed many 64-bit related VS2010 warnings
This commit is contained in:
@@ -453,7 +453,7 @@ bool cv::Affine3DEstimator::checkSubset( const CvMat* ms1, int count )
|
||||
|
||||
int cv::estimateAffine3D(const Mat& from, const Mat& to, Mat& out, vector<uchar>& outliers, double param1, double param2)
|
||||
{
|
||||
size_t count = from.cols*from.rows*from.channels()/3;
|
||||
int count = from.cols*from.rows*from.channels()/3;
|
||||
|
||||
CV_Assert( count >= 4 && from.isContinuous() && to.isContinuous() &&
|
||||
from.depth() == CV_32F && to.depth() == CV_32F &&
|
||||
|
||||
@@ -106,7 +106,7 @@ static void prefilterNorm( const Mat& src, Mat& dst, int winsize, int ftzero, uc
|
||||
const int OFS = 256*5, TABSZ = OFS*2 + 256;
|
||||
uchar tab[TABSZ];
|
||||
const uchar* sptr = src.data;
|
||||
int srcstep = src.step;
|
||||
int srcstep = (int)src.step;
|
||||
Size size = src.size();
|
||||
|
||||
scale_g *= scale_s;
|
||||
@@ -274,11 +274,11 @@ static void findStereoCorrespondenceBM_SSE2( const Mat& left, const Mat& right,
|
||||
const uchar* rptr0 = right.data + rofs;
|
||||
const uchar *lptr, *lptr_sub, *rptr;
|
||||
short* dptr = (short*)disp.data;
|
||||
int sstep = left.step;
|
||||
int dstep = disp.step/sizeof(dptr[0]);
|
||||
int sstep = (int)left.step;
|
||||
int dstep = (int)(disp.step/sizeof(dptr[0]));
|
||||
int cstep = (height + dy0 + dy1)*ndisp;
|
||||
short costbuf = 0;
|
||||
int coststep = cost.data ? cost.step/sizeof(costbuf) : 0;
|
||||
int coststep = cost.data ? (int)(cost.step/sizeof(costbuf)) : 0;
|
||||
const int TABSZ = 256;
|
||||
uchar tab[TABSZ];
|
||||
const __m128i d0_8 = _mm_setr_epi16(0,1,2,3,4,5,6,7), dd_8 = _mm_set1_epi16(8);
|
||||
@@ -529,11 +529,11 @@ findStereoCorrespondenceBM( const Mat& left, const Mat& right,
|
||||
const uchar* rptr0 = right.data + rofs;
|
||||
const uchar *lptr, *lptr_sub, *rptr;
|
||||
short* dptr = (short*)disp.data;
|
||||
int sstep = left.step;
|
||||
int dstep = disp.step/sizeof(dptr[0]);
|
||||
int sstep = (int)left.step;
|
||||
int dstep = (int)(disp.step/sizeof(dptr[0]));
|
||||
int cstep = (height+dy0+dy1)*ndisp;
|
||||
int costbuf = 0;
|
||||
int coststep = cost.data ? cost.step/sizeof(costbuf) : 0;
|
||||
int coststep = cost.data ? (int)(cost.step/sizeof(costbuf)) : 0;
|
||||
const int TABSZ = 256;
|
||||
uchar tab[TABSZ];
|
||||
|
||||
|
||||
@@ -372,8 +372,8 @@ static void computeDisparitySGBM( const Mat& img1, const Mat& img2,
|
||||
width*(sizeof(CostType) + sizeof(DispType)) + 1024; // disp2cost + disp2
|
||||
|
||||
if( !buffer.data || !buffer.isContinuous() ||
|
||||
buffer.cols*buffer.rows*buffer.elemSize() < totalBufSize )
|
||||
buffer.create(1, totalBufSize, CV_8U);
|
||||
buffer.cols*buffer.rows*buffer.elemSize() < totalBufSize )
|
||||
buffer.create(1, (int)totalBufSize, CV_8U);
|
||||
|
||||
// summary cost over different (nDirs) directions
|
||||
CostType* Cbuf = (CostType*)alignPtr(buffer.data, ALIGN);
|
||||
@@ -828,10 +828,10 @@ void filterSpeckles( Mat& img, double _newval, int maxSpeckleSize, double _maxDi
|
||||
int width = img.cols, height = img.rows, npixels = width*height;
|
||||
size_t bufSize = npixels*(int)(sizeof(Point2s) + sizeof(int) + sizeof(uchar));
|
||||
if( !_buf.isContinuous() || !_buf.data || _buf.cols*_buf.rows*_buf.elemSize() < bufSize )
|
||||
_buf.create(1, bufSize, CV_8U);
|
||||
_buf.create(1, (int)bufSize, CV_8U);
|
||||
|
||||
uchar* buf = _buf.data;
|
||||
int i, j, dstep = img.step/sizeof(short);
|
||||
int i, j, dstep = (int)(img.step/sizeof(short));
|
||||
int* labels = (int*)buf;
|
||||
buf += npixels*sizeof(labels[0]);
|
||||
Point2s* wbuf = (Point2s*)buf;
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace cv
|
||||
Mat packRandomScaledSpins(bool separateScale = false, size_t xCount = 10, size_t yCount = 10) const;
|
||||
|
||||
size_t getSpinCount() const { return spinImages.rows; }
|
||||
Mat getSpinImage(size_t index) const { return spinImages.row(index); }
|
||||
Mat getSpinImage(size_t index) const { return spinImages.row((int)index); }
|
||||
const Point3f& getSpinVertex(size_t index) const { return mesh.vtx[subset[index]]; }
|
||||
const Point3f& getSpinNormal(size_t index) const { return mesh.normals[subset[index]]; }
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ CvAdaptiveSkinDetector::Histogram::~Histogram()
|
||||
|
||||
int CvAdaptiveSkinDetector::Histogram::findCoverageIndex(double surfaceToCover, int defaultValue)
|
||||
{
|
||||
float s = 0;
|
||||
double s = 0;
|
||||
for (int i = 0; i < HistogramSize; i++)
|
||||
{
|
||||
s += cvGetReal1D( fHistogram->bins, i );
|
||||
@@ -223,7 +223,7 @@ int CvAdaptiveSkinDetector::Histogram::findCoverageIndex(double surfaceToCover,
|
||||
|
||||
void CvAdaptiveSkinDetector::Histogram::findCurveThresholds(int &x1, int &x2, double percent)
|
||||
{
|
||||
float sum = 0;
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < HistogramSize; i++)
|
||||
{
|
||||
|
||||
@@ -984,8 +984,8 @@ void LevMarqSparse::bundleAdjust( vector<Point3d>& points, //positions of points
|
||||
const TermCriteria& criteria)
|
||||
//,enum{MOTION_AND_STRUCTURE,MOTION,STRUCTURE})
|
||||
{
|
||||
int num_points = points.size();
|
||||
int num_cameras = cameraMatrix.size();
|
||||
int num_points = (int)points.size();
|
||||
int num_cameras = (int)cameraMatrix.size();
|
||||
|
||||
CV_Assert( imagePoints.size() == (size_t)num_cameras &&
|
||||
visibility.size() == (size_t)num_cameras &&
|
||||
|
||||
@@ -89,10 +89,11 @@ bool is_smaller(const std::pair<int, float>& p1, const std::pair<int, float>& p2
|
||||
void orderContours(const vector<vector<Point> >& contours, Point2f point, vector<std::pair<int, float> >& order)
|
||||
{
|
||||
order.clear();
|
||||
for(size_t i = 0; i < contours.size(); i++)
|
||||
int i, j, n = (int)contours.size();
|
||||
for(i = 0; i < n; i++)
|
||||
{
|
||||
double min_dist = std::numeric_limits<double>::max();
|
||||
for(size_t j = 0; j < contours[i].size(); j++)
|
||||
for(j = 0; j < n; j++)
|
||||
{
|
||||
double dist = norm(Point2f((float)contours[i][j].x, (float)contours[i][j].y) - point);
|
||||
min_dist = MIN(min_dist, dist);
|
||||
@@ -137,7 +138,7 @@ void findCorner(const vector<Point>& contour, Point2f point, Point2f& corner)
|
||||
if(dist < min_dist)
|
||||
{
|
||||
min_dist = dist;
|
||||
min_idx = i;
|
||||
min_idx = (int)i;
|
||||
}
|
||||
}
|
||||
assert(min_idx >= 0);
|
||||
@@ -162,7 +163,7 @@ void findCorner(const vector<Point2f>& contour, Point2f point, Point2f& corner)
|
||||
if(dist < min_dist)
|
||||
{
|
||||
min_dist = dist;
|
||||
min_idx = i;
|
||||
min_idx = (int)i;
|
||||
}
|
||||
}
|
||||
assert(min_idx >= 0);
|
||||
|
||||
@@ -124,7 +124,7 @@ Size SelfSimDescriptor::getGridSize( Size imgSize, Size winStride ) const
|
||||
void SelfSimDescriptor::SSD(const Mat& img, Point pt, Mat& ssd) const
|
||||
{
|
||||
int x, y, dx, dy, r0 = largeSize/2, r1 = smallSize/2;
|
||||
int step = img.step;
|
||||
int step = (int)img.step;
|
||||
for( y = -r0; y <= r0; y++ )
|
||||
{
|
||||
float* sptr = ssd.ptr<float>(y+r0) + r0;
|
||||
|
||||
@@ -447,7 +447,7 @@ float cv::Mesh3D::estimateResolution(float tryRatio)
|
||||
size_t tryNum = static_cast<size_t>(tryRatio * vtx.size());
|
||||
tryNum = min(max(tryNum, minReasonable), vtx.size());
|
||||
|
||||
CvMat desc = cvMat(vtx.size(), 3, CV_32F, &vtx[0]);
|
||||
CvMat desc = cvMat((int)vtx.size(), 3, CV_32F, &vtx[0]);
|
||||
CvFeatureTree* tr = cvCreateKDTree(&desc);
|
||||
|
||||
vector<double> dist(tryNum * neighbors);
|
||||
@@ -458,9 +458,9 @@ float cv::Mesh3D::estimateResolution(float tryRatio)
|
||||
for(size_t i = 0; i < tryNum; ++i)
|
||||
query.push_back(vtx[rng.next() % vtx.size()]);
|
||||
|
||||
CvMat cvinds = cvMat( tryNum, neighbors, CV_32S, &inds[0] );
|
||||
CvMat cvdist = cvMat( tryNum, neighbors, CV_64F, &dist[0] );
|
||||
CvMat cvquery = cvMat( tryNum, 3, CV_32F, &query[0] );
|
||||
CvMat cvinds = cvMat( (int)tryNum, neighbors, CV_32S, &inds[0] );
|
||||
CvMat cvdist = cvMat( (int)tryNum, neighbors, CV_64F, &dist[0] );
|
||||
CvMat cvquery = cvMat( (int)tryNum, 3, CV_32F, &query[0] );
|
||||
cvFindFeatures(tr, &cvquery, &cvinds, &cvdist, neighbors, 50);
|
||||
cvReleaseFeatureTree(tr);
|
||||
|
||||
@@ -753,7 +753,7 @@ Mat cv::SpinImageModel::packRandomScaledSpins(bool separateScale, size_t xCount,
|
||||
|
||||
int sz = spins.front().cols;
|
||||
|
||||
Mat result(yCount * sz + (yCount - 1), xCount * sz + (xCount - 1), CV_8UC3);
|
||||
Mat result((int)(yCount * sz + (yCount - 1)), (int)(xCount * sz + (xCount - 1)), CV_8UC3);
|
||||
result = colors[(static_cast<int64>(cvGetTickCount()/cvGetTickFrequency())/1000) % colors_mum];
|
||||
|
||||
size_t pos = 0;
|
||||
@@ -761,11 +761,11 @@ Mat cv::SpinImageModel::packRandomScaledSpins(bool separateScale, size_t xCount,
|
||||
for(size_t x = 0; x < xCount; ++x)
|
||||
if (pos < num)
|
||||
{
|
||||
int starty = (y + 0) * sz + y;
|
||||
int endy = (y + 1) * sz + y;
|
||||
int starty = (int)((y + 0) * sz + y);
|
||||
int endy = (int)((y + 1) * sz + y);
|
||||
|
||||
int startx = (x + 0) * sz + x;
|
||||
int endx = (x + 1) * sz + x;
|
||||
int startx = (int)((x + 0) * sz + x);
|
||||
int endx = (int)((x + 1) * sz + x);
|
||||
|
||||
Mat color;
|
||||
cvtColor(spins[pos++], color, CV_GRAY2BGR);
|
||||
@@ -802,7 +802,7 @@ void cv::SpinImageModel::selectRandomSubset(float ratio)
|
||||
for(size_t i = 0; i < setSize; ++i)
|
||||
{
|
||||
int pos = rnd.next() % left.size();
|
||||
subset[i] = left[pos];
|
||||
subset[i] = (int)left[pos];
|
||||
|
||||
left[pos] = left.back();
|
||||
left.resize(left.size() - 1);
|
||||
@@ -821,14 +821,14 @@ void cv::SpinImageModel::repackSpinImages(const vector<uchar>& mask, Mat& spinIm
|
||||
if (reAlloc)
|
||||
{
|
||||
size_t spinCount = mask.size() - count(mask.begin(), mask.end(), (uchar)0);
|
||||
Mat newImgs(spinCount, spinImages.cols, spinImages.type());
|
||||
Mat newImgs((int)spinCount, spinImages.cols, spinImages.type());
|
||||
|
||||
int pos = 0;
|
||||
for(size_t t = 0; t < mask.size(); ++t)
|
||||
if (mask[t])
|
||||
{
|
||||
Mat row = newImgs.row(pos++);
|
||||
spinImages.row(t).copyTo(row);
|
||||
spinImages.row((int)t).copyTo(row);
|
||||
}
|
||||
spinImages = newImgs;
|
||||
}
|
||||
@@ -836,7 +836,7 @@ void cv::SpinImageModel::repackSpinImages(const vector<uchar>& mask, Mat& spinIm
|
||||
{
|
||||
int last = (int)mask.size();
|
||||
|
||||
int dest = find(mask.begin(), mask.end(), (uchar)0) - mask.begin();
|
||||
int dest = (int)(find(mask.begin(), mask.end(), (uchar)0) - mask.begin());
|
||||
if (dest == last)
|
||||
return;
|
||||
|
||||
@@ -942,7 +942,7 @@ void cv::SpinImageModel::matchSpinToModel(const Mat& spin, vector<int>& indeces,
|
||||
if (masks[i])
|
||||
if (/* corrs[i] < histThresLo || */ corrs[i] > histThresHi)
|
||||
{
|
||||
indeces.push_back(i);
|
||||
indeces.push_back((int)i);
|
||||
corrCoeffs.push_back(corrs[i]);
|
||||
}
|
||||
}
|
||||
@@ -975,7 +975,7 @@ struct WgcHelper
|
||||
/* Wgc( correspondence_C, group_{C1..Cn} ) = max_i=1..n_( Wgc(C, Ci) ) */
|
||||
float Wgc(const size_t corespInd, const group_t& group) const
|
||||
{
|
||||
const float* wgcLine = mat.ptr<float>(corespInd);
|
||||
const float* wgcLine = mat.ptr<float>((int)corespInd);
|
||||
float maximum = numeric_limits<float>::min();
|
||||
|
||||
for(citer pos = group.begin(); pos != group.end(); ++pos)
|
||||
@@ -1046,17 +1046,17 @@ private:
|
||||
allMatches.end());
|
||||
if (out) *out << "Matches number [filtered by similarity measure] = " << allMatches.size() << endl;
|
||||
|
||||
size_t matchesSize = allMatches.size();
|
||||
int matchesSize = (int)allMatches.size();
|
||||
if(matchesSize == 0)
|
||||
return;
|
||||
|
||||
/* filtering by geometric consistency */
|
||||
for(size_t i = 0; i < matchesSize; ++i)
|
||||
for(int i = 0; i < matchesSize; ++i)
|
||||
{
|
||||
size_t consistNum = 1;
|
||||
float gc = float_max;
|
||||
|
||||
for(size_t j = 0; j < matchesSize; ++j)
|
||||
for(int j = 0; j < matchesSize; ++j)
|
||||
if (i != j)
|
||||
{
|
||||
const Match& mi = allMatches[i];
|
||||
@@ -1096,18 +1096,18 @@ private:
|
||||
if (out) *out << "Matches number [filtered by geometric consistency] = " << allMatches.size() << endl;
|
||||
|
||||
|
||||
matchesSize = allMatches.size();
|
||||
matchesSize = (int)allMatches.size();
|
||||
if(matchesSize == 0)
|
||||
return;
|
||||
|
||||
if (out) *out << "grouping ..." << endl;
|
||||
|
||||
Mat groupingMat(matchesSize, matchesSize, CV_32F);
|
||||
Mat groupingMat((int)matchesSize, (int)matchesSize, CV_32F);
|
||||
groupingMat = Scalar(0);
|
||||
|
||||
/* grouping */
|
||||
for(size_t j = 0; j < matchesSize; ++j)
|
||||
for(size_t i = j + 1; i < matchesSize; ++i)
|
||||
for(int j = 0; j < matchesSize; ++j)
|
||||
for(int i = j + 1; i < matchesSize; ++i)
|
||||
{
|
||||
const Match& mi = allMatches[i];
|
||||
const Match& mj = allMatches[j];
|
||||
|
||||
@@ -1816,7 +1816,7 @@ CV_EXPORTS void merge(const Mat* mv, size_t count, Mat& dst);
|
||||
CV_EXPORTS void split(const Mat& m, Mat* mvbegin);
|
||||
|
||||
//! copies selected channels from the input arrays to the selected channels of the output arrays
|
||||
CV_EXPORTS void mixChannels(const Mat* src, int nsrcs, Mat* dst, int ndsts,
|
||||
CV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts,
|
||||
const int* fromTo, size_t npairs);
|
||||
//! reverses the order of the rows, columns or both in a matrix
|
||||
CV_EXPORTS void flip(const Mat& a, Mat& b, int flipCode);
|
||||
|
||||
@@ -2372,8 +2372,8 @@ inline LineIterator LineIterator::operator ++(int)
|
||||
inline Point LineIterator::pos() const
|
||||
{
|
||||
Point p;
|
||||
p.y = (ptr - ptr0)/step;
|
||||
p.x = ((ptr - ptr0) - p.y*step)/elemSize;
|
||||
p.y = (int)((ptr - ptr0)/step);
|
||||
p.x = (int)(((ptr - ptr0) - p.y*step)/elemSize);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ mixChannels_( const void** _src, const int* sdelta0,
|
||||
typedef void (*MixChannelsFunc)( const void** src, const int* sdelta0,
|
||||
const int* sdelta1, void** dst, const int* ddelta0, const int* ddelta1, int n, Size size );
|
||||
|
||||
void mixChannels( const Mat* src, int nsrcs, Mat* dst, int ndsts, const int* fromTo, size_t npairs )
|
||||
void mixChannels( const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts, const int* fromTo, size_t npairs )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
|
||||
@@ -3937,9 +3937,9 @@ void KDTree::findOrthoRange(const float* L, const float* R,
|
||||
|
||||
void KDTree::getPoints(const int* idx, size_t nidx, Mat& pts) const
|
||||
{
|
||||
int dims = points.cols;
|
||||
pts.create( nidx, dims, points.type());
|
||||
for( size_t i = 0; i < nidx; i++ )
|
||||
int dims = points.cols, n = (int)nidx;
|
||||
pts.create( n, dims, points.type());
|
||||
for( int i = 0; i < n; i++ )
|
||||
{
|
||||
int k = idx[i];
|
||||
CV_Assert( (unsigned)k < (unsigned)points.rows );
|
||||
@@ -3954,7 +3954,7 @@ void KDTree::getPoints(const Mat& idx, Mat& pts) const
|
||||
CV_Assert(idx.type() == CV_32S && idx.isContinuous() &&
|
||||
(idx.cols == 1 || idx.rows == 1));
|
||||
int dims = points.cols;
|
||||
size_t i, nidx = idx.cols + idx.rows - 1;
|
||||
int i, nidx = idx.cols + idx.rows - 1;
|
||||
pts.create( nidx, dims, points.type());
|
||||
const int* _idx = idx.ptr<int>();
|
||||
|
||||
|
||||
@@ -121,9 +121,9 @@ Index::~Index()
|
||||
void Index::knnSearch(const vector<float>& query, vector<int>& indices, vector<float>& dists, int knn, const SearchParams& searchParams)
|
||||
{
|
||||
|
||||
::cvflann::Matrix<float> m_query(1, query.size(), (float*)&query[0]);
|
||||
::cvflann::Matrix<int> m_indices(1, indices.size(), &indices[0]);
|
||||
::cvflann::Matrix<float> m_dists(1, dists.size(), &dists[0]);
|
||||
::cvflann::Matrix<float> m_query(1, (int)query.size(), (float*)&query[0]);
|
||||
::cvflann::Matrix<int> m_indices(1, (int)indices.size(), &indices[0]);
|
||||
::cvflann::Matrix<float> m_dists(1, (int)dists.size(), &dists[0]);
|
||||
|
||||
nnIndex->knnSearch(m_query,m_indices,m_dists,knn,::cvflann::SearchParams(searchParams.checks));
|
||||
}
|
||||
@@ -149,9 +149,9 @@ void Index::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, con
|
||||
|
||||
int Index::radiusSearch(const vector<float>& query, vector<int>& indices, vector<float>& dists, float radius, const SearchParams& searchParams)
|
||||
{
|
||||
::cvflann::Matrix<float> m_query(1, query.size(), (float*)&query[0]);
|
||||
::cvflann::Matrix<int> m_indices(1, indices.size(), &indices[0]);
|
||||
::cvflann::Matrix<float> m_dists(1, dists.size(), &dists[0]);
|
||||
::cvflann::Matrix<float> m_query(1, (int)query.size(), (float*)&query[0]);
|
||||
::cvflann::Matrix<int> m_indices(1, (int)indices.size(), &indices[0]);
|
||||
::cvflann::Matrix<float> m_dists(1, (int)dists.size(), &dists[0]);
|
||||
|
||||
return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,::cvflann::SearchParams(searchParams.checks));
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ double invert( const Mat& src, Mat& dst, int method )
|
||||
else
|
||||
{
|
||||
src.copyTo(arr);
|
||||
lda = arr.step/sizeof(double);
|
||||
lda = (integer)(arr.step/sizeof(double));
|
||||
}
|
||||
|
||||
dgetrf_(&n, &n, (double*)arr.data, &lda, (integer*)buffer, &info);
|
||||
@@ -545,7 +545,7 @@ double invert( const Mat& src, Mat& dst, int method )
|
||||
else
|
||||
{
|
||||
src.copyTo(arr);
|
||||
lda = arr.step/sizeof(double);
|
||||
lda = (integer)(arr.step/sizeof(double));
|
||||
}
|
||||
|
||||
char L[] = {'L', '\0'};
|
||||
@@ -944,9 +944,9 @@ template<typename Real> bool jacobi(const Mat& _S0, Mat& _e, Mat& matE, bool com
|
||||
Real mv;
|
||||
Real* E = (Real*)matE.data;
|
||||
Real* e = (Real*)_e.data;
|
||||
int Sstep = matS.step/sizeof(Real);
|
||||
int estep = _e.rows == 1 ? 1 : _e.step/sizeof(Real);
|
||||
int Estep = matE.step/sizeof(Real);
|
||||
int Sstep = (int)(matS.step/sizeof(Real));
|
||||
int estep = _e.rows == 1 ? 1 : (int)(_e.step/sizeof(Real));
|
||||
int Estep = (int)(matE.step/sizeof(Real));
|
||||
|
||||
for( k = 0; k < n; k++ )
|
||||
{
|
||||
@@ -1144,7 +1144,7 @@ static bool eigen( const Mat& src, Mat& evals, Mat& evects, bool computeEvects,
|
||||
(liwork+2*n+1)*sizeof(integer));
|
||||
Mat a(n, n, type, (uchar*)buf);
|
||||
src.copyTo(a);
|
||||
lda = a.step1();
|
||||
lda = (integer)a.step1();
|
||||
work = a.data + n*n*elem_size;
|
||||
if( copy_evals )
|
||||
s = (float*)(work + lwork*elem_size);
|
||||
@@ -1174,7 +1174,7 @@ static bool eigen( const Mat& src, Mat& evals, Mat& evects, bool computeEvects,
|
||||
(liwork+2*n+1)*sizeof(integer));
|
||||
Mat a(n, n, type, (uchar*)buf);
|
||||
src.copyTo(a);
|
||||
lda = a.step1();
|
||||
lda = (integer)a.step1();
|
||||
work = a.data + n*n*elem_size;
|
||||
|
||||
if( copy_evals )
|
||||
@@ -1339,7 +1339,7 @@ SVD& SVD::operator ()(const Mat& a, int flags)
|
||||
bool temp_a = false;
|
||||
double u1=0, v1=0, work1=0;
|
||||
float uf1=0, vf1=0, workf1=0;
|
||||
integer lda, ldu, ldv, lwork=-1, iwork1=0, info=0, *iwork=0;
|
||||
integer lda, ldu, ldv, lwork=-1, iwork1=0, info=0;
|
||||
char mode[] = {u.data || vt.data ? 'S' : 'N', '\0'};
|
||||
|
||||
if( m != n && !(flags & NO_UV) && (flags & FULL_UV) )
|
||||
@@ -1378,7 +1378,7 @@ SVD& SVD::operator ()(const Mat& a, int flags)
|
||||
}
|
||||
work_ofs = buf_size;
|
||||
buf_size += lwork*elem_size;
|
||||
buf_size = cvAlign(buf_size, sizeof(iwork[0]));
|
||||
buf_size = cvAlign(buf_size, sizeof(integer));
|
||||
iwork_ofs = buf_size;
|
||||
buf_size += 8*nm*sizeof(integer);
|
||||
|
||||
|
||||
@@ -832,7 +832,7 @@ static void generateCentersPP(const Mat& _data, Mat& _out_centers,
|
||||
{
|
||||
int i, j, k, dims = _data.cols, N = _data.rows;
|
||||
const float* data = _data.ptr<float>(0);
|
||||
int step = _data.step/sizeof(data[0]);
|
||||
int step = (int)(_data.step/sizeof(data[0]));
|
||||
vector<int> _centers(K);
|
||||
int* centers = &_centers[0];
|
||||
vector<float> _dist(N*3);
|
||||
@@ -2851,7 +2851,7 @@ void SparseMat::resizeHashTab(size_t newsize)
|
||||
{
|
||||
newsize = std::max(newsize, (size_t)8);
|
||||
if((newsize & (newsize-1)) != 0)
|
||||
newsize = 1 << cvCeil(std::log((double)newsize)/CV_LOG2);
|
||||
newsize = (size_t)1 << cvCeil(std::log((double)newsize)/CV_LOG2);
|
||||
|
||||
size_t i, hsize = hdr->hashtab.size();
|
||||
vector<size_t> _newh(newsize);
|
||||
@@ -2908,14 +2908,14 @@ uchar* SparseMat::newNode(const int* idx, size_t hashval)
|
||||
int i, d = hdr->dims;
|
||||
for( i = 0; i < d; i++ )
|
||||
elem->idx[i] = idx[i];
|
||||
d = elemSize();
|
||||
size_t esz = elemSize();
|
||||
uchar* p = &value<uchar>(elem);
|
||||
if( d == sizeof(float) )
|
||||
if( esz == sizeof(float) )
|
||||
*((float*)p) = 0.f;
|
||||
else if( d == sizeof(double) )
|
||||
else if( esz == sizeof(double) )
|
||||
*((double*)p) = 0.;
|
||||
else
|
||||
memset(p, 0, d);
|
||||
memset(p, 0, esz);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ public:
|
||||
MSER();
|
||||
//! the full constructor
|
||||
MSER( int _delta, int _min_area, int _max_area,
|
||||
float _max_variation, float _min_diversity,
|
||||
double _max_variation, double _min_diversity,
|
||||
int _max_evolution, double _area_threshold,
|
||||
double _min_margin, int _edge_blur_size );
|
||||
//! the operator that extracts the MSERs from the image or the specific part of it
|
||||
@@ -1340,7 +1340,7 @@ class CV_EXPORTS MserFeatureDetector : public FeatureDetector
|
||||
{
|
||||
public:
|
||||
MserFeatureDetector( CvMSERParams params = cvMSERParams () );
|
||||
MserFeatureDetector( int delta, int minArea, int maxArea, float maxVariation, float minDiversity,
|
||||
MserFeatureDetector( int delta, int minArea, int maxArea, double maxVariation, double minDiversity,
|
||||
int maxEvolution, double areaThreshold, double minMargin, int edgeBlurSize );
|
||||
|
||||
virtual void read (const FileNode& fn);
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
|
||||
using namespace cv;
|
||||
|
||||
|
||||
#if defined _MSC_VER && _MSC_VER >= 1400
|
||||
#pragma warning(disable: 4244 4267)
|
||||
#endif
|
||||
|
||||
/****************************************************************************************\
|
||||
The code below is implementation of Calonder Descriptor and RTree Classifier
|
||||
|
||||
@@ -85,7 +85,7 @@ void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1,
|
||||
for( vector<KeyPoint>::const_iterator it = keypoints2.begin(); it < keypoints2.end(); ++it )
|
||||
{
|
||||
Point p = it->pt;
|
||||
circle( outImg, Point2f(p.x+img1.cols, p.y), 3, isRandSinglePointColor ?
|
||||
circle( outImg, Point(p.x+img1.cols, p.y), 3, isRandSinglePointColor ?
|
||||
Scalar(rng.uniform(0, 256), rng.uniform(0, 256), rng.uniform(0, 256)) : singlePointColor );
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ void SurfDescriptorExtractor::compute( const Mat& image,
|
||||
bool useProvidedKeypoints = true;
|
||||
surf(image, mask, keypoints, _descriptors, useProvidedKeypoints);
|
||||
|
||||
descriptors.create(keypoints.size(), surf.descriptorSize(), CV_32FC1);
|
||||
descriptors.create((int)keypoints.size(), (int)surf.descriptorSize(), CV_32FC1);
|
||||
assert( (int)_descriptors.size() == descriptors.rows * descriptors.cols );
|
||||
std::copy(_descriptors.begin(), _descriptors.end(), descriptors.begin<float>());
|
||||
}
|
||||
@@ -273,7 +273,7 @@ Ptr<DescriptorMatcher> createDescriptorMatcher( const string& descriptorMatcherT
|
||||
|
||||
template<>
|
||||
void BruteForceMatcher<L2<float> >::matchImpl( const Mat& descriptors_1, const Mat& descriptors_2,
|
||||
const Mat& mask, vector<int>& matches ) const
|
||||
const Mat& /*mask*/, vector<int>& matches ) const
|
||||
{
|
||||
matches.clear();
|
||||
matches.reserve( descriptors_1.rows );
|
||||
@@ -330,7 +330,7 @@ void KeyPointCollection::add( const Mat& _image, const vector<KeyPoint>& _points
|
||||
if( startIndices.empty() )
|
||||
startIndices.push_back(0);
|
||||
else
|
||||
startIndices.push_back(*startIndices.rbegin() + points.rbegin()->size());
|
||||
startIndices.push_back((int)(*startIndices.rbegin() + points.rbegin()->size()));
|
||||
|
||||
// add image and keypoints
|
||||
images.push_back(_image);
|
||||
@@ -457,11 +457,11 @@ void OneWayDescriptorMatch::add( const Mat& image, vector<KeyPoint>& keypoints )
|
||||
|
||||
size_t trainFeatureCount = keypoints.size();
|
||||
|
||||
base->Allocate( trainFeatureCount );
|
||||
base->Allocate( (int)trainFeatureCount );
|
||||
|
||||
IplImage _image = image;
|
||||
for( size_t i = 0; i < keypoints.size(); i++ )
|
||||
base->InitializeDescriptor( i, &_image, keypoints[i], "" );
|
||||
base->InitializeDescriptor( (int)i, &_image, keypoints[i], "" );
|
||||
|
||||
collection.add( Mat(), keypoints );
|
||||
|
||||
@@ -478,7 +478,7 @@ void OneWayDescriptorMatch::add( KeyPointCollection& keypoints )
|
||||
|
||||
size_t trainFeatureCount = keypoints.calcKeypointCount();
|
||||
|
||||
base->Allocate( trainFeatureCount );
|
||||
base->Allocate( (int)trainFeatureCount );
|
||||
|
||||
int count = 0;
|
||||
for( size_t i = 0; i < keypoints.points.size(); i++ )
|
||||
@@ -517,19 +517,17 @@ void OneWayDescriptorMatch::match( const Mat& image, vector<KeyPoint>& points, v
|
||||
int poseIdx = -1;
|
||||
|
||||
DMatch match;
|
||||
match.indexQuery = i;
|
||||
match.indexQuery = (int)i;
|
||||
match.indexTrain = -1;
|
||||
base->FindDescriptor( &_image, points[i].pt, match.indexTrain, poseIdx, match.distance );
|
||||
matches[i] = match;
|
||||
}
|
||||
}
|
||||
|
||||
void OneWayDescriptorMatch::match( const Mat& image, vector<KeyPoint>& points, vector<vector<DMatch> >& matches, float threshold )
|
||||
void OneWayDescriptorMatch::match( const Mat& image, vector<KeyPoint>& points, vector<vector<DMatch> >& matches, float /*threshold*/ )
|
||||
{
|
||||
matches.clear();
|
||||
matches.resize( points.size() );
|
||||
IplImage _image = image;
|
||||
|
||||
|
||||
vector<DMatch> dmatches;
|
||||
match( image, points, dmatches );
|
||||
@@ -538,7 +536,6 @@ void OneWayDescriptorMatch::match( const Mat& image, vector<KeyPoint>& points, v
|
||||
matches[i].push_back( dmatches[i] );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
printf("Start matching %d points\n", points.size());
|
||||
//std::cout << "Start matching " << points.size() << "points\n";
|
||||
@@ -686,7 +683,7 @@ void CalonderDescriptorMatch::calcBestProbAndMatchIdx( const Mat& image, const P
|
||||
|
||||
bestProb = 0;
|
||||
bestMatchIdx = -1;
|
||||
for( size_t ci = 0; ci < (size_t)classifier->classes(); ci++ )
|
||||
for( int ci = 0; ci < classifier->classes(); ci++ )
|
||||
{
|
||||
if( signature[ci] > bestProb )
|
||||
{
|
||||
@@ -764,7 +761,7 @@ void CalonderDescriptorMatch::read( const FileNode &fn )
|
||||
params.patchSize = fn["patchSize"];
|
||||
params.reducedNumDim = (int) fn["reducedNumDim"];
|
||||
params.numQuantBits = fn["numQuantBits"];
|
||||
params.printStatus = (int) fn["printStatus"];
|
||||
params.printStatus = (int) fn["printStatus"] != 0;
|
||||
}
|
||||
|
||||
void CalonderDescriptorMatch::write( FileStorage& fs ) const
|
||||
@@ -839,7 +836,7 @@ void FernDescriptorMatch::trainFernClassifier()
|
||||
{
|
||||
refimgs.push_back(new Mat (collection.images[imageIdx]));
|
||||
points.push_back(collection.points[imageIdx][pointIdx].pt);
|
||||
labels.push_back(pointIdx);
|
||||
labels.push_back((int)pointIdx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,7 +853,7 @@ void FernDescriptorMatch::calcBestProbAndMatchIdx( const Mat& image, const Point
|
||||
|
||||
bestProb = -FLT_MAX;
|
||||
bestMatchIdx = -1;
|
||||
for( size_t ci = 0; ci < (size_t)classifier->getClassCount(); ci++ )
|
||||
for( int ci = 0; ci < classifier->getClassCount(); ci++ )
|
||||
{
|
||||
if( signature[ci] > bestProb )
|
||||
{
|
||||
@@ -888,7 +885,7 @@ void FernDescriptorMatch::match( const Mat& image, vector<KeyPoint>& keypoints,
|
||||
matches.resize( keypoints.size() );
|
||||
vector<float> signature( (size_t)classifier->getClassCount() );
|
||||
|
||||
for( size_t pi = 0; pi < keypoints.size(); pi++ )
|
||||
for( int pi = 0; pi < (int)keypoints.size(); pi++ )
|
||||
{
|
||||
matches[pi].indexQuery = pi;
|
||||
calcBestProbAndMatchIdx( image, keypoints[pi].pt, matches[pi].distance, matches[pi].indexTrain, signature );
|
||||
@@ -904,14 +901,14 @@ void FernDescriptorMatch::match( const Mat& image, vector<KeyPoint>& keypoints,
|
||||
matches.resize( keypoints.size() );
|
||||
vector<float> signature( (size_t)classifier->getClassCount() );
|
||||
|
||||
for( size_t pi = 0; pi < keypoints.size(); pi++ )
|
||||
for( int pi = 0; pi < (int)keypoints.size(); pi++ )
|
||||
{
|
||||
(*classifier)( image, keypoints[pi].pt, signature);
|
||||
|
||||
DMatch match;
|
||||
match.indexQuery = pi;
|
||||
|
||||
for( size_t ci = 0; ci < (size_t)classifier->getClassCount(); ci++ )
|
||||
for( int ci = 0; ci < classifier->getClassCount(); ci++ )
|
||||
{
|
||||
if( -signature[ci] < threshold )
|
||||
{
|
||||
|
||||
@@ -110,7 +110,7 @@ void GoodFeaturesToTrackDetector::read (const FileNode& fn)
|
||||
qualityLevel = fn["qualityLevel"];
|
||||
minDistance = fn["minDistance"];
|
||||
blockSize = fn["blockSize"];
|
||||
useHarrisDetector = (int) fn["useHarrisDetector"];
|
||||
useHarrisDetector = (int)fn["useHarrisDetector"] != 0;
|
||||
k = fn["k"];
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ void GoodFeaturesToTrackDetector::detectImpl( const Mat& image, const Mat& mask,
|
||||
vector<KeyPoint>::iterator keypoint_it = keypoints.begin();
|
||||
for( ; corner_it != corners.end(); ++corner_it, ++keypoint_it )
|
||||
{
|
||||
*keypoint_it = KeyPoint( *corner_it, blockSize );
|
||||
*keypoint_it = KeyPoint( *corner_it, (float)blockSize );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ void GoodFeaturesToTrackDetector::detectImpl( const Mat& image, const Mat& mask,
|
||||
MserFeatureDetector
|
||||
*/
|
||||
MserFeatureDetector::MserFeatureDetector( int delta, int minArea, int maxArea,
|
||||
float maxVariation, float minDiversity,
|
||||
double maxVariation, double minDiversity,
|
||||
int maxEvolution, double areaThreshold,
|
||||
double minMargin, int edgeBlurSize )
|
||||
: mser( delta, minArea, maxArea, maxVariation, minDiversity,
|
||||
|
||||
@@ -3000,7 +3000,7 @@ static void makeOffsets(int pixel[], int row_stride)
|
||||
static void fast9ComputeScores(const Mat& img, vector<Point>& corners, vector<int>& scores, int b)
|
||||
{
|
||||
int pixel[16];
|
||||
makeOffsets(pixel, img.step);
|
||||
makeOffsets(pixel, (int)img.step);
|
||||
size_t n, num_corners = corners.size();
|
||||
|
||||
scores.resize(num_corners);
|
||||
@@ -3013,7 +3013,7 @@ static void fast9Detect(const Mat& img, vector<Point>& ret_corners, int b)
|
||||
{
|
||||
int xsize = img.cols, ysize = img.rows;
|
||||
int pixel[16];
|
||||
makeOffsets(pixel, img.step);
|
||||
makeOffsets(pixel, (int)img.step);
|
||||
|
||||
ret_corners.reserve(512);
|
||||
|
||||
|
||||
@@ -1270,12 +1270,12 @@ MSER::MSER()
|
||||
}
|
||||
|
||||
MSER::MSER( int _delta, int _min_area, int _max_area,
|
||||
float _max_variation, float _min_diversity,
|
||||
double _max_variation, double _min_diversity,
|
||||
int _max_evolution, double _area_threshold,
|
||||
double _min_margin, int _edge_blur_size )
|
||||
{
|
||||
*(CvMSERParams*)this = cvMSERParams(_delta, _min_area, _max_area, _max_variation,
|
||||
_min_diversity, _max_evolution, _area_threshold, _min_margin, _edge_blur_size);
|
||||
*(CvMSERParams*)this = cvMSERParams(_delta, _min_area, _max_area, (float)_max_variation,
|
||||
(float)_min_diversity, _max_evolution, _area_threshold, _min_margin, _edge_blur_size);
|
||||
}
|
||||
|
||||
void MSER::operator()( const Mat& image, vector<vector<Point> >& dstcontours, const Mat& mask ) const
|
||||
|
||||
@@ -1704,13 +1704,13 @@ namespace cv{
|
||||
|
||||
for (int i = 0; i < patch_count; i++)
|
||||
{
|
||||
float sum = cvSum(patches[i]).val[0];
|
||||
float nf = (float)(1./cvSum(patches[i]).val[0]);
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
*((float*)(data->data.ptr + data->step * i) + y * width + x)
|
||||
= (float)(unsigned char)patches[i]->imageData[y * patches[i]->widthStep + x] / sum;
|
||||
= (unsigned char)patches[i]->imageData[y * patches[i]->widthStep + x] * nf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ void LDetector::operator()(const vector<Mat>& pyr, vector<KeyPoint>& keypoints,
|
||||
const int lthreshold = 3;
|
||||
int L, x, y, i, j, k, tau = lthreshold;
|
||||
Mat scoreBuf(pyr[0].size(), CV_16S), maskBuf(pyr[0].size(), CV_8U);
|
||||
int scoreElSize = scoreBuf.elemSize();
|
||||
int scoreElSize = (int)scoreBuf.elemSize();
|
||||
vector<Point> circle0;
|
||||
vector<int> fhcircle0, circle, fcircle_s, fcircle;
|
||||
getDiscreteCircle(radius, circle0, fhcircle0);
|
||||
@@ -461,13 +461,13 @@ void LDetector::operator()(const vector<Mat>& pyr, vector<KeyPoint>& keypoints,
|
||||
Mat scoreLayer(layerSize, scoreBuf.type(), scoreBuf.data);
|
||||
Mat maskLayer(layerSize, maskBuf.type(), maskBuf.data);
|
||||
const Mat& pyrLayer = pyr[L];
|
||||
int sstep = scoreLayer.step/sizeof(short);
|
||||
int mstep = maskLayer.step;
|
||||
int sstep = (int)(scoreLayer.step/sizeof(short));
|
||||
int mstep = (int)maskLayer.step;
|
||||
|
||||
int csize = (int)circle0.size(), csize2 = csize/2;
|
||||
circle.resize(csize*3);
|
||||
for( i = 0; i < csize; i++ )
|
||||
circle[i] = circle[i+csize] = circle[i+csize*2] = (-circle0[i].y)*pyrLayer.step + circle0[i].x;
|
||||
circle[i] = circle[i+csize] = circle[i+csize*2] = (int)((-circle0[i].y)*pyrLayer.step + circle0[i].x);
|
||||
fcircle.clear();
|
||||
fcircle_s.clear();
|
||||
for( i = -radius; i <= radius; i++ )
|
||||
@@ -476,7 +476,7 @@ void LDetector::operator()(const vector<Mat>& pyr, vector<KeyPoint>& keypoints,
|
||||
for( j = -x; j <= x; j++ )
|
||||
{
|
||||
fcircle_s.push_back(i*sstep + j);
|
||||
fcircle.push_back(i*pyrLayer.step + j);
|
||||
fcircle.push_back((int)(i*pyrLayer.step + j));
|
||||
}
|
||||
}
|
||||
int nsize = (int)fcircle.size();
|
||||
@@ -492,7 +492,7 @@ void LDetector::operator()(const vector<Mat>& pyr, vector<KeyPoint>& keypoints,
|
||||
memset( maskLayer.ptr<uchar>(layerSize.height-y-1), 0, layerSize.width );
|
||||
}
|
||||
|
||||
int vradius = radius*pyrLayer.step;
|
||||
int vradius = (int)(radius*pyrLayer.step);
|
||||
|
||||
for( y = radius; y < layerSize.height - radius; y++ )
|
||||
{
|
||||
@@ -785,7 +785,7 @@ int FernClassifier::getLeaf(int fern, const Mat& _patch) const
|
||||
idx = (idx << 1) + f(patch);
|
||||
}
|
||||
|
||||
return fern*leavesPerStruct + idx;
|
||||
return (int)(fern*leavesPerStruct + idx);
|
||||
}
|
||||
|
||||
|
||||
@@ -1237,7 +1237,7 @@ void PlanarObjectDetector::train(const vector<Mat>& pyr, int npoints,
|
||||
ldetector.setVerbose(verbose);
|
||||
ldetector.getMostStable2D(pyr[0], modelPoints, npoints, patchGenerator);
|
||||
|
||||
npoints = modelPoints.size();
|
||||
npoints = (int)modelPoints.size();
|
||||
fernClassifier.setVerbose(verbose);
|
||||
fernClassifier.trainFromSingleView(pyr[0], modelPoints,
|
||||
patchSize, (int)modelPoints.size(), nstructs, structSize, nviews,
|
||||
|
||||
@@ -52,6 +52,10 @@
|
||||
|
||||
#define log2(a) (log((a))/CV_LOG2)
|
||||
|
||||
#if defined _MSC_VER && _MSC_VER >= 1400
|
||||
#pragma warning(disable: 4100 4244 4267 4305)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* from sift.hpp of original code
|
||||
*/
|
||||
|
||||
@@ -184,7 +184,7 @@ bool BmpDecoder::readHeader()
|
||||
bool BmpDecoder::readData( Mat& img )
|
||||
{
|
||||
uchar* data = img.data;
|
||||
int step = img.step;
|
||||
int step = (int)img.step;
|
||||
bool color = img.channels() > 1;
|
||||
uchar gray_palette[256];
|
||||
bool result = false;
|
||||
|
||||
@@ -370,7 +370,7 @@ bool JpegDecoder::readData( Mat& img )
|
||||
{
|
||||
bool result = false;
|
||||
uchar* data = img.data;
|
||||
int step = img.step;
|
||||
int step = (int)img.step;
|
||||
bool color = img.channels() > 1;
|
||||
JpegState* state = (JpegState*)m_state;
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ bool Jpeg2KDecoder::readData( Mat& img )
|
||||
bool result = false;
|
||||
int color = img.channels() > 1;
|
||||
uchar* data = img.data;
|
||||
int step = img.step;
|
||||
int step = (int)img.step;
|
||||
jas_stream_t* stream = (jas_stream_t*)m_stream;
|
||||
jas_image_t* image = (jas_image_t*)m_image;
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ bool PngDecoder::readData( Mat& img )
|
||||
uchar** buffer = _buffer;
|
||||
int color = img.channels() > 1;
|
||||
uchar* data = img.data;
|
||||
int step = img.step;
|
||||
int step = (int)img.step;
|
||||
|
||||
if( m_png_ptr && m_info_ptr && m_end_info && m_width && m_height )
|
||||
{
|
||||
@@ -223,7 +223,7 @@ bool PngDecoder::readData( Mat& img )
|
||||
png_set_palette_to_rgb( png_ptr );
|
||||
|
||||
if( m_color_type == PNG_COLOR_TYPE_GRAY && m_bit_depth < 8 )
|
||||
png_set_gray_1_2_4_to_8( png_ptr );
|
||||
png_set_expand_gray_1_2_4_to_8( png_ptr );
|
||||
|
||||
if( CV_MAT_CN(m_type) > 1 && color )
|
||||
png_set_bgr( png_ptr ); // convert RGB to BGR
|
||||
|
||||
@@ -190,7 +190,7 @@ bool PxMDecoder::readData( Mat& img )
|
||||
{
|
||||
int color = img.channels() > 1;
|
||||
uchar* data = img.data;
|
||||
int step = img.step;
|
||||
int step = (int)img.step;
|
||||
PaletteEntry palette[256];
|
||||
bool result = false;
|
||||
int bit_depth = CV_ELEM_SIZE1(m_type)*8;
|
||||
@@ -372,9 +372,9 @@ bool PxMEncoder::write( const Mat& img, const vector<int>& params )
|
||||
bool isBinary = true;
|
||||
|
||||
int width = img.cols, height = img.rows;
|
||||
int _channels = img.channels(), depth = img.elemSize1()*8;
|
||||
int _channels = img.channels(), depth = (int)img.elemSize1()*8;
|
||||
int channels = _channels > 1 ? 3 : 1;
|
||||
int fileStep = width*img.elemSize();
|
||||
int fileStep = width*(int)img.elemSize();
|
||||
int x, y;
|
||||
|
||||
for( size_t i = 0; i < params.size(); i += 2 )
|
||||
@@ -399,7 +399,7 @@ bool PxMEncoder::write( const Mat& img, const vector<int>& params )
|
||||
int bufferSize = 128; // buffer that should fit a header
|
||||
|
||||
if( isBinary )
|
||||
lineLength = width * img.elemSize();
|
||||
lineLength = width * (int)img.elemSize();
|
||||
else
|
||||
lineLength = (6 * channels + (channels > 1 ? 2 : 0)) * width + 32;
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ bool SunRasterDecoder::readData( Mat& img )
|
||||
{
|
||||
int color = img.channels() > 1;
|
||||
uchar* data = img.data;
|
||||
int step = img.step;
|
||||
int step = (int)img.step;
|
||||
uchar gray_palette[256];
|
||||
bool result = false;
|
||||
int src_pitch = ((m_width*m_bpp + 7)/8 + 1) & -2;
|
||||
|
||||
@@ -147,7 +147,7 @@ bool TiffDecoder::readData( Mat& img )
|
||||
bool result = false;
|
||||
bool color = img.channels() > 1;
|
||||
uchar* data = img.data;
|
||||
int step = img.step;
|
||||
int step = (int)img.step;
|
||||
|
||||
if( m_tif && m_width && m_height )
|
||||
{
|
||||
|
||||
@@ -412,7 +412,7 @@ void cvSetModeWindow_W32( const char* name, double prop_value)//Yannick Verdie
|
||||
EXIT;
|
||||
|
||||
{
|
||||
DWORD dwStyle = GetWindowLongPtr(window->frame, GWL_STYLE);
|
||||
DWORD dwStyle = (DWORD)GetWindowLongPtr(window->frame, GWL_STYLE);
|
||||
CvRect position;
|
||||
|
||||
if (window->status==CV_WINDOW_FULLSCREEN && prop_value==CV_WINDOW_NORMAL)
|
||||
|
||||
@@ -3065,7 +3065,7 @@ void invertAffineTransform(const Mat& matM, Mat& _iM)
|
||||
{
|
||||
const float* M = (const float*)matM.data;
|
||||
float* iM = (float*)_iM.data;
|
||||
int step = matM.step/sizeof(M[0]), istep = _iM.step/sizeof(iM[0]);
|
||||
int step = (int)(matM.step/sizeof(M[0])), istep = (int)(_iM.step/sizeof(iM[0]));
|
||||
|
||||
double D = M[0]*M[step+1] - M[1]*M[step];
|
||||
D = D != 0 ? 1./D : 0;
|
||||
@@ -3080,7 +3080,7 @@ void invertAffineTransform(const Mat& matM, Mat& _iM)
|
||||
{
|
||||
const double* M = (const double*)matM.data;
|
||||
double* iM = (double*)_iM.data;
|
||||
int step = matM.step/sizeof(M[0]), istep = _iM.step/sizeof(iM[0]);
|
||||
int step = (int)(matM.step/sizeof(M[0])), istep = (int)(_iM.step/sizeof(iM[0]));
|
||||
|
||||
double D = M[0]*M[step+1] - M[1]*M[step];
|
||||
D = D != 0 ? 1./D : 0;
|
||||
|
||||
@@ -364,7 +364,7 @@ cvMinAreaRect2( const CvArr* array, CvMemStorage* storage )
|
||||
if( CV_IS_SEQ(ptseq) )
|
||||
{
|
||||
if( !CV_IS_SEQ_POINT_SET(ptseq) &&
|
||||
(CV_SEQ_KIND(ptseq) != CV_SEQ_KIND_CURVE || !CV_IS_SEQ_CONVEX(ptseq) ||
|
||||
(CV_SEQ_KIND(ptseq) != CV_SEQ_KIND_CURVE ||
|
||||
CV_SEQ_ELTYPE(ptseq) != CV_SEQ_ELTYPE_PPOINT ))
|
||||
CV_Error( CV_StsUnsupportedFormat,
|
||||
"Input sequence must consist of 2d points or pointers to 2d points" );
|
||||
@@ -385,31 +385,7 @@ cvMinAreaRect2( const CvArr* array, CvMemStorage* storage )
|
||||
temp_storage = cvCreateMemStorage(1 << 10);
|
||||
}
|
||||
|
||||
if( !CV_IS_SEQ_CONVEX( ptseq ))
|
||||
{
|
||||
ptseq = cvConvexHull2( ptseq, temp_storage, CV_CLOCKWISE, 1 );
|
||||
}
|
||||
else if( !CV_IS_SEQ_POINT_SET( ptseq ))
|
||||
{
|
||||
CvSeqWriter writer;
|
||||
|
||||
if( !CV_IS_SEQ(ptseq->v_prev) || !CV_IS_SEQ_POINT_SET(ptseq->v_prev))
|
||||
CV_Error( CV_StsBadArg,
|
||||
"Convex hull must have valid pointer to point sequence stored in v_prev" );
|
||||
cvStartReadSeq( ptseq, &reader );
|
||||
cvStartWriteSeq( CV_SEQ_KIND_CURVE|CV_SEQ_FLAG_CONVEX|CV_SEQ_ELTYPE(ptseq->v_prev),
|
||||
sizeof(CvContour), CV_ELEM_SIZE(ptseq->v_prev->flags),
|
||||
temp_storage, &writer );
|
||||
|
||||
for( i = 0; i < ptseq->total; i++ )
|
||||
{
|
||||
CvPoint pt = **(CvPoint**)(reader.ptr);
|
||||
CV_WRITE_SEQ_ELEM( pt, writer );
|
||||
}
|
||||
|
||||
ptseq = cvEndWriteSeq( &writer );
|
||||
}
|
||||
|
||||
ptseq = cvConvexHull2( ptseq, temp_storage, CV_CLOCKWISE, 1 );
|
||||
n = ptseq->total;
|
||||
|
||||
_points.allocate(n);
|
||||
|
||||
@@ -384,7 +384,7 @@ cvPyrMeanShiftFiltering( const CvArr* srcarr, CvArr* dstarr,
|
||||
cv::Mat src = src_pyramid[level];
|
||||
cv::Size size = src.size();
|
||||
uchar* sptr = src.data;
|
||||
int sstep = src.step;
|
||||
int sstep = (int)src.step;
|
||||
uchar* mask = 0;
|
||||
int mstep = 0;
|
||||
uchar* dptr;
|
||||
@@ -396,9 +396,9 @@ cvPyrMeanShiftFiltering( const CvArr* srcarr, CvArr* dstarr,
|
||||
{
|
||||
cv::Size size1 = dst_pyramid[level+1].size();
|
||||
cv::Mat m( size.height, size.width, CV_8UC1, mask0.data );
|
||||
dstep = dst_pyramid[level+1].step;
|
||||
dstep = (int)dst_pyramid[level+1].step;
|
||||
dptr = dst_pyramid[level+1].data + dstep + cn;
|
||||
mstep = m.step;
|
||||
mstep = (int)m.step;
|
||||
mask = m.data + mstep;
|
||||
//cvResize( dst_pyramid[level+1], dst_pyramid[level], CV_INTER_CUBIC );
|
||||
cv::pyrUp( dst_pyramid[level+1], dst_pyramid[level] );
|
||||
@@ -419,7 +419,7 @@ cvPyrMeanShiftFiltering( const CvArr* srcarr, CvArr* dstarr,
|
||||
}
|
||||
|
||||
dptr = dst_pyramid[level].data;
|
||||
dstep = dst_pyramid[level].step;
|
||||
dstep = (int)dst_pyramid[level].step;
|
||||
|
||||
for( i = 0; i < size.height; i++, sptr += sstep - size.width*3,
|
||||
dptr += dstep - size.width*3,
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#include "precomp.hpp"
|
||||
#include "_vectrack.h"
|
||||
|
||||
#define _ASSERT assert
|
||||
#define NUM_FACE_ELEMENTS 3
|
||||
enum
|
||||
{
|
||||
@@ -426,9 +425,9 @@ void CvFaceElement::Energy()
|
||||
CV_IMPL CvFaceTracker*
|
||||
cvInitFaceTracker(CvFaceTracker* pFaceTracker, const IplImage* imgGray, CvRect* pRects, int nRects)
|
||||
{
|
||||
_ASSERT(NULL != imgGray);
|
||||
_ASSERT(NULL != pRects);
|
||||
_ASSERT(nRects >= NUM_FACE_ELEMENTS);
|
||||
assert(NULL != imgGray);
|
||||
assert(NULL != pRects);
|
||||
assert(nRects >= NUM_FACE_ELEMENTS);
|
||||
if ((NULL == imgGray) ||
|
||||
(NULL == pRects) ||
|
||||
(nRects < NUM_FACE_ELEMENTS))
|
||||
@@ -460,9 +459,9 @@ cvReleaseFaceTracker(CvFaceTracker** ppFaceTracker)
|
||||
CV_IMPL int
|
||||
cvTrackFace(CvFaceTracker* pFaceTracker, IplImage* imgGray, CvRect* pRects, int nRects, CvPoint* ptRotate, double* dbAngleRotate)
|
||||
{
|
||||
_ASSERT(NULL != pFaceTracker);
|
||||
_ASSERT(NULL != imgGray);
|
||||
_ASSERT(NULL != pRects && nRects >= NUM_FACE_ELEMENTS);
|
||||
assert(NULL != pFaceTracker);
|
||||
assert(NULL != imgGray);
|
||||
assert(NULL != pRects && nRects >= NUM_FACE_ELEMENTS);
|
||||
if ((NULL == pFaceTracker) ||
|
||||
(NULL == imgGray))
|
||||
return FALSE;
|
||||
@@ -612,8 +611,8 @@ RESTART:
|
||||
|
||||
void ThresholdingParam(IplImage *imgGray, int iNumLayers, int &iMinLevel, int &iMaxLevel, float &step, float& power, int iHistMin /*= HIST_MIN*/)
|
||||
{
|
||||
_ASSERT(imgGray != NULL);
|
||||
_ASSERT(imgGray->nChannels == 1);
|
||||
assert(imgGray != NULL);
|
||||
assert(imgGray->nChannels == 1);
|
||||
int i, j;
|
||||
// create histogram
|
||||
int histImg[256] = {0};
|
||||
@@ -782,7 +781,7 @@ int ChoiceTrackingFace2(CvFaceTracker* pTF, const int nElements, const CvFaceEle
|
||||
face[element[2]].r.height = int(double(pTF->rTempl[element[2]].height) / (scale) + 0.5);
|
||||
face[element[2]].r.x = face[element[2]].ptCenter.x - (face[element[2]].r.width + 1) / 2;
|
||||
face[element[2]].r.y = face[element[2]].ptCenter.y - (face[element[2]].r.height + 1) / 2;
|
||||
_ASSERT(face[LEYE].r.x + face[LEYE].r.width <= face[REYE].r.x);
|
||||
assert(face[LEYE].r.x + face[LEYE].r.width <= face[REYE].r.x);
|
||||
}
|
||||
return found;
|
||||
} // int ChoiceTrackingFace3(const CvTrackingRect* tr_face, CvTrackingRect* new_face, int& new_energy)
|
||||
@@ -860,8 +859,8 @@ inline double CalculateTransformationLMS3( CvPoint* pTemplPoints,
|
||||
double dbAverageShiftY = 0;
|
||||
double dbLMS = 0;
|
||||
|
||||
_ASSERT( NULL != pTemplPoints);
|
||||
_ASSERT( NULL != pSrcPoints);
|
||||
assert( NULL != pTemplPoints);
|
||||
assert( NULL != pSrcPoints);
|
||||
|
||||
double dbXt = double(pTemplPoints[0].x + pTemplPoints[1].x + pTemplPoints[2].x) / 3.0;
|
||||
double dbYt = double(pTemplPoints[0].y + pTemplPoints[1].y + pTemplPoints[2].y ) / 3.0;
|
||||
@@ -919,7 +918,7 @@ inline double CalculateTransformationLMS3( CvPoint* pTemplPoints,
|
||||
if( pdbAverageShiftX != NULL ) *pdbAverageShiftX = dbAverageShiftX;
|
||||
if( pdbAverageShiftY != NULL ) *pdbAverageShiftY = dbAverageShiftY;
|
||||
|
||||
_ASSERT(dbLMS >= 0);
|
||||
assert(dbLMS >= 0);
|
||||
return dbLMS;
|
||||
}
|
||||
|
||||
@@ -927,8 +926,8 @@ inline double CalculateTransformationLMS3_0( CvPoint* pTemplPoints, CvPoint* pSr
|
||||
{
|
||||
double dbLMS = 0;
|
||||
|
||||
_ASSERT( NULL != pTemplPoints);
|
||||
_ASSERT( NULL != pSrcPoints);
|
||||
assert( NULL != pTemplPoints);
|
||||
assert( NULL != pSrcPoints);
|
||||
|
||||
double dbXt = double(pTemplPoints[0].x + pTemplPoints[1].x + pTemplPoints[2].x) / 3.0;
|
||||
double dbYt = double(pTemplPoints[0].y + pTemplPoints[1].y + pTemplPoints[2].y ) / 3.0;
|
||||
|
||||
@@ -939,7 +939,7 @@ struct HaarDetectObjects_ScaleCascade_Invoker
|
||||
const int *p0 = p[0], *p1 = p[1], *p2 = p[2], *p3 = p[3];
|
||||
const int *pq0 = pq[0], *pq1 = pq[1], *pq2 = pq[2], *pq3 = pq[3];
|
||||
bool doCannyPruning = p0 != 0;
|
||||
int sstep = sumstep/sizeof(p0[0]);
|
||||
int sstep = (int)(sumstep/sizeof(p0[0]));
|
||||
|
||||
for( iy = startY; iy < endY; iy++ )
|
||||
{
|
||||
|
||||
@@ -557,9 +557,9 @@ void CvCascadeBoostTrainData::precalculate()
|
||||
|
||||
double proctime = -TIME( 0 );
|
||||
parallel_for( BlockedRange(numPrecalcVal, numPrecalcIdx),
|
||||
FeatureIdxOnlyPrecalc(featureEvaluator, buf, sample_count, is_buf_16u) );
|
||||
FeatureIdxOnlyPrecalc(featureEvaluator, buf, sample_count, is_buf_16u!=0) );
|
||||
parallel_for( BlockedRange(0, minNum),
|
||||
FeatureValAndIdxPrecalc(featureEvaluator, buf, &valCache, sample_count, is_buf_16u) );
|
||||
FeatureValAndIdxPrecalc(featureEvaluator, buf, &valCache, sample_count, is_buf_16u!=0) );
|
||||
parallel_for( BlockedRange(minNum, numPrecalcVal),
|
||||
FeatureValOnlyPrecalc(featureEvaluator, &valCache, sample_count) );
|
||||
cout << "Precalculation time: " << (proctime + TIME( 0 )) << endl;
|
||||
|
||||
Reference in New Issue
Block a user