Skip to content

Commit b6767cc

Browse files
mshabuninalalek
authored andcommitted
Merge pull request #2011 from mshabunin:enable-narrowing-warning
* Fixed type narrowing issues
1 parent 4ed97c5 commit b6767cc

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

modules/optflow/src/pcaflow.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ void OpticalFlowPCAFlow::getSystem( OutputArray AOut, OutputArray b1Out, OutputA
328328
Mat b2 = b2Out.getMat();
329329

330330
ocl::Kernel kernel( "fillDCTSampledPoints", _ocl_fillDCTSampledPointsSource );
331-
size_t globSize[] = {features.size(), basisSize.width, basisSize.height};
331+
CV_Assert(basisSize.width > 0 && basisSize.height > 0);
332+
size_t globSize[] = {features.size(), (size_t)basisSize.width, (size_t)basisSize.height};
332333
kernel
333334
.args( cv::ocl::KernelArg::ReadOnlyNoSize( Mat( features ).getUMat( ACCESS_READ ) ),
334335
cv::ocl::KernelArg::WriteOnlyNoSize( A ), (int)features.size(), (int)basisSize.width,
@@ -376,7 +377,8 @@ void OpticalFlowPCAFlow::getSystem( OutputArray A1Out, OutputArray A2Out, Output
376377
Mat b2 = b2Out.getMat();
377378

378379
ocl::Kernel kernel( "fillDCTSampledPoints", _ocl_fillDCTSampledPointsSource );
379-
size_t globSize[] = {features.size(), basisSize.width, basisSize.height};
380+
CV_Assert(basisSize.width > 0 && basisSize.height > 0);
381+
size_t globSize[] = {features.size(), (size_t)basisSize.width, (size_t)basisSize.height};
380382
kernel
381383
.args( cv::ocl::KernelArg::ReadOnlyNoSize( Mat( features ).getUMat( ACCESS_READ ) ),
382384
cv::ocl::KernelArg::WriteOnlyNoSize( A ), (int)features.size(), (int)basisSize.width,

modules/optflow/src/sparse_matching_gpc.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ bool ocl_getAllDCTDescriptorsForImage( const Mat *imgCh, std::vector< GPCPatchDe
267267
const Size sz = imgCh[0].size();
268268
ocl::Kernel kernel( "getPatchDescriptor", ocl::optflow::sparse_matching_gpc_oclsrc,
269269
format( "-DPATCH_RADIUS_DOUBLED=%d -DCV_PI=%f -DSQRT2_INV=%f", PATCH_RADIUS_DOUBLED, CV_PI, SQRT2_INV ) );
270-
size_t globSize[] = {sz.height - 2 * patchRadius, sz.width - 2 * patchRadius};
270+
CV_Assert(sz.height - 2 * patchRadius > 0);
271+
CV_Assert(sz.width - 2 * patchRadius > 0);
272+
size_t globSize[] = {(size_t)(sz.height - 2 * patchRadius), (size_t)(sz.width - 2 * patchRadius)};
271273
UMat out( globSize[0] * globSize[1], GPCPatchDescriptor::nFeatures, CV_64F );
272274
if (
273275
kernel

modules/ximgproc/samples/colorize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ void drawTrajectoryByReference(cv::Mat& img)
338338

339339
if(drawByReference)
340340
{
341-
cv::circle(img, cv::Point2d(x, y), 0.1, cv::Scalar(blue, green, red), -1);
341+
cv::circle(img, cv::Point2d(x, y), 1, cv::Scalar(blue, green, red), -1);
342342
}
343343
else
344344
{
345-
cv::circle(img, cv::Point2d(x, y), 0.1, cv::Scalar(draw_b, draw_g, draw_r), -1);
345+
cv::circle(img, cv::Point2d(x, y), 1, cv::Scalar(draw_b, draw_g, draw_r), -1);
346346
}
347347
}
348348
}

0 commit comments

Comments
 (0)