int width = (result_size.width + 2) / 3;
int height = (result_size.height + 2) / 3;
width = std::min(width, result_size.width);
- height = std::min(height, result_size.height);
+ height = std::min(height, result_size.height);
return Size(width, height);
}
Size result_roi_size(std::min(x + block_size.width, result.cols) - x,
std::min(y + block_size.height, result.rows) - y);
-
+
Rect roi1(x, y, result_roi_size.width, result_roi_size.height);
Rect roi2(0, 0, result_roi_size.width, result_roi_size.height);
#else
CV_Error(CV_StsNotImplemented, "OpenCL DFT is not implemented");
+#define UNUSED(x) (void)(x);
+ UNUSED(image) UNUSED(templ) UNUSED(result) UNUSED(ccorr) UNUSED(buf)
+#undef UNUSED
#endif
}
static void convolve_run(const oclMat &src, const oclMat &temp1, oclMat &dst, String kernelName, const char **kernelString)
else
return false;
#else
+#define UNUSED(x) (void)(x);
+ UNUSED(method) UNUSED(depth) UNUSED(size)
+#undef UNUSED
return true;
#endif
}
return (cfloat)( a.x, - a.y );
}
-__kernel void
- mulAndScaleSpectrumsKernel(
- __global const cfloat* a,
- __global const cfloat* b,
- float scale,
- __global cfloat* dst,
- uint cols,
- uint rows,
+__kernel void
+mulAndScaleSpectrumsKernel(
+ __global const cfloat* a,
+ __global const cfloat* b,
+ float scale,
+ __global cfloat* dst,
+ uint cols,
+ uint rows,
uint mstep
- )
+)
{
const uint x = get_global_id(0);
const uint y = get_global_id(1);
dst[idx] = (cfloat)( v.x * scale, v.y * scale );
}
}
-__kernel void
- mulAndScaleSpectrumsKernel_CONJ(
- __global const cfloat* a,
- __global const cfloat* b,
- float scale,
- __global cfloat* dst,
- uint cols,
- uint rows,
+__kernel void
+mulAndScaleSpectrumsKernel_CONJ(
+ __global const cfloat* a,
+ __global const cfloat* b,
+ float scale,
+ __global cfloat* dst,
+ uint cols,
+ uint rows,
uint mstep
- )
+)
{
const uint x = get_global_id(0);
const uint y = get_global_id(1);
cv::ocl::oclMat dst;
cv::ocl::convolve(cv::ocl::oclMat(src), cv::ocl::oclMat(kernel), dst, ccorr);
-
+
cv::Mat dst_gold;
convolveDFT(src, kernel, dst_gold, ccorr);