diff --git a/modules/gpu/test/nvidia/NCVTest.hpp b/modules/gpu/test/nvidia/NCVTest.hpp index b8c2d9729..00be0f0d1 100644 --- a/modules/gpu/test/nvidia/NCVTest.hpp +++ b/modules/gpu/test/nvidia/NCVTest.hpp @@ -124,8 +124,8 @@ private: bool initMemory(NCVTestReport &report) { - this->allocatorGPU.reset(new NCVMemStackAllocator(devProp.textureAlignment)); - this->allocatorCPU.reset(new NCVMemStackAllocator(devProp.textureAlignment)); + this->allocatorGPU.reset(new NCVMemStackAllocator(static_cast(devProp.textureAlignment))); + this->allocatorCPU.reset(new NCVMemStackAllocator(static_cast(devProp.textureAlignment))); if (!this->allocatorGPU.get()->isInitialized() || !this->allocatorCPU.get()->isInitialized()) @@ -146,9 +146,9 @@ private: report.statsNums["MemGPU"] = maxGPUsize; report.statsNums["MemCPU"] = maxCPUsize; - this->allocatorGPU.reset(new NCVMemStackAllocator(NCVMemoryTypeDevice, maxGPUsize, devProp.textureAlignment)); + this->allocatorGPU.reset(new NCVMemStackAllocator(NCVMemoryTypeDevice, maxGPUsize, static_cast(devProp.textureAlignment))); - this->allocatorCPU.reset(new NCVMemStackAllocator(NCVMemoryTypeHostPinned, maxCPUsize, devProp.textureAlignment)); + this->allocatorCPU.reset(new NCVMemStackAllocator(NCVMemoryTypeHostPinned, maxCPUsize, static_cast(devProp.textureAlignment))); if (!this->allocatorGPU.get()->isInitialized() || !this->allocatorCPU.get()->isInitialized()) diff --git a/modules/gpu/test/nvidia/NCVTestSourceProvider.hpp b/modules/gpu/test/nvidia/NCVTestSourceProvider.hpp index f4f9a392e..99ea6682b 100644 --- a/modules/gpu/test/nvidia/NCVTestSourceProvider.hpp +++ b/modules/gpu/test/nvidia/NCVTestSourceProvider.hpp @@ -35,7 +35,7 @@ public: //Ncv32u maxWpitch = alignUp(maxWidth * sizeof(T), devProp.textureAlignment); - allocatorCPU.reset(new NCVMemNativeAllocator(NCVMemoryTypeHostPinned, devProp.textureAlignment)); + allocatorCPU.reset(new NCVMemNativeAllocator(NCVMemoryTypeHostPinned, static_cast(devProp.textureAlignment))); data.reset(new NCVMatrixAlloc(*this->allocatorCPU.get(), maxWidth, maxHeight)); ncvAssertPrintReturn(data.get()->isMemAllocated(), "NCVTestSourceProvider ctor:: Matrix not allocated", ); @@ -70,7 +70,7 @@ public: ncvAssertPrintReturn(cudaSuccess == cudaGetDevice(&devId), "Error returned from cudaGetDevice", ); ncvAssertPrintReturn(cudaSuccess == cudaGetDeviceProperties(&devProp, devId), "Error returned from cudaGetDeviceProperties", ); - allocatorCPU.reset(new NCVMemNativeAllocator(NCVMemoryTypeHostPinned, devProp.textureAlignment)); + allocatorCPU.reset(new NCVMemNativeAllocator(NCVMemoryTypeHostPinned, static_cast(devProp.textureAlignment))); data.reset(new NCVMatrixAlloc(*this->allocatorCPU.get(), image.cols, image.rows)); ncvAssertPrintReturn(data.get()->isMemAllocated(), "NCVTestSourceProvider ctor:: Matrix not allocated", ); diff --git a/modules/gpu/test/nvidia/TestHypothesesFilter.cpp b/modules/gpu/test/nvidia/TestHypothesesFilter.cpp index c75890d22..4785abae4 100644 --- a/modules/gpu/test/nvidia/TestHypothesesFilter.cpp +++ b/modules/gpu/test/nvidia/TestHypothesesFilter.cpp @@ -132,7 +132,7 @@ bool TestHypothesesFilter::process() } NCV_SKIP_COND_END - Ncv32u numHypothesesSrc = h_vecSrc.length(); + Ncv32u numHypothesesSrc = static_cast(h_vecSrc.length()); NCV_SKIP_COND_BEGIN ncvStat = ncvGroupRectangles_host(h_vecSrc, numHypothesesSrc, this->minNeighbors, this->eps, NULL); ncvAssertReturn(ncvStat == NCV_SUCCESS, false); diff --git a/modules/gpu/test/test_arithm.cpp b/modules/gpu/test/test_arithm.cpp index 0c7494fd2..a8fcccdca 100644 --- a/modules/gpu/test/test_arithm.cpp +++ b/modules/gpu/test/test_arithm.cpp @@ -1486,7 +1486,7 @@ struct BitwiseNot : testing::TestWithParam< std::tr1::tuple(mat.cols * mat.elemSize()), CV_8U, (void*)mat.ptr(i)); rng.fill(row, cv::RNG::UNIFORM, cv::Scalar(0), cv::Scalar(255)); } @@ -1547,10 +1547,10 @@ struct BitwiseOr : testing::TestWithParam< std::tr1::tuple(mat1.cols * mat1.elemSize()), CV_8U, (void*)mat1.ptr(i)); rng.fill(row1, cv::RNG::UNIFORM, cv::Scalar(0), cv::Scalar(255)); - cv::Mat row2(1, mat2.cols * mat2.elemSize(), CV_8U, (void*)mat2.ptr(i)); + cv::Mat row2(1, static_cast(mat2.cols * mat2.elemSize()), CV_8U, (void*)mat2.ptr(i)); rng.fill(row2, cv::RNG::UNIFORM, cv::Scalar(0), cv::Scalar(255)); } @@ -1611,10 +1611,10 @@ struct BitwiseAnd : testing::TestWithParam< std::tr1::tuple(mat1.cols * mat1.elemSize()), CV_8U, (void*)mat1.ptr(i)); rng.fill(row1, cv::RNG::UNIFORM, cv::Scalar(0), cv::Scalar(255)); - cv::Mat row2(1, mat2.cols * mat2.elemSize(), CV_8U, (void*)mat2.ptr(i)); + cv::Mat row2(1, static_cast(mat2.cols * mat2.elemSize()), CV_8U, (void*)mat2.ptr(i)); rng.fill(row2, cv::RNG::UNIFORM, cv::Scalar(0), cv::Scalar(255)); } @@ -1675,10 +1675,10 @@ struct BitwiseXor : testing::TestWithParam< std::tr1::tuple(mat1.cols * mat1.elemSize()), CV_8U, (void*)mat1.ptr(i)); rng.fill(row1, cv::RNG::UNIFORM, cv::Scalar(0), cv::Scalar(255)); - cv::Mat row2(1, mat2.cols * mat2.elemSize(), CV_8U, (void*)mat2.ptr(i)); + cv::Mat row2(1, static_cast(mat2.cols * mat2.elemSize()), CV_8U, (void*)mat2.ptr(i)); rng.fill(row2, cv::RNG::UNIFORM, cv::Scalar(0), cv::Scalar(255)); } diff --git a/modules/gpu/test/test_features2d.cpp b/modules/gpu/test/test_features2d.cpp index 0479cc2fa..5e9f22ef4 100644 --- a/modules/gpu/test/test_features2d.cpp +++ b/modules/gpu/test/test_features2d.cpp @@ -143,7 +143,7 @@ TEST_P(SURF, Accuracy) cv::BruteForceMatcher< cv::L2 > matcher; std::vector matches; - matcher.match(cv::Mat(keypoints_gold.size(), 64, CV_32FC1, &descriptors_gold[0]), descriptors, matches); + matcher.match(cv::Mat(static_cast(keypoints_gold.size()), 64, CV_32FC1, &descriptors_gold[0]), descriptors, matches); int validCount = 0; diff --git a/modules/stitching/matchers.cpp b/modules/stitching/matchers.cpp index 9a7c0e12e..12a8ba253 100644 --- a/modules/stitching/matchers.cpp +++ b/modules/stitching/matchers.cpp @@ -397,8 +397,8 @@ void BestOf2NearestMatcher::match(const ImageFeatures &features1, const ImageFea return; // Construct point-point correspondences for homography estimation - Mat src_points(1, matches_info.matches.size(), CV_32FC2); - Mat dst_points(1, matches_info.matches.size(), CV_32FC2); + Mat src_points(1, static_cast(matches_info.matches.size()), CV_32FC2); + Mat dst_points(1, static_cast(matches_info.matches.size()), CV_32FC2); for (size_t i = 0; i < matches_info.matches.size(); ++i) { const DMatch& m = matches_info.matches[i]; @@ -406,12 +406,12 @@ void BestOf2NearestMatcher::match(const ImageFeatures &features1, const ImageFea Point2f p = features1.keypoints[m.queryIdx].pt; p.x -= features1.img_size.width * 0.5f; p.y -= features1.img_size.height * 0.5f; - src_points.at(0, i) = p; + src_points.at(0, static_cast(i)) = p; p = features2.keypoints[m.trainIdx].pt; p.x -= features2.img_size.width * 0.5f; p.y -= features2.img_size.height * 0.5f; - dst_points.at(0, i) = p; + dst_points.at(0, static_cast(i)) = p; } // Find pair-wise motion diff --git a/modules/stitching/motion_estimators.cpp b/modules/stitching/motion_estimators.cpp index 763c4a68d..08d1aaec2 100644 --- a/modules/stitching/motion_estimators.cpp +++ b/modules/stitching/motion_estimators.cpp @@ -405,7 +405,7 @@ vector leaveBiggestComponent(vector &features, vector(max_element(comps.size.begin(), comps.size.end()) - comps.size.begin()); vector indices; vector indices_removed; @@ -423,8 +423,8 @@ vector leaveBiggestComponent(vector &features, vector(i); + pairwise_matches_subset.back().dst_img_idx = static_cast(j); } } diff --git a/samples/gpu/cascadeclassifier_nvidia_api.cpp b/samples/gpu/cascadeclassifier_nvidia_api.cpp index 7c6cbc0dc..923e0a302 100644 --- a/samples/gpu/cascadeclassifier_nvidia_api.cpp +++ b/samples/gpu/cascadeclassifier_nvidia_api.cpp @@ -212,9 +212,9 @@ int main(int argc, const char** argv) // //============================================================================== - NCVMemNativeAllocator gpuCascadeAllocator(NCVMemoryTypeDevice, devProp.textureAlignment); + NCVMemNativeAllocator gpuCascadeAllocator(NCVMemoryTypeDevice, static_cast(devProp.textureAlignment)); ncvAssertPrintReturn(gpuCascadeAllocator.isInitialized(), "Error creating cascade GPU allocator", -1); - NCVMemNativeAllocator cpuCascadeAllocator(NCVMemoryTypeHostPinned, devProp.textureAlignment); + NCVMemNativeAllocator cpuCascadeAllocator(NCVMemoryTypeHostPinned, static_cast(devProp.textureAlignment)); ncvAssertPrintReturn(cpuCascadeAllocator.isInitialized(), "Error creating cascade CPU allocator", -1); Ncv32u haarNumStages, haarNumNodes, haarNumFeatures; @@ -252,9 +252,9 @@ int main(int argc, const char** argv) // //============================================================================== - NCVMemStackAllocator gpuCounter(devProp.textureAlignment); + NCVMemStackAllocator gpuCounter(static_cast(devProp.textureAlignment)); ncvAssertPrintReturn(gpuCounter.isInitialized(), "Error creating GPU memory counter", -1); - NCVMemStackAllocator cpuCounter(devProp.textureAlignment); + NCVMemStackAllocator cpuCounter(static_cast(devProp.textureAlignment)); ncvAssertPrintReturn(cpuCounter.isInitialized(), "Error creating CPU memory counter", -1); ncvStat = process(NULL, frameSize.width, frameSize.height, @@ -264,9 +264,9 @@ int main(int argc, const char** argv) gpuCounter, cpuCounter, devProp); ncvAssertPrintReturn(ncvStat == NCV_SUCCESS, "Error in memory counting pass", -1); - NCVMemStackAllocator gpuAllocator(NCVMemoryTypeDevice, gpuCounter.maxSize(), devProp.textureAlignment); + NCVMemStackAllocator gpuAllocator(NCVMemoryTypeDevice, gpuCounter.maxSize(), static_cast(devProp.textureAlignment)); ncvAssertPrintReturn(gpuAllocator.isInitialized(), "Error creating GPU memory allocator", -1); - NCVMemStackAllocator cpuAllocator(NCVMemoryTypeHostPinned, cpuCounter.maxSize(), devProp.textureAlignment); + NCVMemStackAllocator cpuAllocator(NCVMemoryTypeHostPinned, cpuCounter.maxSize(), static_cast(devProp.textureAlignment)); ncvAssertPrintReturn(cpuAllocator.isInitialized(), "Error creating CPU memory allocator", -1); printf("Initialized for frame size [%dx%d]\n", frameSize.width, frameSize.height);