fix build with GCC 3.3 on Ubuntu 8.04

pull/13383/head
Vadim Pisarevsky 15 years ago
parent 4187f11610
commit db82906067
  1. 9
      modules/features2d/include/opencv2/features2d/features2d.hpp
  2. 2
      modules/imgproc/src/moments.cpp
  3. 3
      samples/cpp/calibration.cpp
  4. 2
      tests/cv/src/areprojectImageTo3D.cpp
  5. 17
      tests/cxcore/src/areduce.cpp

@ -1560,6 +1560,7 @@ struct DMatch
class CV_EXPORTS DescriptorMatcher class CV_EXPORTS DescriptorMatcher
{ {
public: public:
virtual ~DescriptorMatcher() {}
/* /*
* Add descriptors to the training set * Add descriptors to the training set
* descriptors Descriptors to add to the training set * descriptors Descriptors to add to the training set
@ -1806,7 +1807,7 @@ void BruteForceMatcher<Distance>::matchImpl( const Mat& descriptors_1, const Mat
for( int i = 0; i < descriptors_1.rows; i++ ) for( int i = 0; i < descriptors_1.rows; i++ )
{ {
const ValueType* d1 = descriptors_1.ptr<ValueType>(i); const ValueType* d1 = (const ValueType*)(descriptors_1.data + descriptors_1.step*i);
int matchIndex = -1; int matchIndex = -1;
DistanceType matchDistance = std::numeric_limits<DistanceType>::max(); DistanceType matchDistance = std::numeric_limits<DistanceType>::max();
@ -1814,7 +1815,7 @@ void BruteForceMatcher<Distance>::matchImpl( const Mat& descriptors_1, const Mat
{ {
if( possibleMatch(mask, i, j) ) if( possibleMatch(mask, i, j) )
{ {
const ValueType* d2 = descriptors_2.ptr<ValueType>(j); const ValueType* d2 = (const ValueType*)(descriptors_2.data + descriptors_2.step*j);
DistanceType curDistance = distance(d1, d2, dimension); DistanceType curDistance = distance(d1, d2, dimension);
if( curDistance < matchDistance ) if( curDistance < matchDistance )
{ {
@ -1854,13 +1855,13 @@ void BruteForceMatcher<Distance>::matchImpl( const Mat& descriptors_1, const Mat
for( int i = 0; i < descriptors_1.rows; i++ ) for( int i = 0; i < descriptors_1.rows; i++ )
{ {
const ValueType* d1 = descriptors_1.ptr<ValueType>(i); const ValueType* d1 = (const ValueType*)(descriptors_1.data + descriptors_1.step*i);
for( int j = 0; j < descriptors_2.rows; j++ ) for( int j = 0; j < descriptors_2.rows; j++ )
{ {
if( possibleMatch(mask, i, j) ) if( possibleMatch(mask, i, j) )
{ {
const ValueType* d2 = descriptors_2.ptr<ValueType>(j); const ValueType* d2 = (const ValueType*)(descriptors_2.data + descriptors_2.step*j);
DistanceType curDistance = distance(d1, d2, dimension); DistanceType curDistance = distance(d1, d2, dimension);
if( curDistance < threshold ) if( curDistance < threshold )
{ {

@ -205,7 +205,7 @@ static void momentsInTile( const cv::Mat& img, double* moments )
for( y = 0; y < size.height; y++ ) for( y = 0; y < size.height; y++ )
{ {
const T* ptr = img.ptr<T>(y); const T* ptr = (const T*)(img.data + y*img.step);
WT x0 = 0, x1 = 0, x2 = 0; WT x0 = 0, x1 = 0, x2 = 0;
MT x3 = 0; MT x3 = 0;

@ -171,7 +171,8 @@ void saveCameraParams( const string& filename,
for( size_t i = 0; i < imagePoints.size(); i++ ) for( size_t i = 0; i < imagePoints.size(); i++ )
{ {
Mat r = imagePtMat.row(i).reshape(2, imagePtMat.cols); Mat r = imagePtMat.row(i).reshape(2, imagePtMat.cols);
Mat(imagePoints[i]).copyTo(r); Mat imgpti(imagePoints[i]);
imgpti.copyTo(r);
} }
fs << "image_points" << imagePtMat; fs << "image_points" << imagePtMat;
} }

@ -145,7 +145,7 @@ protected:
Mat_<double> res = Q * Mat_<double>(4, 1, from); Mat_<double> res = Q * Mat_<double>(4, 1, from);
res /= res(3, 0); res /= res(3, 0);
out3d_t pixel_exp = *res.ptr<Vec3d>(); out3d_t pixel_exp = *(Vec3d*)res.data;
out3d_t pixel_out = _3dImg(y, x); out3d_t pixel_out = _3dImg(y, x);
const int largeZValue = 10000; /* see documentation */ const int largeZValue = 10000; /* see documentation */

@ -76,15 +76,20 @@ void testReduce( const Mat& src, Mat& sum, Mat& avg, Mat& max, Mat& min, int dim
max.setTo(Scalar(-DBL_MAX)); max.setTo(Scalar(-DBL_MAX));
min.setTo(Scalar(DBL_MAX)); min.setTo(Scalar(DBL_MAX));
const Mat_<Type>& src_ = src;
Mat_<double>& sum_ = (Mat_<double>&)sum;
Mat_<double>& min_ = (Mat_<double>&)min;
Mat_<double>& max_ = (Mat_<double>&)max;
if( dim == 0 ) if( dim == 0 )
{ {
for( int ri = 0; ri < src.rows; ri++ ) for( int ri = 0; ri < src.rows; ri++ )
{ {
for( int ci = 0; ci < src.cols; ci++ ) for( int ci = 0; ci < src.cols; ci++ )
{ {
sum.at<double>(0, ci) += src.at<Type>(ri, ci); sum_(0, ci) += src_(ri, ci);
max.at<double>(0, ci) = std::max( max.at<double>(0, ci), (double)src.at<Type>(ri, ci) ); max_(0, ci) = std::max( max_(0, ci), (double)src_(ri, ci) );
min.at<double>(0, ci) = std::min( min.at<double>(0, ci), (double)src.at<Type>(ri, ci) ); min_(0, ci) = std::min( min_(0, ci), (double)src_(ri, ci) );
} }
} }
} }
@ -94,9 +99,9 @@ void testReduce( const Mat& src, Mat& sum, Mat& avg, Mat& max, Mat& min, int dim
{ {
for( int ri = 0; ri < src.rows; ri++ ) for( int ri = 0; ri < src.rows; ri++ )
{ {
sum.at<double>(ri, 0) += src.at<Type>(ri, ci); sum_(ri, 0) += src_(ri, ci);
max.at<double>(ri, 0) = std::max( max.at<double>(ri, 0), (double)src.at<Type>(ri, ci) ); max_(ri, 0) = std::max( max_(ri, 0), (double)src_(ri, ci) );
min.at<double>(ri, 0) = std::min( min.at<double>(ri, 0), (double)src.at<Type>(ri, ci) ); min_(ri, 0) = std::min( min_(ri, 0), (double)src_(ri, ci) );
} }
} }
} }

Loading…
Cancel
Save