# Different result of ocl::HOGDescriptor and cv::HOGDescriptor on OpenCV2.4.9

I am trying to modify a previous cpu program to now gpu version.

However, in the previous program, we used cv::HOGDescriptor::compute to get the descriptor, and now I used ocl::HOGDescriptor::getDiscriptors to get the descriptor. However, I compare the two descriptors together, I found that the results are not the same. Actually some dimension are really similar or even equal, but many dimensions really differ a lot.

Here is the code.

    cv::Mat temp_img;
resize(img, temp_img, cv::Size(img.cols*shrinkRatio, img.rows*shrinkRatio));

//gpu
cv::Mat temp_img4ocl;
cvtColor(temp_img, temp_img4ocl, CV_BGR2BGRA);//for gpu

//both
int temp_winStride = winStride*shrinkRatio;

if (mode!=MODE_GPU){
vector<float> temp_dscrpt;
HOG[i].compute(temp_img, temp_dscrpt, cv::Size(temp_winStride, temp_winStride), cv::Size(0,0));
dscrpt[0].push_back(temp_dscrpt);
}

if (mode!=MODE_CPU){
cv::ocl::oclMat temp_ocl_img,temp_ocl_dscrpt;