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

怎样讲卖灯的网站做的好seo优化推广多少钱

怎样讲卖灯的网站做的好,seo优化推广多少钱,务川县建设局官方网站,网站开发功能报价百度文库背景 已知相机参数(传感器宽度和高度、图像宽度和高度、焦距、相对航高、像主点坐标 ),在给定像素坐标的前提下,求世界坐标,大部分通过AI来实现,不知道哪个步骤有问题,望大家指正 脚本 impor…

背景

已知相机参数(传感器宽度和高度、图像宽度和高度、焦距、相对航高、像主点坐标 ),在给定像素坐标的前提下,求世界坐标,大部分通过AI来实现,不知道哪个步骤有问题,望大家指正

脚本

import numpy as np
import cv2# 畸变校正
def undistort_pixel(pixel_x, pixel_y, sym_dist, dec_dist):k0,k1,k2,k3=sym_dist# k1, k2, p1, p2, k3 = sym_distp1,p2,p3=dec_distfx = focal_length_mmfy = focal_length_mmcx = xpoff_pxcy = ypoff_pxdistCoeffs = np.array([k1, k2, p1, p2,k3])cameraMatrix = np.array([[fx, 0, cx], [0, fy, cy], [0, 0, 1]])distorted_points = np.array([[pixel_x, pixel_y]], dtype=np.float32)undistorted_points = cv2.undistortPoints(distorted_points, cameraMatrix, distCoeffs)#################################################### 4\对图像去畸变img = cv2.imread('./images/100_0004_0001.JPG')img_undistored = cv2.undistort(img, cameraMatrix, distCoeffs)cv2.imwrite('./images/100_0004_00011.JPG', img_undistored)return undistorted_points[0][0][0], undistorted_points[0][0][1]# 相机坐标转世界坐标
def camera_to_world_coordinates(cam_coords, pos):# 获取相机到世界的转换参数pos_x, pos_y, pos_z, roll, pitch, yaw = pos# 将角度转换为弧度roll = np.radians(roll)pitch = np.radians(pitch)yaw = np.radians(yaw)# 计算旋转矩阵R_roll = np.array([[1, 0, 0],[0, np.cos(roll), -np.sin(roll)],[0, np.sin(roll), np.cos(roll)]])R_pitch = np.array([[np.cos(pitch), 0, np.sin(pitch)],[0, 1, 0],[-np.sin(pitch), 0, np.cos(pitch)]])R_yaw = np.array([[np.cos(yaw), -np.sin(yaw), 0],[np.sin(yaw), np.cos(yaw), 0],[0, 0, 1]])R = R_yaw @ R_pitch @ R_roll# 相机坐标转换到世界坐标cam_coords_homogeneous = np.array([cam_coords[0], cam_coords[1], -H, 1])world_coords = R @ cam_coords_homogeneous[:3] + np.array([pos_x, pos_y, pos_z])return world_coordsif __name__ == "__main__":####################################################基本参数# 传感器宽度和高度(毫米)sensor_width_mm = 12.83331744000000007588sensor_height_mm = 8.55554496000000064271# 图像宽度和高度(像素)image_width_px = 5472image_height_px = 3648# 焦距(毫米)focal_length_mm = 8.69244671863242679422# 焦距(米)focal_length_m = 8.69244671863242679422/1000# 相对航高(米)H=86.93#像主点坐标 (像素)xpoff_px=20.88973563438230485190ypoff_px=50.51977022866981315019#################################################### 1\计算空间分辨率# 传感器尺寸转换为米sensor_width_m = sensor_width_mm / 1000sensor_height_m = sensor_height_mm / 1000# 计算水平和垂直的 GSDGSD_x = (sensor_width_m/image_width_px) * (H / focal_length_m )GSD_y = (sensor_height_m /image_height_px) * (H / focal_length_m)# 水平和垂直方向的 GSDprint("水平方向的 GSD:", GSD_x, "米/像素")print("垂直方向的 GSD:", GSD_y, "米/像素")#################################################### 2\给定像素坐标,计算相机坐标# 像素坐标oripixel_x = image_width_pxoripixel_y = image_height_px# oripixel_x = image_width_px/2# oripixel_y = image_height_px/2# oripixel_x = 0# oripixel_y = 0pixel_x=oripixel_x-xpoff_px-image_width_px/2pixel_y=oripixel_y-ypoff_px-image_height_px/2# 计算相机坐标(假设无畸变)camera_x = pixel_x * GSD_xcamera_y = pixel_y * GSD_yprint("像素坐标 (", oripixel_x, ",", oripixel_y, ") 对应的相机坐标 (x, y): (", camera_x, "米, ", camera_y, "米)")#################################################### 3\计算畸变后坐标# 对称畸变系数sym_dist = [0, -0.00043396118129128110, 0.00000262222711982075, -0.00000001047488706013]# 径向畸变dec_dist = [0.00000205885592671873, -0.00000321714140091248, 0]# 进行畸变校正undistorted_camera_x, undistorted_camera_y = undistort_pixel(pixel_x, pixel_y, sym_dist, dec_dist)print("畸变校正后像素坐标 (", oripixel_x, ",", oripixel_y, ") 对应的相机坐标 (x, y): (", undistorted_camera_x, "米, ", undistorted_camera_y, "米)")#################################################### 4\计算世界坐标# POS数据pos = [433452.054688, 2881728.519704, 183.789696, 0.648220, -0.226028, 14.490357]# 计算世界坐标world_coords = camera_to_world_coordinates((undistorted_camera_x, undistorted_camera_y), pos)print("旋转平移变换后像素坐标 (", oripixel_x, ",", oripixel_y, ") 对应的世界坐标 (x, y): (", world_coords[0], "米, ", world_coords[1], "米)")
http://www.hkea.cn/news/271676/

相关文章:

  • 做cpa广告网站教程百度sem推广具体做什么
  • 免费网站建站WWW222国际军事最新消息今天
  • 做网站软件miscrosoft云服务器
  • 如何做盗版小说网站最经典的营销案例
  • 设计类的网站和简介关键词优化推广排名多少钱
  • 代理记账网站怎么做北京seo方法
  • cdr做网站企业网站建设的基本流程
  • 网站建设需要哪些硬件百度指数排名
  • 2017年网站开发用什么语言找培训机构的app
  • 澳门响应式网站建设seo入门黑帽培训教程
  • 有哪些网站可以做微商口碑营销案例2021
  • 百度推广要不要建网站网络平台建设及运营方案
  • 大型网站开发考试查网址
  • 网站建设业务市场营销论文搜索优化
  • 黄页88企业名录seo怎么优化武汉厂商
  • 触摸屏网站如何做泰州seo网络公司
  • 银川app购物网站制作公司搜狗收录入口
  • 做单页网站要多少钱wordpress免费网站
  • 网站建设性价比高优化设计官网
  • 电脑手机网站相互跳转西安seo关键词排名优化
  • 一般做网站用什么字体比较合适搜索引擎营销是什么
  • 去什么网站发贴做推广seo及网络推广招聘
  • 如何批量建站什么是互联网营销
  • 哈尔滨网站建设如何搭建一个网站平台
  • 哪些网站可以做任务网络营销推广的基本手段
  • 互联网舆情报告什么是seo营销
  • 餐饮商家做网站的好处沈阳关键词优化费用
  • 如何把网站的文字编辑网站页面优化内容包括哪些
  • 安徽做公司网站哪家好销售策略和营销策略
  • 做游戏都需要什么网站吗域名注册腾讯云