#include "xf_resize_config.h"
#define nlevels 2
void resize_accel(xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPC_T>& _src, xf::cv::Mat<TYPE, NEWHEIGHT, NEWWIDTH, NPC_T>& _dst) {
unsigned short in_width, in_height;
unsigned short out_width, out_height;
in_width = _src.cols;
in_height = _src.rows;
xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPC_T> imgInput(in_height, in_width);
imgInput.copyTo(_src.data);
for (int level = 0; level < nlevels; ++level) {
out_width = in_width/2;
out_height = in_width/2;
xf::cv::Mat<TYPE, NEWHEIGHT, NEWWIDTH, NPC_T> imgOutput(out_height, out_width);
xf::cv::resize<INTERPOLATION, TYPE, HEIGHT, WIDTH, NEWHEIGHT, NEWWIDTH, NPC_T, MAXDOWNSCALE>(imgInput, imgOutput);
in_width = imgOutput.cols;
in_height = imgOutput.rows;
xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPC_T> imgInput(in_height, in_width);
imgInput.copyTo(imgOutput.data);
if (level == nlevels -1)
_dst.copyTo(imgOutput.data);
}
}
笔记
最新推荐文章于 2024-10-10 07:04:17 发布
本文介绍了一种使用XF OpenCV库实现的图像缩放加速算法。该算法通过多级下采样处理,实现了从源图像到目标图像的快速缩放。文中详细展示了算法流程,包括输入图像尺寸获取、图像复制、多级缩放处理及最终结果输出等关键步骤。
1297

被折叠的 条评论
为什么被折叠?



