Fix compilation problems with XCode 7.1.1 and cmake 3.3.2
This commit is contained in:
@@ -1480,7 +1480,7 @@ void CV_StereoCalibrationTest::run( int )
|
||||
|
||||
if( norm(R1t*R1 - eye33) > 0.01 ||
|
||||
norm(R2t*R2 - eye33) > 0.01 ||
|
||||
abs(determinant(F)) > 0.01)
|
||||
std::abs(determinant(F)) > 0.01)
|
||||
{
|
||||
ts->printf( cvtest::TS::LOG, "The computed (by rectify) R1 and R2 are not orthogonal,"
|
||||
"or the computed (by calibrate) F is not singular, testcase %d\n", testcase);
|
||||
@@ -1617,7 +1617,7 @@ void CV_StereoCalibrationTest::run( int )
|
||||
perspectiveTransform( _imgpt1, rectifPoints1, _H1 );
|
||||
perspectiveTransform( _imgpt2, rectifPoints2, _H2 );
|
||||
|
||||
bool verticalStereo = abs(P2.at<double>(0,3)) < abs(P2.at<double>(1,3));
|
||||
bool verticalStereo = std::abs(P2.at<double>(0,3)) < std::abs(P2.at<double>(1,3));
|
||||
double maxDiff_c = 0, maxDiff_uc = 0;
|
||||
for( int i = 0, k = 0; i < nframes; i++ )
|
||||
{
|
||||
@@ -1627,9 +1627,9 @@ void CV_StereoCalibrationTest::run( int )
|
||||
|
||||
for( int j = 0; j < npoints; j++, k++ )
|
||||
{
|
||||
double diff_c = verticalStereo ? abs(temp[0][j].x - temp[1][j].x) : abs(temp[0][j].y - temp[1][j].y);
|
||||
double diff_c = verticalStereo ? std::abs(temp[0][j].x - temp[1][j].x) : std::abs(temp[0][j].y - temp[1][j].y);
|
||||
Point2f d = rectifPoints1.at<Point2f>(k,0) - rectifPoints2.at<Point2f>(k,0);
|
||||
double diff_uc = verticalStereo ? abs(d.x) : abs(d.y);
|
||||
double diff_uc = verticalStereo ? std::abs(d.x) : std::abs(d.y);
|
||||
maxDiff_c = max(maxDiff_c, diff_c);
|
||||
maxDiff_uc = max(maxDiff_uc, diff_uc);
|
||||
if( maxDiff_c > maxScanlineDistErr_c )
|
||||
|
@@ -381,7 +381,7 @@ TEST_F(fisheyeTest, EtimateUncertainties)
|
||||
EXPECT_MAT_NEAR(errors.c, cv::Vec2d(0.890439368129246, 0.816096854937896), 1e-10);
|
||||
EXPECT_MAT_NEAR(errors.k, cv::Vec4d(0.00516248605191506, 0.0168181467500934, 0.0213118690274604, 0.00916010877545648), 1e-10);
|
||||
EXPECT_MAT_NEAR(err_std, cv::Vec2d(0.187475975266883, 0.185678953263995), 1e-10);
|
||||
CV_Assert(abs(rms - 0.263782587133546) < 1e-10);
|
||||
CV_Assert(std::abs(rms - 0.263782587133546) < 1e-10);
|
||||
CV_Assert(errors.alpha == 0);
|
||||
}
|
||||
|
||||
|
@@ -966,10 +966,8 @@ void ChamferMatcher::Matching::computeDistanceTransform(Mat& edges_img, Mat& dis
|
||||
for (int y=0;y<h;++y) {
|
||||
for (int x=0;x<w;++x) {
|
||||
// initialize
|
||||
if (&annotate_img!=NULL) {
|
||||
annotate_img.at<Vec2i>(y,x)[0]=x;
|
||||
annotate_img.at<Vec2i>(y,x)[1]=y;
|
||||
}
|
||||
annotate_img.at<Vec2i>(y,x)[0]=x;
|
||||
annotate_img.at<Vec2i>(y,x)[1]=y;
|
||||
|
||||
uchar edge_val = edges_img.at<uchar>(y,x);
|
||||
if( (edge_val!=0) ) {
|
||||
@@ -1013,10 +1011,8 @@ void ChamferMatcher::Matching::computeDistanceTransform(Mat& edges_img, Mat& dis
|
||||
dist_img.at<float>(ny,nx) = dist;
|
||||
q.push(std::make_pair(nx,ny));
|
||||
|
||||
if (&annotate_img!=NULL) {
|
||||
annotate_img.at<Vec2i>(ny,nx)[0]=annotate_img.at<Vec2i>(y,x)[0];
|
||||
annotate_img.at<Vec2i>(ny,nx)[1]=annotate_img.at<Vec2i>(y,x)[1];
|
||||
}
|
||||
annotate_img.at<Vec2i>(ny,nx)[0]=annotate_img.at<Vec2i>(y,x)[0];
|
||||
annotate_img.at<Vec2i>(ny,nx)[1]=annotate_img.at<Vec2i>(y,x)[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1107,26 +1103,22 @@ ChamferMatcher::Match* ChamferMatcher::Matching::localChamferDistance(Point offs
|
||||
|
||||
float cost = (sum_distance/truncate_)/addr.size();
|
||||
|
||||
float* optr = orientation_img.ptr<float>(y)+x;
|
||||
float sum_orientation = 0;
|
||||
int cnt_orientation = 0;
|
||||
|
||||
if (&orientation_img!=NULL) {
|
||||
float* optr = orientation_img.ptr<float>(y)+x;
|
||||
float sum_orientation = 0;
|
||||
int cnt_orientation = 0;
|
||||
for (size_t i=0;i<addr.size();++i) {
|
||||
|
||||
for (size_t i=0;i<addr.size();++i) {
|
||||
|
||||
if(addr[i] < (orientation_img.cols*orientation_img.rows) - (offset.y*orientation_img.cols + offset.x)){
|
||||
if (tpl->orientations[i]>=-CV_PI && (*(optr+addr[i]))>=-CV_PI) {
|
||||
sum_orientation += orientation_diff(tpl->orientations[i], (*(optr+addr[i])));
|
||||
cnt_orientation++;
|
||||
}
|
||||
if(addr[i] < (orientation_img.cols*orientation_img.rows) - (offset.y*orientation_img.cols + offset.x)){
|
||||
if (tpl->orientations[i]>=-CV_PI && (*(optr+addr[i]))>=-CV_PI) {
|
||||
sum_orientation += orientation_diff(tpl->orientations[i], (*(optr+addr[i])));
|
||||
cnt_orientation++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cnt_orientation>0) {
|
||||
cost = (float)(beta*cost+alpha*(sum_orientation/(2*CV_PI))/cnt_orientation);
|
||||
}
|
||||
|
||||
if (cnt_orientation>0) {
|
||||
cost = (float)(beta*cost+alpha*(sum_orientation/(2*CV_PI))/cnt_orientation);
|
||||
}
|
||||
|
||||
if(cost > 0){
|
||||
|
@@ -913,7 +913,7 @@ IplImage* CvCaptureFile::retrieveFramePixelBuffer() {
|
||||
}
|
||||
|
||||
|
||||
AVAssetReaderTrackOutput * output = [mMovieReader.outputs objectAtIndex:0];
|
||||
AVAssetReaderOutput * output = [mMovieReader.outputs objectAtIndex:0];
|
||||
CMSampleBufferRef sampleBuffer = [output copyNextSampleBuffer];
|
||||
if (!sampleBuffer) {
|
||||
[localpool drain];
|
||||
|
@@ -297,7 +297,7 @@ bool CvCaptureCAM::grabFrame(double timeOut) {
|
||||
// method exits immediately"
|
||||
// using usleep() is not a good alternative, because it may block the GUI.
|
||||
// Create a dummy timer so that runUntilDate does not exit immediately:
|
||||
[NSTimer scheduledTimerWithTimeInterval:100 target:nil selector:@selector(doFireTimer:) userInfo:nil repeats:YES];
|
||||
[NSTimer scheduledTimerWithTimeInterval:100 target:capture selector:@selector(doFireTimer:) userInfo:nil repeats:YES];
|
||||
while (![capture updateImage] && (total += sleepTime)<=timeOut) {
|
||||
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:sleepTime]];
|
||||
}
|
||||
|
@@ -247,7 +247,7 @@ if(ANDROID)
|
||||
# build the library project
|
||||
# normally we should do this after a native part, but for a library project we can build the java part first
|
||||
add_custom_command(OUTPUT "${JAR_FILE}" "${JAR_FILE}.dephelper"
|
||||
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug
|
||||
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6
|
||||
COMMAND ${CMAKE_COMMAND} -E touch "${JAR_FILE}.dephelper" # can not rely on classes.jar because different versions of SDK update timestamp at different times
|
||||
WORKING_DIRECTORY "${OpenCV_BINARY_DIR}"
|
||||
DEPENDS ${step3_depends}
|
||||
|
@@ -43,7 +43,7 @@ list(APPEND opencv_test_java_file_deps ${android_proj_target_files})
|
||||
add_custom_command(
|
||||
OUTPUT "${opencv_test_java_bin_dir}/bin/OpenCVTest-debug.apk"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}/libopencv_java.so" "${opencv_test_java_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}/libopencv_java.so"
|
||||
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug
|
||||
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6
|
||||
COMMAND ${CMAKE_COMMAND} -E touch "${opencv_test_java_bin_dir}/bin/OpenCVTest-debug.apk" # needed because ant does not update the timestamp of updated apk
|
||||
WORKING_DIRECTORY "${opencv_test_java_bin_dir}"
|
||||
MAIN_DEPENDENCY "${opencv_test_java_bin_dir}/${ANDROID_MANIFEST_FILE}"
|
||||
|
@@ -1880,7 +1880,7 @@ bool CvSVM::train_auto( const CvMat* _train_data, const CvMat* _responses,
|
||||
qsort(ratios, k_fold, sizeof(ratios[0]), icvCmpIndexedratio);
|
||||
double old_dist = 0.0;
|
||||
for (int k=0; k<k_fold; ++k)
|
||||
old_dist += abs(ratios[k].val-class_ratio);
|
||||
old_dist += std::abs(ratios[k].val-class_ratio);
|
||||
double new_dist = 1.0;
|
||||
// iterate to make the folds more balanced
|
||||
while (new_dist > 0.0)
|
||||
@@ -1897,7 +1897,7 @@ bool CvSVM::train_auto( const CvMat* _train_data, const CvMat* _responses,
|
||||
qsort(ratios, k_fold, sizeof(ratios[0]), icvCmpIndexedratio);
|
||||
new_dist = 0.0;
|
||||
for (int k=0; k<k_fold; ++k)
|
||||
new_dist += abs(ratios[k].val-class_ratio);
|
||||
new_dist += std::abs(ratios[k].val-class_ratio);
|
||||
if (new_dist < old_dist)
|
||||
{
|
||||
// swapping really improves, so swap the samples
|
||||
|
@@ -879,8 +879,8 @@ OCL_TEST_P(MinMaxLoc, MAT)
|
||||
minlocVal_ = src1_roi.at<float>(minLoc_);
|
||||
maxlocVal = src1_roi.at<float>(maxLoc);
|
||||
maxlocVal_ = src1_roi.at<float>(maxLoc_);
|
||||
error0 = ::abs(src1_roi.at<float>(minLoc_) - src1_roi.at<float>(minLoc));
|
||||
error1 = ::abs(src1_roi.at<float>(maxLoc_) - src1_roi.at<float>(maxLoc));
|
||||
error0 = std::abs(src1_roi.at<float>(minLoc_) - src1_roi.at<float>(minLoc));
|
||||
error1 = std::abs(src1_roi.at<float>(maxLoc_) - src1_roi.at<float>(maxLoc));
|
||||
}
|
||||
if (oneDepth == 6)
|
||||
{
|
||||
@@ -888,8 +888,8 @@ OCL_TEST_P(MinMaxLoc, MAT)
|
||||
minlocVal_ = src1_roi.at<double>(minLoc_);
|
||||
maxlocVal = src1_roi.at<double>(maxLoc);
|
||||
maxlocVal_ = src1_roi.at<double>(maxLoc_);
|
||||
error0 = ::abs(src1_roi.at<double>(minLoc_) - src1_roi.at<double>(minLoc));
|
||||
error1 = ::abs(src1_roi.at<double>(maxLoc_) - src1_roi.at<double>(maxLoc));
|
||||
error0 = std::abs(src1_roi.at<double>(minLoc_) - src1_roi.at<double>(minLoc));
|
||||
error1 = std::abs(src1_roi.at<double>(maxLoc_) - src1_roi.at<double>(maxLoc));
|
||||
}
|
||||
|
||||
EXPECT_DOUBLE_EQ(minVal_, minVal);
|
||||
@@ -993,8 +993,8 @@ OCL_TEST_P(MinMaxLoc, MASK)
|
||||
minlocVal_ = src1_roi.at<float>(minLoc_);
|
||||
maxlocVal = src1_roi.at<float>(maxLoc);
|
||||
maxlocVal_ = src1_roi.at<float>(maxLoc_);
|
||||
error0 = ::abs(src1_roi.at<float>(minLoc_) - src1_roi.at<float>(minLoc));
|
||||
error1 = ::abs(src1_roi.at<float>(maxLoc_) - src1_roi.at<float>(maxLoc));
|
||||
error0 = std::abs(src1_roi.at<float>(minLoc_) - src1_roi.at<float>(minLoc));
|
||||
error1 = std::abs(src1_roi.at<float>(maxLoc_) - src1_roi.at<float>(maxLoc));
|
||||
}
|
||||
if (oneDepth == 6)
|
||||
{
|
||||
@@ -1002,8 +1002,8 @@ OCL_TEST_P(MinMaxLoc, MASK)
|
||||
minlocVal_ = src1_roi.at<double>(minLoc_);
|
||||
maxlocVal = src1_roi.at<double>(maxLoc);
|
||||
maxlocVal_ = src1_roi.at<double>(maxLoc_);
|
||||
error0 = ::abs(src1_roi.at<double>(minLoc_) - src1_roi.at<double>(minLoc));
|
||||
error1 = ::abs(src1_roi.at<double>(maxLoc_) - src1_roi.at<double>(maxLoc));
|
||||
error0 = std::abs(src1_roi.at<double>(minLoc_) - src1_roi.at<double>(minLoc));
|
||||
error1 = std::abs(src1_roi.at<double>(maxLoc_) - src1_roi.at<double>(maxLoc));
|
||||
}
|
||||
|
||||
EXPECT_DOUBLE_EQ(minVal_, minVal);
|
||||
|
@@ -418,8 +418,8 @@ namespace cvtest
|
||||
|
||||
if (dist < maxPtDif &&
|
||||
fabs(p1.size - p2.size) < maxSizeDif &&
|
||||
abs(p1.angle - p2.angle) < maxAngleDif &&
|
||||
abs(p1.response - p2.response) < maxResponseDif &&
|
||||
std::abs(p1.angle - p2.angle) < maxAngleDif &&
|
||||
std::abs(p1.response - p2.response) < maxResponseDif &&
|
||||
p1.octave == p2.octave &&
|
||||
p1.class_id == p2.class_id)
|
||||
{
|
||||
|
Reference in New Issue
Block a user