fixed warnings under windows
This commit is contained in:
parent
ab25fe9e37
commit
41c9377db0
@ -623,7 +623,7 @@ private:
|
||||
}
|
||||
|
||||
// copy data structures on gpu
|
||||
stage_mat.upload(cv::Mat(1, stages.size() * sizeof(Stage), CV_8UC1, (uchar*)&(stages[0]) ));
|
||||
stage_mat.upload(cv::Mat(1, (int) (stages.size() * sizeof(Stage)), CV_8UC1, (uchar*)&(stages[0]) ));
|
||||
trees_mat.upload(cv::Mat(cl_trees).reshape(1,1));
|
||||
nodes_mat.upload(cv::Mat(cl_nodes).reshape(1,1));
|
||||
leaves_mat.upload(cv::Mat(cl_leaves).reshape(1,1));
|
||||
|
@ -2086,7 +2086,7 @@ void cv::gpu::bitwise_not(const GpuMat& src, GpuMat& dst, const GpuMat& mask, St
|
||||
|
||||
cudaStream_t stream = StreamAccessor::getStream(s);
|
||||
|
||||
const int bcols = src.cols * src.elemSize();
|
||||
const int bcols = (int) (src.cols * src.elemSize());
|
||||
|
||||
if ((bcols & 3) == 0)
|
||||
{
|
||||
@ -2139,7 +2139,7 @@ void cv::gpu::bitwise_and(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, c
|
||||
|
||||
cudaStream_t stream = StreamAccessor::getStream(s);
|
||||
|
||||
const int bcols = src1.cols * src1.elemSize();
|
||||
const int bcols = (int) (src1.cols * src1.elemSize());
|
||||
|
||||
if ((bcols & 3) == 0)
|
||||
{
|
||||
@ -2186,7 +2186,7 @@ void cv::gpu::bitwise_or(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, co
|
||||
|
||||
cudaStream_t stream = StreamAccessor::getStream(s);
|
||||
|
||||
const int bcols = src1.cols * src1.elemSize();
|
||||
const int bcols = (int) (src1.cols * src1.elemSize());
|
||||
|
||||
if ((bcols & 3) == 0)
|
||||
{
|
||||
@ -2233,7 +2233,7 @@ void cv::gpu::bitwise_xor(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, c
|
||||
|
||||
cudaStream_t stream = StreamAccessor::getStream(s);
|
||||
|
||||
const int bcols = src1.cols * src1.elemSize();
|
||||
const int bcols = (int) (src1.cols * src1.elemSize());
|
||||
|
||||
if ((bcols & 3) == 0)
|
||||
{
|
||||
|
@ -523,15 +523,15 @@ namespace
|
||||
|
||||
size_t total = all_contours.size();
|
||||
|
||||
_contours.create(total, 1, 0, -1, true);
|
||||
_contours.create((int) total, 1, 0, -1, true);
|
||||
|
||||
cv::SeqIterator<CvSeq*> it = all_contours.begin();
|
||||
for (size_t i = 0; i < total; ++i, ++it)
|
||||
{
|
||||
CvSeq* c = *it;
|
||||
((CvContour*)c)->color = (int)i;
|
||||
_contours.create((int)c->total, 1, CV_32SC2, i, true);
|
||||
cv::Mat ci = _contours.getMat(i);
|
||||
_contours.create((int)c->total, 1, CV_32SC2, (int)i, true);
|
||||
cv::Mat ci = _contours.getMat((int)i);
|
||||
CV_Assert( ci.isContinuous() );
|
||||
cvCvtSeqToArray(c, ci.data);
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ namespace
|
||||
const func_t func = funcs[dx.depth()];
|
||||
CV_Assert(func != 0);
|
||||
|
||||
edgePointList.cols = edgePointList.step / sizeof(int);
|
||||
edgePointList.cols = (int) (edgePointList.step / sizeof(int));
|
||||
ensureSizeIsEnough(2, edges.size().area(), CV_32SC1, edgePointList);
|
||||
|
||||
edgePointList.cols = func(edges, dx, dy, edgePointList.ptr<unsigned int>(0), edgePointList.ptr<float>(1));
|
||||
|
@ -235,13 +235,13 @@ struct cv::gpu::SCascade::Fields
|
||||
++octIndex;
|
||||
}
|
||||
|
||||
cv::Mat hoctaves(1, voctaves.size() * sizeof(Octave), CV_8UC1, (uchar*)&(voctaves[0]));
|
||||
cv::Mat hoctaves(1, (int) (voctaves.size() * sizeof(Octave)), CV_8UC1, (uchar*)&(voctaves[0]));
|
||||
CV_Assert(!hoctaves.empty());
|
||||
|
||||
cv::Mat hstages(cv::Mat(vstages).reshape(1,1));
|
||||
CV_Assert(!hstages.empty());
|
||||
|
||||
cv::Mat hnodes(1, vnodes.size() * sizeof(Node), CV_8UC1, (uchar*)&(vnodes[0]) );
|
||||
cv::Mat hnodes(1, (int) (vnodes.size() * sizeof(Node)), CV_8UC1, (uchar*)&(vnodes[0]) );
|
||||
CV_Assert(!hnodes.empty());
|
||||
|
||||
cv::Mat hleaves(cv::Mat(vleaves).reshape(1,1));
|
||||
@ -296,7 +296,7 @@ struct cv::gpu::SCascade::Fields
|
||||
scale = ::std::min(maxScale, ::expf(::log(scale) + logFactor));
|
||||
}
|
||||
|
||||
cv::Mat hlevels = cv::Mat(1, vlevels.size() * sizeof(Level), CV_8UC1, (uchar*)&(vlevels[0]) );
|
||||
cv::Mat hlevels = cv::Mat(1, (int) (vlevels.size() * sizeof(Level)), CV_8UC1, (uchar*)&(vlevels[0]) );
|
||||
CV_Assert(!hlevels.empty());
|
||||
levels.upload(hlevels);
|
||||
downscales = dcs;
|
||||
|
@ -89,7 +89,7 @@ TEST_P(HoughLines, Accuracy)
|
||||
const bool useRoi = GET_PARAM(2);
|
||||
|
||||
const float rho = 1.0f;
|
||||
const float theta = 1.5f * CV_PI / 180.0f;
|
||||
const float theta = (float) (1.5 * CV_PI / 180.0);
|
||||
const int threshold = 100;
|
||||
|
||||
cv::Mat src(size, CV_8UC1);
|
||||
|
@ -82,7 +82,7 @@ namespace {
|
||||
int cc = -1;
|
||||
|
||||
int* dist_labels = (int*)labels.data;
|
||||
int pitch = labels.step1();
|
||||
int pitch = (int) labels.step1();
|
||||
|
||||
unsigned char* source = (unsigned char*)image.data;
|
||||
int width = image.cols;
|
||||
|
@ -606,8 +606,8 @@ static void FastOpticalFlowBM_gold(const cv::Mat_<uchar>& I0, const cv::Mat_<uch
|
||||
}
|
||||
}
|
||||
|
||||
velx(y, x) = bestDx;
|
||||
vely(y, x) = bestDy;
|
||||
velx(y, x) = (float) bestDx;
|
||||
vely(y, x) = (float) bestDy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ int main(int argc, const char* argv[])
|
||||
|
||||
vector<Vec4i> lines_cpu;
|
||||
{
|
||||
const double start = getTickCount();
|
||||
const int64 start = getTickCount();
|
||||
|
||||
HoughLinesP(mask, lines_cpu, 1, CV_PI / 180, 50, 60, 5);
|
||||
|
||||
@ -57,9 +57,9 @@ int main(int argc, const char* argv[])
|
||||
GpuMat d_lines;
|
||||
HoughLinesBuf d_buf;
|
||||
{
|
||||
const double start = getTickCount();
|
||||
const int64 start = getTickCount();
|
||||
|
||||
gpu::HoughLinesP(d_src, d_lines, d_buf, 1, CV_PI / 180, 50, 5);
|
||||
gpu::HoughLinesP(d_src, d_lines, d_buf, 1.0f, (float) (CV_PI / 180.0f), 50, 5);
|
||||
|
||||
const double timeSec = (getTickCount() - start) / getTickFrequency();
|
||||
cout << "GPU Time : " << timeSec * 1000 << " ms" << endl;
|
||||
|
@ -57,7 +57,7 @@ static Vec3b computeColor(float fx, float fy)
|
||||
}
|
||||
|
||||
const float rad = sqrt(fx * fx + fy * fy);
|
||||
const float a = atan2(-fy, -fx) / CV_PI;
|
||||
const float a = atan2(-fy, -fx) / (float) CV_PI;
|
||||
|
||||
const float fk = (a + 1.0f) / 2.0f * (NCOLS - 1);
|
||||
const int k0 = static_cast<int>(fk);
|
||||
@ -68,8 +68,8 @@ static Vec3b computeColor(float fx, float fy)
|
||||
|
||||
for (int b = 0; b < 3; b++)
|
||||
{
|
||||
const float col0 = colorWheel[k0][b] / 255.0;
|
||||
const float col1 = colorWheel[k1][b] / 255.0;
|
||||
const float col0 = colorWheel[k0][b] / 255.0f;
|
||||
const float col1 = colorWheel[k1][b] / 255.0f;
|
||||
|
||||
float col = (1 - f) * col0 + f * col1;
|
||||
|
||||
@ -78,7 +78,7 @@ static Vec3b computeColor(float fx, float fy)
|
||||
else
|
||||
col *= .75; // out of range
|
||||
|
||||
pix[2 - b] = static_cast<int>(255.0 * col);
|
||||
pix[2 - b] = static_cast<uchar>(255.0 * col);
|
||||
}
|
||||
|
||||
return pix;
|
||||
@ -166,7 +166,7 @@ int main(int argc, const char* argv[])
|
||||
GpuMat d_flowx(frame0.size(), CV_32FC1);
|
||||
GpuMat d_flowy(frame0.size(), CV_32FC1);
|
||||
|
||||
BroxOpticalFlow brox(0.197, 50.0, 0.8, 10, 77, 10);
|
||||
BroxOpticalFlow brox(0.197f, 50.0f, 0.8f, 10, 77, 10);
|
||||
PyrLKOpticalFlow lk; lk.winSize = Size(7, 7);
|
||||
FarnebackOpticalFlow farn;
|
||||
OpticalFlowDual_TVL1_GPU tvl1;
|
||||
@ -179,7 +179,7 @@ int main(int argc, const char* argv[])
|
||||
d_frame0.convertTo(d_frame0f, CV_32F, 1.0 / 255.0);
|
||||
d_frame1.convertTo(d_frame1f, CV_32F, 1.0 / 255.0);
|
||||
|
||||
const double start = getTickCount();
|
||||
const int64 start = getTickCount();
|
||||
|
||||
brox(d_frame0f, d_frame1f, d_flowx, d_flowy);
|
||||
|
||||
@ -190,7 +190,7 @@ int main(int argc, const char* argv[])
|
||||
}
|
||||
|
||||
{
|
||||
const double start = getTickCount();
|
||||
const int64 start = getTickCount();
|
||||
|
||||
lk.dense(d_frame0, d_frame1, d_flowx, d_flowy);
|
||||
|
||||
@ -201,7 +201,7 @@ int main(int argc, const char* argv[])
|
||||
}
|
||||
|
||||
{
|
||||
const double start = getTickCount();
|
||||
const int64 start = getTickCount();
|
||||
|
||||
farn(d_frame0, d_frame1, d_flowx, d_flowy);
|
||||
|
||||
@ -212,7 +212,7 @@ int main(int argc, const char* argv[])
|
||||
}
|
||||
|
||||
{
|
||||
const double start = getTickCount();
|
||||
const int64 start = getTickCount();
|
||||
|
||||
tvl1(d_frame0, d_frame1, d_flowx, d_flowy);
|
||||
|
||||
@ -223,7 +223,7 @@ int main(int argc, const char* argv[])
|
||||
}
|
||||
|
||||
{
|
||||
const double start = getTickCount();
|
||||
const int64 start = getTickCount();
|
||||
|
||||
GpuMat buf;
|
||||
calcOpticalFlowBM(d_frame0, d_frame1, Size(7, 7), Size(1, 1), Size(21, 21), false, d_flowx, d_flowy, buf);
|
||||
@ -235,7 +235,7 @@ int main(int argc, const char* argv[])
|
||||
}
|
||||
|
||||
{
|
||||
const double start = getTickCount();
|
||||
const int64 start = getTickCount();
|
||||
|
||||
fastBM(d_frame0, d_frame1, d_flowx, d_flowy);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user