}
// 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));
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)
{
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)
{
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)
{
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)
{
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);
}
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));
++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));
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;
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);
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;
}
}
- velx(y, x) = bestDx;
- vely(y, x) = bestDy;
+ velx(y, x) = (float) bestDx;
+ vely(y, x) = (float) bestDy;
}
}
}
vector<Vec4i> lines_cpu;
{
- const double start = getTickCount();
+ const int64 start = getTickCount();
HoughLinesP(mask, lines_cpu, 1, CV_PI / 180, 50, 60, 5);
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;
}
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);
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;
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;
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;
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);
}
{
- const double start = getTickCount();
+ const int64 start = getTickCount();
lk.dense(d_frame0, d_frame1, d_flowx, d_flowy);
}
{
- const double start = getTickCount();
+ const int64 start = getTickCount();
farn(d_frame0, d_frame1, d_flowx, d_flowy);
}
{
- const double start = getTickCount();
+ const int64 start = getTickCount();
tvl1(d_frame0, d_frame1, d_flowx, d_flowy);
}
{
- 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);
}
{
- const double start = getTickCount();
+ const int64 start = getTickCount();
fastBM(d_frame0, d_frame1, d_flowx, d_flowy);