|
|
|
@ -195,7 +195,7 @@ public: |
|
|
|
|
|
|
|
|
|
namespace |
|
|
|
|
{ |
|
|
|
|
typedef void (*GPUMorfFilter_t)(const oclMat & , oclMat & , oclMat & , Size &, const Point, bool rectKernel, bool usrROI); |
|
|
|
|
typedef void (*GPUMorfFilter_t)(const oclMat & , oclMat & , oclMat & , Size &, const Point, bool rectKernel); |
|
|
|
|
|
|
|
|
|
class MorphFilter_GPU : public BaseFilter_GPU |
|
|
|
|
{ |
|
|
|
@ -205,7 +205,7 @@ public: |
|
|
|
|
|
|
|
|
|
virtual void operator()(const oclMat &src, oclMat &dst) |
|
|
|
|
{ |
|
|
|
|
func(src, dst, kernel, ksize, anchor, rectKernel, false) ; |
|
|
|
|
func(src, dst, kernel, ksize, anchor, rectKernel) ; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
oclMat kernel; |
|
|
|
@ -220,7 +220,7 @@ public: |
|
|
|
|
**Note that the kernel need to be further refined. |
|
|
|
|
*/ |
|
|
|
|
static void GPUErode(const oclMat &src, oclMat &dst, oclMat &mat_kernel,
|
|
|
|
|
Size &ksize, const Point anchor, bool rectKernel, bool useROI) |
|
|
|
|
Size &ksize, const Point anchor, bool rectKernel) |
|
|
|
|
{ |
|
|
|
|
//Normalize the result by default
|
|
|
|
|
//float alpha = ksize.height * ksize.width;
|
|
|
|
@ -276,11 +276,10 @@ static void GPUErode(const oclMat &src, oclMat &dst, oclMat &mat_kernel, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
char compile_option[128]; |
|
|
|
|
sprintf(compile_option, "-D RADIUSX=%d -D RADIUSY=%d -D LSIZE0=%d -D LSIZE1=%d -D ERODE %s %s %s",
|
|
|
|
|
sprintf(compile_option, "-D RADIUSX=%d -D RADIUSY=%d -D LSIZE0=%d -D LSIZE1=%d -D ERODE %s %s",
|
|
|
|
|
anchor.x, anchor.y, (int)localThreads[0], (int)localThreads[1],
|
|
|
|
|
rectKernel?"-D RECTKERNEL":"", |
|
|
|
|
useROI?"-D USEROI":"", |
|
|
|
|
s); |
|
|
|
|
rectKernel?"-D RECTKERNEL":"", |
|
|
|
|
s); |
|
|
|
|
vector< pair<size_t, const void *> > args; |
|
|
|
|
args.push_back(make_pair(sizeof(cl_mem), (void *)&src.data)); |
|
|
|
|
args.push_back(make_pair(sizeof(cl_mem), (void *)&dst.data)); |
|
|
|
@ -300,7 +299,7 @@ static void GPUErode(const oclMat &src, oclMat &dst, oclMat &mat_kernel, |
|
|
|
|
|
|
|
|
|
//! data type supported: CV_8UC1, CV_8UC4, CV_32FC1, CV_32FC4
|
|
|
|
|
static void GPUDilate(const oclMat &src, oclMat &dst, oclMat &mat_kernel,
|
|
|
|
|
Size &ksize, const Point anchor, bool rectKernel, bool useROI) |
|
|
|
|
Size &ksize, const Point anchor, bool rectKernel) |
|
|
|
|
{ |
|
|
|
|
//Normalize the result by default
|
|
|
|
|
//float alpha = ksize.height * ksize.width;
|
|
|
|
@ -357,10 +356,9 @@ static void GPUDilate(const oclMat &src, oclMat &dst, oclMat &mat_kernel, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
char compile_option[128]; |
|
|
|
|
sprintf(compile_option, "-D RADIUSX=%d -D RADIUSY=%d -D LSIZE0=%d -D LSIZE1=%d -D DILATE %s %s %s",
|
|
|
|
|
sprintf(compile_option, "-D RADIUSX=%d -D RADIUSY=%d -D LSIZE0=%d -D LSIZE1=%d -D DILATE %s %s",
|
|
|
|
|
anchor.x, anchor.y, (int)localThreads[0], (int)localThreads[1],
|
|
|
|
|
rectKernel?"-D RECTKERNEL":"", |
|
|
|
|
useROI?"-D USEROI":"", |
|
|
|
|
s); |
|
|
|
|
vector< pair<size_t, const void *> > args; |
|
|
|
|
args.push_back(make_pair(sizeof(cl_mem), (void *)&src.data)); |
|
|
|
|