Commit 5772cb52 authored by grundman's avatar grundman

Update imgwarp.cpp

Check for identity resize => use copy instead (1.37 ms -> 0.07 ms on 720p)
parent 7172c164
...@@ -3257,6 +3257,12 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize, ...@@ -3257,6 +3257,12 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
Mat src = _src.getMat(); Mat src = _src.getMat();
_dst.create(dsize, src.type()); _dst.create(dsize, src.type());
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();
if (dsize == ssize) {
// Source and destination are of same size. Use simple copy.
src.copyTo(dst);
return;
}
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if (tegra::useTegra() && tegra::resize(src, dst, (float)inv_scale_x, (float)inv_scale_y, interpolation)) if (tegra::useTegra() && tegra::resize(src, dst, (float)inv_scale_x, (float)inv_scale_y, interpolation))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment