mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
OCL: tests: repair moments implementation in master branch, enable tests
This commit is contained in:
parent
b7b584984e
commit
7685b983db
@ -146,7 +146,7 @@ static void icvContourMoments( CvSeq* contour, CvMoments* mom )
|
||||
cl_int dst_step = (cl_int)dst_a.step;
|
||||
args.push_back( std::make_pair( sizeof(cl_int) , (void *)&dst_step ));
|
||||
|
||||
openCLExecuteKernel(dst_a.clCxt, &moments, "icvContourMoments", globalThreads, localThreads, args, -1, -1);
|
||||
openCLExecuteKernel2(dst_a.clCxt, &moments, "icvContourMoments", globalThreads, localThreads, args, -1, -1);
|
||||
|
||||
cv::Mat dst(dst_a);
|
||||
a00 = a10 = a01 = a20 = a11 = a02 = a30 = a21 = a12 = a03 = 0.0;
|
||||
@ -301,7 +301,7 @@ static void ocl_cvMoments( const void* array, CvMoments* mom, int binary )
|
||||
args.push_back( std::make_pair( sizeof(cl_int) , (void *)&coi ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int) , (void *)&binary ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int) , (void *)&TILE_SIZE ));
|
||||
openCLExecuteKernel(Context::getContext(), &moments, "CvMoments", globalThreads, localThreads, args, -1, depth);
|
||||
openCLExecuteKernel2(Context::getContext(), &moments, "CvMoments", globalThreads, localThreads, args, -1, depth);
|
||||
|
||||
size_t localThreadss[3] = { 128, 1, 1};
|
||||
size_t globalThreadss[3] = { 128, 1, 1};
|
||||
@ -310,10 +310,10 @@ static void ocl_cvMoments( const void* array, CvMoments* mom, int binary )
|
||||
args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&tile_height ));
|
||||
args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&tile_width ));
|
||||
args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&TILE_SIZE ));
|
||||
args_sum.push_back( std::make_pair( sizeof(cl_mem) , (void *)&sum ));
|
||||
args_sum.push_back( std::make_pair( sizeof(cl_mem) , (void *)&sum.data ));
|
||||
args_sum.push_back( std::make_pair( sizeof(cl_mem) , (void *)&dst_m.data ));
|
||||
args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&dst_m.step ));
|
||||
openCLExecuteKernel(Context::getContext(), &moments, "dst_sum", globalThreadss, localThreadss, args_sum, -1, -1);
|
||||
openCLExecuteKernel2(Context::getContext(), &moments, "dst_sum", globalThreadss, localThreadss, args_sum, -1, -1);
|
||||
|
||||
Mat dstsum(sum);
|
||||
mom->m00 = dstsum.at<double>(0, 0);
|
||||
|
@ -34,7 +34,7 @@ PARAM_TEST_CASE(MomentsTest, MatType, bool)
|
||||
};
|
||||
|
||||
|
||||
TEST_P(MomentsTest, DISABLED_Mat)
|
||||
TEST_P(MomentsTest, Mat)
|
||||
{
|
||||
bool binaryImage = 0;
|
||||
SetUp();
|
||||
|
Loading…
Reference in New Issue
Block a user