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

网络推广工资外贸seo搜索优化

网络推广工资,外贸seo搜索优化,建材网站建设成都,wordpress的title设置研究目的 最近在做无人机遥感红外和可见光双路数据配准,由于红外相机视野范围较小,因此配准的目的主要是在可见光的视野范围内,裁剪出红外图像对应的部分,同时,保持可见光的高分辨率不变。 本文思路 本文尝试使用Ca…

研究目的

最近在做无人机遥感红外和可见光双路数据配准,由于红外相机视野范围较小,因此配准的目的主要是在可见光的视野范围内,裁剪出红外图像对应的部分,同时,保持可见光的高分辨率不变。

本文思路

本文尝试使用Canny边缘检测提取红外和可见光的边缘特征,然后使用模板匹配的方式去进行配准。由于红外图像和可见光图像的分辨率并不相同,因此需要对可见光不断进行下采样,以接近红外图像的分辨率。

总体看来,使用传统方法做跨模态配准效果有限,主要是由于红外图像特征较少,不过在光照充足和建筑特征明显的情况下,有一定效果,后续会采用基于深度学习的配准方法,相关图片由于项目原因不对外公布,这里对代码进行归档。

实验代码

import numpy as np
import argparse
import cv2
import osif __name__ == '__main__':ap = argparse.ArgumentParser()ap.add_argument("-i", "--image", required=False, default=r"lr/Infrared.jpg", help="红外图像路径")ap.add_argument("-v", "--visualize", required=False, default=r"rgb/Zoom.jpg", help="可见光图像路径")ap.add_argument("-o", "--output", required=False, default=r"output", help="输出文件夹路径")args = vars(ap.parse_args())# 读取红外图像/灰度化/边缘检测template = cv2.imread(args["image"])template = cv2.cvtColor(template, cv2.COLOR_BGR2GRAY)template = cv2.Canny(template, 50, 200)(tH, tW) = template.shape[:2]# 读取可见光图像image = cv2.imread(args["visualize"])# image = cv2.resize(image, (tW, tH))gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)found = Nonefor scale in np.linspace(0.2, 1.0, 20)[::-1]:# 多尺度缩小可见光图像resized = cv2.resize(gray, (int(gray.shape[1] * scale), int(gray.shape[0] * scale)))r = gray.shape[1] / float(resized.shape[1])# 若缩小的尺度小于红外图像尺寸,跳出循环if resized.shape[0] < tH or resized.shape[1] < tW:break# 对缩小之后的图像进行边缘检测edged = cv2.Canny(resized, 50, 200)'''cv2.matchTemplate  模板匹配:param 检测图像 模板 模板匹配方法:returns 相似度结果矩阵:(宽: image.shape[1]-template.shape[1]+1; 高:image.shape[0]-template.shape[0]+1)'''result = cv2.matchTemplate(edged, template, cv2.TM_CCOEFF)# print("edged_shape:{}".format(edged.shape))  # (3888, 5184)# print("template_shape:{}".format(template.shape))  # (512, 640)# print("result_shape:{}".format(result.shape))  # (3377, 4545)# 查找模板中最大相似度值和位置_, maxVal, _, maxLoc = cv2.minMaxLoc(result)# 可选:查看匹配图范围# clone = np.dstack([edged, edged, edged])# clone = edged# cv2.rectangle(clone, (maxLoc[0], maxLoc[1]), (maxLoc[0] + tW, maxLoc[1] + tH), (0, 0, 255), 2)# cv2.imwrite(os.path.join(args["output"], "Visualize", "visualize.jpg"), clone)# 若在裁剪区域找到相似度更高的匹配点,更新foundif found is None or maxVal > found[0]:found = (maxVal, maxLoc, r)# 得到匹配度最高的矩阵框坐标_, maxLoc, r = found(startX, startY) = (int(maxLoc[0] * r), int(maxLoc[1] * r))(endX, endY) = (int((maxLoc[0] + tW) * r), int((maxLoc[1] + tH) * r))# cv2.rectangle(image, (startX, startY), (endX, endY), (0, 0, 255), 2)crop_img = image[startY:endY, startX:endX]# cv2.imshow("Image", image)# cv2.imshow("Crop Image", crop_img)# cv2.waitKey(0)thermal_image = cv2.imread(args["image"], cv2.IMREAD_COLOR)# cropping out the matched part of the thermal imagecrop_img = cv2.resize(crop_img, (thermal_image.shape[1], thermal_image.shape[0]))# 创建输出文件夹存储裁剪后的可见光影像if not os.path.exists(os.path.join(args["output"], "process")):os.mkdir(os.path.join(args["output"], "process"))# 保存图片cv2.imwrite(os.path.join(args["output"], "process", os.path.basename(args["visualize"])), crop_img)# 创建对比图像final = np.concatenate((crop_img, thermal_image), axis=1)if not os.path.exists(os.path.join(args["output"], "results")):os.mkdir(os.path.join(args["output"], "results"))cv2.imwrite(os.path.join(args["output"], "results", os.path.basename(args["visualize"])), final)
http://www.15wanjia.com/news/161491.html

相关文章:

  • wordpress站点app开发如何做好网站的优化
  • discuz 网站搬家建设银行深圳天健世纪支行网站
  • 地产平台网站模板公司网站建设行为规定
  • 网站开发前的准备工作包头seo哪家好
  • 阜宁县住房城乡建设局网站做网站的工资高吗
  • 建立网站的主要方式阿里云网站建设考试题目
  • 微信网站模板下载池州网站建设制作报价方案
  • 大庆建设大厦网站四川省建设厅网站在线申报
  • 做一个网站建设的流程网站建设文字教程
  • 中山哪家建网站好做电商网站电商公司
  • 免费做祝福网站邢台123生活信息
  • 织梦网站开发视频wordpress flexslider
  • 如何用ps做网站平面图全国前十名校程序开发公司
  • 营销型网站建设ppt模板广州花都区
  • 东莞做网站的公司吗网站建设技术网站建设
  • 深圳企业建站系统模板怎样做原创短视频网站
  • 南昌网站建设公司市场静安网站建设哪里有
  • 网站做支付宝 微信模块外包app开发定制
  • 模板网站好还是定制网站好机械设计最好的三维软件
  • wordpress基础主题站个人想做外贸怎么做
  • 做网站的步骤的文本吉林省城乡建设部网站
  • 移动网站建设查询正保建设工程网站
  • 网站开发seo规范曹县有没有做网站
  • 垂直类门户网站网站后台管理系统制作软件
  • 用织梦模板做网站南头企业网站建设公司
  • 衡水公司建网站费用有哪些网站做美食的图片很精致
  • 阿里巴巴网站头像你会放什么做头像建站seo课程
  • 学校网站建设方案设计建设自己的淘宝优惠券网站
  • 深圳网站建设uecenteros7 安装wordpress
  • 工装效果图网站河南做网站公司汉狮