mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-17 15:26:00 +08:00
Some changes to make VS2010 compiler happy.
This commit is contained in:
@@ -92,12 +92,12 @@ void MakeArtificialExample(UMat &dst_frame1, UMat &dst_frame2)
|
||||
int OF_scale = 6;
|
||||
double sigma = dst_frame1.cols / 300;
|
||||
|
||||
UMat tmp(Size(dst_frame1.cols / (int)pow(2, src_scale), dst_frame1.rows / (int)pow(2, src_scale)), CV_8U);
|
||||
UMat tmp(Size(dst_frame1.cols / (1 << src_scale), dst_frame1.rows / (1 << src_scale)), CV_8U);
|
||||
randu(tmp, 0, 255);
|
||||
resize(tmp, dst_frame1, dst_frame1.size(), 0.0, 0.0, INTER_LINEAR);
|
||||
resize(tmp, dst_frame2, dst_frame2.size(), 0.0, 0.0, INTER_LINEAR);
|
||||
|
||||
Mat displacement_field(Size(dst_frame1.cols / (int)pow(2, OF_scale), dst_frame1.rows / (int)pow(2, OF_scale)),
|
||||
Mat displacement_field(Size(dst_frame1.cols / (1 << OF_scale), dst_frame1.rows / (1 << OF_scale)),
|
||||
CV_32FC2);
|
||||
randn(displacement_field, 0.0, sigma);
|
||||
resize(displacement_field, displacement_field, dst_frame2.size(), 0.0, 0.0, INTER_CUBIC);
|
||||
|
@@ -86,12 +86,12 @@ void MakeArtificialExample(Mat &dst_frame1, Mat &dst_frame2)
|
||||
int OF_scale = 6;
|
||||
double sigma = dst_frame1.cols / 300;
|
||||
|
||||
Mat tmp(Size(dst_frame1.cols / (int)pow(2, src_scale), dst_frame1.rows / (int)pow(2, src_scale)), CV_8U);
|
||||
Mat tmp(Size(dst_frame1.cols / (1 << src_scale), dst_frame1.rows / (1 << src_scale)), CV_8U);
|
||||
randu(tmp, 0, 255);
|
||||
resize(tmp, dst_frame1, dst_frame1.size(), 0.0, 0.0, INTER_LINEAR);
|
||||
resize(tmp, dst_frame2, dst_frame2.size(), 0.0, 0.0, INTER_LINEAR);
|
||||
|
||||
Mat displacement_field(Size(dst_frame1.cols / (int)pow(2, OF_scale), dst_frame1.rows / (int)pow(2, OF_scale)),
|
||||
Mat displacement_field(Size(dst_frame1.cols / (1 << OF_scale), dst_frame1.rows / (1 << OF_scale)),
|
||||
CV_32FC2);
|
||||
randn(displacement_field, 0.0, sigma);
|
||||
resize(displacement_field, displacement_field, dst_frame2.size(), 0.0, 0.0, INTER_CUBIC);
|
||||
|
@@ -570,7 +570,7 @@ bool GPCTree::trainNode( size_t nodeId, SIter begin, SIter end, unsigned depth )
|
||||
localBestScore = score;
|
||||
else
|
||||
{
|
||||
const double beta = simulatedAnnealingTemperatureCoef * std::sqrt( i ) / ( nSamples * ( scoreGainPos + scoreGainNeg ) );
|
||||
const double beta = simulatedAnnealingTemperatureCoef * std::sqrt( static_cast<float>(i) ) / ( nSamples * ( scoreGainPos + scoreGainNeg ) );
|
||||
if ( rng.uniform( 0.0, 1.0 ) > std::exp( -beta * ( localBestScore - score) ) )
|
||||
coef[pos] = randomModification;
|
||||
}
|
||||
|
@@ -100,8 +100,8 @@ TEST_P(DenseOpticalFlow_DIS, MultithreadReproducibility)
|
||||
// resulting flow should be within the frame bounds:
|
||||
double min_val, max_val;
|
||||
minMaxLoc(resMultiThread, &min_val, &max_val);
|
||||
EXPECT_LE(abs(min_val), sqrt(size.height * size.height + size.width * size.width));
|
||||
EXPECT_LE(abs(max_val), sqrt(size.height * size.height + size.width * size.width));
|
||||
EXPECT_LE(abs(min_val), sqrt( static_cast<double>(size.height * size.height + size.width * size.width)) );
|
||||
EXPECT_LE(abs(max_val), sqrt( static_cast<double>(size.height * size.height + size.width * size.width)) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@ TEST_P(DenseOpticalFlow_VariationalRefinement, MultithreadReproducibility)
|
||||
// resulting flow should be within the frame bounds:
|
||||
double min_val, max_val;
|
||||
minMaxLoc(resMultiThread, &min_val, &max_val);
|
||||
EXPECT_LE(abs(min_val), sqrt(size.height * size.height + size.width * size.width));
|
||||
EXPECT_LE(abs(max_val), sqrt(size.height * size.height + size.width * size.width));
|
||||
EXPECT_LE(abs(min_val), sqrt( static_cast<double>(size.height * size.height + size.width * size.width)) );
|
||||
EXPECT_LE(abs(max_val), sqrt( static_cast<double>(size.height * size.height + size.width * size.width)) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -477,7 +477,7 @@ void normalize( const Mat &pts, const int& dim, Mat& normpts, Mat &T )
|
||||
averagedist = averagedist+(float)norm(ptstmp);
|
||||
}
|
||||
averagedist = averagedist / normpts.cols;
|
||||
scale = (float)(sqrt(dim) / averagedist);
|
||||
scale = (float)(sqrt(static_cast<float>(dim)) / averagedist);
|
||||
|
||||
normpts = normpts * scale;
|
||||
|
||||
|
@@ -200,12 +200,12 @@ bool SinusoidalPatternProfilometry_Impl::generate( OutputArrayOfArrays pattern )
|
||||
if( params.horizontal )
|
||||
{
|
||||
period = params.height / params.nbrOfPeriods;
|
||||
nbrOfMarkersOnOneRow = (int)floor((params.width - firstMarkerOffset) / m);
|
||||
nbrOfMarkersOnOneRow = (int)floor(static_cast<float>((params.width - firstMarkerOffset) / m));
|
||||
}
|
||||
else
|
||||
{
|
||||
period = params.width / params.nbrOfPeriods;
|
||||
nbrOfMarkersOnOneRow = (int)floor((params.height - firstMarkerOffset) / m);
|
||||
nbrOfMarkersOnOneRow = (int)floor(static_cast<float>((params.height - firstMarkerOffset) / m));
|
||||
}
|
||||
frequency = (float) 1 / period;
|
||||
|
||||
|
@@ -117,7 +117,7 @@ int main(int argc, char** argv)
|
||||
cerr << "Sample count have to be a positive integer: " << argv[1] << endl;
|
||||
return 1;
|
||||
}
|
||||
initSeedCount = (int)floor(initSampleCount / 4);
|
||||
initSeedCount = (int)floor(static_cast<float>(initSampleCount / 4));
|
||||
initSeedCount = std::max(1, initSeedCount); // fallback if sample count == 1
|
||||
}
|
||||
if (argc > 2) // seed count
|
||||
|
@@ -63,7 +63,7 @@ namespace ximgproc
|
||||
if (sigmaAlpha < 0)
|
||||
sigmaAlpha = 5. * fr;
|
||||
if (sigmaAvg < 0)
|
||||
sigmaAvg = 0.05 * sqrt(src.channels());
|
||||
sigmaAvg = 0.05 * sqrt(static_cast<float>(src.channels()));
|
||||
|
||||
Mat I;
|
||||
src.copyTo(I);
|
||||
|
Reference in New Issue
Block a user