mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
Cast some image coordinates and sizes to double.
Conflicts: modules/gpu/perf/perf_imgproc.cpp Cast a long integer to double explicitly. Conflicts: modules/python/src2/cv2.cpp Cast some matrix sizes to type int. Change some vector mask types to unsigned. Conflicts: modules/core/src/arithm.cpp
This commit is contained in:
parent
b599774e30
commit
b99f7a29df
@ -138,7 +138,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);
|
||||
|
||||
|
@ -104,7 +104,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};
|
||||
|
@ -144,7 +144,11 @@ protected:
|
||||
|
||||
depth = cvtest::randInt(rng) % (CV_64F+1);
|
||||
cn = cvtest::randInt(rng) % 4 + 1;
|
||||
int sz[] = {cvtest::randInt(rng)%10+1, cvtest::randInt(rng)%10+1, cvtest::randInt(rng)%10+1};
|
||||
int sz[] = {
|
||||
static_cast<int>(cvtest::randInt(rng)%10+1),
|
||||
static_cast<int>(cvtest::randInt(rng)%10+1),
|
||||
static_cast<int>(cvtest::randInt(rng)%10+1),
|
||||
};
|
||||
MatND test_mat_nd(3, sz, CV_MAKETYPE(depth, cn));
|
||||
|
||||
rng0.fill(test_mat_nd, CV_RAND_UNI, Scalar::all(ranges[depth][0]), Scalar::all(ranges[depth][1]));
|
||||
@ -156,8 +160,12 @@ protected:
|
||||
multiply(test_mat_nd, test_mat_scale, test_mat_nd);
|
||||
}
|
||||
|
||||
int ssz[] = {cvtest::randInt(rng)%10+1, cvtest::randInt(rng)%10+1,
|
||||
cvtest::randInt(rng)%10+1,cvtest::randInt(rng)%10+1};
|
||||
int ssz[] = {
|
||||
static_cast<int>(cvtest::randInt(rng)%10+1),
|
||||
static_cast<int>(cvtest::randInt(rng)%10+1),
|
||||
static_cast<int>(cvtest::randInt(rng)%10+1),
|
||||
static_cast<int>(cvtest::randInt(rng)%10+1),
|
||||
};
|
||||
SparseMat test_sparse_mat = cvTsGetRandomSparseMat(4, ssz, cvtest::randInt(rng)%(CV_64F+1),
|
||||
cvtest::randInt(rng) % 10000, 0, 100, rng);
|
||||
|
||||
|
@ -253,7 +253,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, 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, 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);
|
||||
|
@ -2770,7 +2770,7 @@ public:
|
||||
#if CV_SSE3
|
||||
int CV_DECL_ALIGNED(16) buf[4];
|
||||
float CV_DECL_ALIGNED(16) bufSum[4];
|
||||
static const int CV_DECL_ALIGNED(16) bufSignMask[] = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 };
|
||||
static const unsigned int CV_DECL_ALIGNED(16) bufSignMask[] = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 };
|
||||
bool haveSSE3 = checkHardwareSupport(CV_CPU_SSE3);
|
||||
#endif
|
||||
|
||||
@ -3152,7 +3152,7 @@ public:
|
||||
#if CV_SSE3
|
||||
int CV_DECL_ALIGNED(16) idxBuf[4];
|
||||
float CV_DECL_ALIGNED(16) bufSum32[4];
|
||||
static const int CV_DECL_ALIGNED(16) bufSignMask[] = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 };
|
||||
static const unsigned int CV_DECL_ALIGNED(16) bufSignMask[] = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 };
|
||||
bool haveSSE3 = checkHardwareSupport(CV_CPU_SSE3);
|
||||
#endif
|
||||
|
||||
|
@ -226,7 +226,7 @@ static bool pyopencv_to(PyObject* o, Mat& m, const ArgInfo info)
|
||||
|
||||
if( PyInt_Check(o) )
|
||||
{
|
||||
double v[] = {(double)PyInt_AsLong((PyObject*)o), 0., 0., 0.};
|
||||
double v[] = {static_cast<double>(PyInt_AsLong((PyObject*)o)), 0., 0., 0.};
|
||||
m = Mat(4, 1, CV_64F, v).clone();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user