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:
Vadim Pisarevsky
2010-07-16 12:54:53 +00:00
parent 0c9eca7922
commit f78a3b4cc1
465 changed files with 51856 additions and 41344 deletions

View File

@@ -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

View File

@@ -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 )
{

View File

@@ -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,

View File

@@ -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);

View File

@@ -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

View File

@@ -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;
}
}
}

View File

@@ -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,

View File

@@ -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
*/