/ block_stride_x;
int img_block_height = (height - CELLS_PER_BLOCK_Y * CELL_HEIGHT + block_stride_y)
/ block_stride_y;
+ int blocks_total = img_block_width * img_block_height;
int grad_quadstep = grad.step >> 2;
int qangle_step = qangle.step;
int hists_size = (nbins * CELLS_PER_BLOCK_X * CELLS_PER_BLOCK_Y * 12) * sizeof(float);
int final_hists_size = (nbins * CELLS_PER_BLOCK_X * CELLS_PER_BLOCK_Y) * sizeof(float);
- int smem = hists_size + final_hists_size;
- args.push_back( std::make_pair( sizeof(cl_int), (void *)&width));
+ int smem = (hists_size + final_hists_size) * blocks_in_group;
+
args.push_back( std::make_pair( sizeof(cl_int), (void *)&cblock_stride_x));
args.push_back( std::make_pair( sizeof(cl_int), (void *)&cblock_stride_y));
args.push_back( std::make_pair( sizeof(cl_int), (void *)&cnbins));
args.push_back( std::make_pair( sizeof(cl_int), (void *)&cblock_hist_size));
args.push_back( std::make_pair( sizeof(cl_int), (void *)&img_block_width));
+ args.push_back( std::make_pair( sizeof(cl_int), (void *)&blocks_in_group));
+ args.push_back( std::make_pair( sizeof(cl_int), (void *)&blocks_total));
args.push_back( std::make_pair( sizeof(cl_int), (void *)&grad_quadstep));
args.push_back( std::make_pair( sizeof(cl_int), (void *)&qangle_step));
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&grad.data));
String kernelName;
int block_hist_size = nbins * CELLS_PER_BLOCK_X * CELLS_PER_BLOCK_Y;
- int nthreads = power_2up(block_hist_size);
-
- int img_block_width = (width - CELLS_PER_BLOCK_X * CELL_WIDTH + block_stride_x) / block_stride_x;
- int img_block_height = (height - CELLS_PER_BLOCK_Y * CELL_HEIGHT + block_stride_y) / block_stride_y;
- size_t globalThreads[3] = { img_block_width * nthreads, img_block_height, 1 };
- size_t localThreads[3] = { nthreads, 1, 1 };
+ int img_block_width = (width - CELLS_PER_BLOCK_X * CELL_WIDTH + block_stride_x)
+ / block_stride_x;
+ int img_block_height = (height - CELLS_PER_BLOCK_Y * CELL_HEIGHT + block_stride_y)
+ / block_stride_y;
+ int nthreads;
+ size_t globalThreads[3] = { 1, 1, 1 };
+ size_t localThreads[3] = { 1, 1, 1 };
if ( nbins == 9 )
{
#include "precomp.hpp"
#include <iostream>
+#include "opencv2/imgproc/types_c.h"
+#include "opencv2/imgproc/imgproc_c.h"
namespace cv
{
{
extern const char *moments;
-#if 0
// The function calculates center of gravity and the central second order moments
static void icvCompleteMomentState( CvMoments* moments )
{
openCLExecuteKernel(Context::getContext(), &moments, "dst_sum", globalThreadss, localThreadss, args_sum, -1, -1);
Mat dstsum(sum);
- mom->m00 = dstsum[0];
- mom->m10 = dstsum[1];
- mom->m01 = dstsum[2];
- mom->m20 = dstsum[3];
- mom->m11 = dstsum[4];
- mom->m02 = dstsum[5];
- mom->m30 = dstsum[6];
- mom->m21 = dstsum[7];
- mom->m12 = dstsum[8];
- mom->m03 = dstsum[9];
+ mom->m00 = dstsum.at<double>(0, 0);
+ mom->m10 = dstsum.at<double>(0, 1);
+ mom->m01 = dstsum.at<double>(0, 2);
+ mom->m20 = dstsum.at<double>(0, 3);
+ mom->m11 = dstsum.at<double>(0, 4);
+ mom->m02 = dstsum.at<double>(0, 5);
+ mom->m30 = dstsum.at<double>(0, 6);
+ mom->m21 = dstsum.at<double>(0, 7);
+ mom->m12 = dstsum.at<double>(0, 8);
+ mom->m03 = dstsum.at<double>(0, 9);
icvCompleteMomentState( mom );
}
-#endif
Moments ocl_moments( InputArray _array, bool binaryImage )
{
-#if 0
CvMoments om;
Mat arr = _array.getMat();
CvMat c_array = arr;
ocl_cvMoments(&c_array, &om, binaryImage);
return om;
-#endif
- CV_Error(Error::StsNotImplemented, "ocl_moments is not implemented");
- (void)_array;
- (void)binaryImage;
- return Moments();
}
}
#ifdef HAVE_OPENCL
-using namespace std;
using namespace cv;
using namespace cv::ocl;
using namespace cvtest;
using namespace testing;
+using std::cout;
+using std::endl;
void print_info()
{
CommandLineParser cmd(argc, argv, keys);
if (cmd.get<string>("h")=="true")
{
- cout << "Avaible options besides goole test option:" << endl;
+ cout << "Available options besides google test options:" << endl;
cmd.printMessage();
return 0;
}
- string type = cmd.get<string>("t");
+ string type = cmd.get<String>("t");
unsigned int pid = cmd.get<unsigned int>("p");
int device = cmd.get<int>("d");
using namespace cv::ocl;
using namespace cvtest;
using namespace testing;
-using namespace std;
-extern string workdir;
+
PARAM_TEST_CASE(MomentsTest, MatType, bool)
{
int type;
};
-TEST_P(MomentsTest, Mat)
+TEST_P(MomentsTest, DISABLED_Mat)
{
bool binaryImage = 0;
SetUp();
cv::Moments oclMom = cv::ocl::ocl_moments(_array, binaryImage);
Compare(CvMom, oclMom);
-
}
}
INSTANTIATE_TEST_CASE_P(OCL_ImgProc, MomentsTest, Combine(
Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_64FC1), Values(true,false)));
+
#endif // HAVE_OPENCL
#include "test_precomp.hpp"
#include "opencv2/objdetect.hpp"
-using namespace std;
using namespace cv;
using namespace testing;
#ifdef HAVE_OPENCL
-extern string workdir;
-
///////////////////// HOG /////////////////////////////
PARAM_TEST_CASE(HOG, Size, int)
{
int flags;
std::string cascadeName;
- vector<Rect> faces, oclfaces;
+ std::vector<Rect> faces, oclfaces;
Mat img;
ocl::oclMat d_img;
virtual void SetUp()
{
flags = GET_PARAM(0);
- cascadeName = (string(cvtest::TS::ptr()->get_data_path()) + "cv/cascadeandhog/cascades/").append(GET_PARAM(1));
+ cascadeName = (std::string(cvtest::TS::ptr()->get_data_path()) + "cv/cascadeandhog/cascades/").append(GET_PARAM(1));
ASSERT_TRUE(cascade.load( cascadeName ));
ASSERT_TRUE(cpucascade.load(cascadeName));
img = readImage("cv/shared/lena.png", IMREAD_GRAYSCALE);
using namespace cv::ocl;
using namespace cvtest;
using namespace testing;
-using namespace std;
-
-extern string workdir;
-
//////////////////////////////////////////////////////
// GoodFeaturesToTrack
};
-TEST_P(TVL1, Accuracy)
+TEST_P(TVL1, DISABLED_Accuracy) // TODO implementations of TV1 in video module are different in 2.4 and master branches
{
cv::Mat frame0 = readImage("gpu/opticalflow/rubberwhale1.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(frame0.empty());