troy 发表于 2019-12-27 16:56
因为视频图片在预测前会被resize成416x416,正常情况显示的应该是resize后的图像,但是代码中为了显示效果, ...
- if(x1 < 0) x1 = 0;
- if(x2> img.cols-1) x2 = img.cols-1;
- if(y1 < 0) y1 = 0;
- if(x2 > img.rows-1) x2 = img.rows-1;
复制代码
应改为:- if(x1 < 0) x1 = 0;
- if(x2> img.cols-1) x2 = img.cols-1;
- if(y1 < 0) y1 = 0;
- if(y2 > img.rows-1) y2 = img.rows-1;
复制代码
然后在run_process函数中将outputs_transform(outputs, net_width, net_height, dets);的net_width, net_height改成输出图片的宽高即可。appleUncle 发表于 2019-12-30 10:04
经检查,是给的demo代码有误,
在draw_img函数中:
应改为:然后在run_process函数中将outputs_transform(o ...
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |