Cast some image coordinates and sizes to double.

This commit is contained in:
Mansour Moufid 2015-02-24 12:21:34 -05:00
parent 06b97b7b67
commit b7be49426d
3 changed files with 12 additions and 4 deletions

View File

@ -137,7 +137,12 @@ protected:
{
InT d = disp(y, x);
double from[4] = { x, y, d, 1 };
double from[4] = {
static_cast<double>(x),
static_cast<double>(y),
static_cast<double>(d),
1.0,
};
Mat_<double> res = Q * Mat_<double>(4, 1, from);
res /= res(3, 0);

View File

@ -101,7 +101,10 @@ void CV_UndistortPointsBadArgTest::run(int)
img_size.height = 600;
double cam[9] = {150.f, 0.f, img_size.width/2.f, 0, 300.f, img_size.height/2.f, 0.f, 0.f, 1.f};
double dist[4] = {0.01,0.02,0.001,0.0005};
double s_points[N_POINTS2] = {img_size.width/4,img_size.height/4};
double s_points[N_POINTS2] = {
static_cast<double>(img_size.width) / 4.0,
static_cast<double>(img_size.height) / 4.0,
};
double d_points[N_POINTS2];
double p[9] = {155.f, 0.f, img_size.width/2.f+img_size.width/50.f, 0, 310.f, img_size.height/2.f+img_size.height/50.f, 0.f, 0.f, 1.f};
double r[9] = {1,0,0,0,1,0,0,0,1};

View File

@ -253,7 +253,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, ImgProc_WarpAffine,
const double aplha = CV_PI / 4;
const double mat[2 * 3] =
{
std::cos(aplha), -std::sin(aplha), src.cols / 2,
std::cos(aplha), -std::sin(aplha), static_cast<double>(src.cols) / 2.0,
std::sin(aplha), std::cos(aplha), 0
};
const cv::Mat M(2, 3, CV_64F, (void*) mat);
@ -301,7 +301,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, ImgProc_WarpPerspective,
declare.in(src, WARMUP_RNG);
const double aplha = CV_PI / 4;
double mat[3][3] = { {std::cos(aplha), -std::sin(aplha), src.cols / 2},
double mat[3][3] = { {std::cos(aplha), -std::sin(aplha), static_cast<double>(src.cols) / 2.0},
{std::sin(aplha), std::cos(aplha), 0},
{0.0, 0.0, 1.0}};
const cv::Mat M(3, 3, CV_64F, (void*) mat);