1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #27706 from kallaballa:enable_hog_with_inter_linear

HOG: stay on fast-path by using INTER_LINEAR resize when ALGO_HINT_APPROX is defined
This commit is contained in:
Alexander Smorkalov
2025-08-29 13:14:20 +03:00
committed by GitHub
+8 -1
View File
@@ -1668,9 +1668,16 @@ public:
Size sz(cvRound(img.cols/scale), cvRound(img.rows/scale));
Mat smallerImg(sz, img.type(), smallerImgBuf.ptr());
if( sz == img.size() )
{
smallerImg = Mat(sz, img.type(), img.data, img.step);
}
else
resize(img, smallerImg, sz, 0, 0, INTER_LINEAR_EXACT);
{
if(getDefaultAlgorithmHint() == ALGO_HINT_APPROX)
resize(img, smallerImg, sz, 0, 0, INTER_LINEAR);
else
resize(img, smallerImg, sz, 0, 0, INTER_LINEAR_EXACT);
}
hog->detect(smallerImg, locations, hitsWeights, hitThreshold, winStride, padding);
Size scaledWinSize = Size(cvRound(hog->winSize.width*scale), cvRound(hog->winSize.height*scale));