1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Optimization for getLines

This commit is contained in:
Alexander Karsakov
2014-09-05 11:37:16 +04:00
parent fee8f29f48
commit d59a6fa518
2 changed files with 22 additions and 16 deletions
+2 -1
View File
@@ -728,6 +728,7 @@ static bool ocl_HoughLines(InputArray _src, OutputArray _lines, double rho, doub
if (!fillAccumKernel.run(2, globalThreads, fillAccumLT, false))
return false;
const int pixPerWI = 8;
ocl::Kernel getLinesKernel("get_lines", ocl::imgproc::hough_lines_oclsrc,
format("-D GET_LINES"));
if (getLinesKernel.empty())
@@ -740,7 +741,7 @@ static bool ocl_HoughLines(InputArray _src, OutputArray _lines, double rho, doub
getLinesKernel.args(ocl::KernelArg::ReadOnly(accum), ocl::KernelArg::WriteOnlyNoSize(lines),
ocl::KernelArg::PtrWriteOnly(counters), linesMax, threshold, (float) rho, (float) theta);
globalThreads[0] = numrho; globalThreads[1] = numangle;
globalThreads[0] = (numrho + pixPerWI - 1)/pixPerWI; globalThreads[1] = numangle;
if (!getLinesKernel.run(2, globalThreads, NULL, false))
return false;