mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 00:19:46 +01:00
stay on fast-path by using INTER_LINEAR resize when ALGO_HINT_APPROX is used
This commit is contained in:
parent
28d410cecf
commit
f81240f57b
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user