fixed bug in gpu::HOGDescriptor::computeConfidenceMultiScale
This commit is contained in:
parent
8abcad6b00
commit
304714862f
@ -319,8 +319,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
|
||||
{
|
||||
scale = conf_out[levels].scale;
|
||||
level_scale.push_back(scale);
|
||||
if (cvRound(img.cols/scale) < win_size.width ||
|
||||
cvRound(img.rows/scale) < win_size.height)
|
||||
if (cvRound(img.cols/scale) < win_size.width || cvRound(img.rows/scale) < win_size.height)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -332,8 +331,8 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
|
||||
|
||||
for (size_t i = 0; i < level_scale.size(); i++)
|
||||
{
|
||||
double _scale = level_scale[i];
|
||||
Size sz(cvRound(img.cols / _scale), cvRound(img.rows / _scale));
|
||||
scale = level_scale[i];
|
||||
Size sz(cvRound(img.cols / scale), cvRound(img.rows / scale));
|
||||
GpuMat smaller_img;
|
||||
|
||||
if (sz == img.size())
|
||||
@ -341,7 +340,8 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
|
||||
else
|
||||
{
|
||||
smaller_img.create(sz, img.type());
|
||||
switch (img.type()) {
|
||||
switch (img.type())
|
||||
{
|
||||
case CV_8UC1: hog::resize_8UC1(img, smaller_img); break;
|
||||
case CV_8UC4: hog::resize_8UC4(img, smaller_img); break;
|
||||
}
|
||||
@ -353,6 +353,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
|
||||
for (size_t j = 0; j < locations.size(); j++)
|
||||
all_candidates.push_back(Rect(Point2d((CvPoint)locations[j]) * scale, scaled_win_size));
|
||||
}
|
||||
|
||||
found_locations.assign(all_candidates.begin(), all_candidates.end());
|
||||
groupRectangles(found_locations, group_threshold, 0.2/*magic number copied from CPU version*/);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user