当前位置: 首页 > news >正文

做外链网站做百度推广需要什么条件

做外链网站,做百度推广需要什么条件,网站开发 验收周期,潍坊建站程序背景#xff1a;在目标检测算法中#xff0c; 输入图片等比例resize时mAP比直接resize会高几个点。实现#xff1a;使用c 和opencv实现(之所以没用python#xff0c;是因为用于生产环境)先贴代码#xff1a;#include math.h #include opencv2/core/core.hpp在目标检测算法中 输入图片等比例resize时mAP比直接resize会高几个点。实现使用c 和opencv实现(之所以没用python是因为用于生产环境)先贴代码#include math.h #include opencv2/core/core.hpp #include opencv2/highgui/highgui.hpp #include opencv2/imgproc/imgproc.hpp #include iostreamusing namespace cv;struct object_rect {int x;int y;int width;int height; };int resize_uniform(Mat src, Mat dst, Size dst_size, object_rect effect_area) {int w src.cols;int h src.rows;int dst_w dst_size.width;int dst_h dst_size.height;std::cout src: ( h , w ) std::endl;dst Mat(Size(dst_w, dst_h), CV_8UC3, Scalar(0));float ratio_src w*1.0 / h;float ratio_dst dst_w*1.0 / dst_h;int tmp_w0;int tmp_h0;if (ratio_src ratio_dst) {tmp_w dst_w;tmp_h floor((dst_w*1.0 / w) * h);} else if (ratio_src ratio_dst){tmp_h dst_h;tmp_w floor((dst_h*1.0 / h) * w);} else {resize(src, dst, dst_size);effect_area.x 0;effect_area.y 0;effect_area.width dst_w;effect_area.height dst_h;return 0;}std::cout tmp: ( tmp_h , tmp_w ) std::endl;Mat tmp;resize(src, tmp, Size(tmp_w, tmp_h));if (tmp_w ! dst_w) { //高对齐宽没对齐int index_w floor((dst_w - tmp_w) / 2.0);std::cout index_w: index_w std::endl;for (int i0; idst_h; i) {memcpy(dst.datai*dst_w*3 index_w*3, tmp.datai*tmp_w*3, tmp_w*3);}effect_area.x index_w;effect_area.y 0;effect_area.width tmp_w;effect_area.height tmp_h;} else if (tmp_h ! dst_h) { //宽对齐 高没有对齐int index_h floor((dst_h - tmp_h) / 2.0);std::cout index_h: index_h std::endl;memcpy(dst.dataindex_h*dst_w*3, tmp.data, tmp_w*tmp_h*3);effect_area.x 0;effect_area.y index_h;effect_area.width tmp_w;effect_area.height tmp_h;} else {printf(errorn);}return 0; }int crop_effect_area(Mat uniform_scaled, Mat dst, Size ori_size, object_rect effect_area) {Mat tmp Mat(Size(effect_area.width, effect_area.height), CV_8UC3, Scalar(0));if(effect_area.x 0 effect_area.y 0) {resize(uniform_scaled, dst, ori_size);return 0;} else if (effect_area.x 0) {memcpy(tmp.data, uniform_scaled.dataeffect_area.y*effect_area.width*3, effect_area.width*effect_area.height*3);} else if (effect_area.y 0) {for (int i0; ieffect_area.height; i) {memcpy(tmp.data i*effect_area.width*3, uniform_scaled.datai*uniform_scaled.cols*3effect_area.x*3, effect_area.width*3);}}resize(tmp, dst, ori_size);return 0; }int main() {Mat img imread(test.jpg, 3);Mat dst;object_rect res_area;(void)resize_uniform(img, dst, Size(608, 608), res_area);imwrite(out.jpg, dst);std::cout effectiave area: ( res_area.x , res_area.y , res_area.width , res_area.height ) std::endl;Mat out imread(out.jpg, 3);Mat recov;crop_effect_area(out, recov, Size(img.cols, img.rows), res_area);imwrite(recov.jpg, recov);return 0; } 其中就两个函数1.等比例缩放函数int resize_uniform函数输入原始src图像 输入目的resize大小dst_size 输出等比例resize图像dst, 以及等比例缩放后图像的有效区域effect_area(有效区域的左上角和长宽)下图分别是原始图像和resize_uniform函数处理后的dst图像原始图像: 333*500等比例缩放后的图像608*608 有效区域(x:0, y:102, w:608, h:404)2. 等比例恢复函数int crop_effect_area(Mat uniform_scaled, Mat dst, Size ori_size, object_rect effect_area)crop_effect_area函数输入等比例缩放后的图像uniform_scaled 以及等比例缩放之前的原始图像大小ori_size 等比例缩放后的有效区域effect_area 输出为crop掉等比例缩放后的图像的黑边然后resize到原始图像大小。恢复后的图
http://www.pierceye.com/news/346924/

相关文章:

  • 产品单页营销型网站模板下载codex.wordpress.org
  • 河南省和城乡建设厅网站网站备案添加域名
  • 网站建设公司地址在哪济南网站建站公司
  • 图片瀑布流网站模板哪里有html5网站建设
  • 做韩国网站可以做推广的网站有哪些
  • 阳泉哪里做网站传统企业如何做好网络推广
  • 做网站不赚钱潍坊制作网站的公司
  • 网站城市切换代码手机微信官方网站
  • 福州建设招聘信息网站动漫设计专业哪个学校比较好
  • 网站建设需要哪些准备wordpress调用单页面跳转
  • 小公司使用的网站开发电子商务毕业设计 网站建设
  • 简单的个人网站模板网站建设费记什么科目
  • 中国建设银行宁波分行网站一般网站空间要多大
  • 做简单视频网站自己看廊坊专门做网站
  • 做贸易网站科技型中小企业服务平台登录
  • 网站怎么接广告赚钱net创建网站之后怎么做
  • 做网站如何让盈利wordpress链接样式表
  • 网站建设与管理计划谷歌浏览器官网下载手机版
  • 做请帖的网站上海阳性增多
  • 有回定ip怎么做网站青岛建设集团招聘信息网站
  • 淘宝内部卷网站怎么做智慧团建网站登录忘记密码
  • 网站建设前十名建站系统cms
  • 第三方网站开发的商家厦门广告公司网站建设
  • 网站建设基础条件临猗网站制作
  • 建设博客网站步骤常州网站建设百科
  • 门户网站 管理系统wordpress 微信图标
  • 广元网站建设广元莱芜论坛二手车
  • 山东省建设工程质量监督网站广州软件合作中心
  • 郑州网站建设怎么样通州建设局网站
  • 免费网站建设福州怎么修改网站主页