中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

做html網(wǎng)站搜索框代碼新浪輿情通官網(wǎng)

做html網(wǎng)站搜索框代碼,新浪輿情通官網(wǎng),網(wǎng)站建設書怎么寫,網(wǎng)站被降權會發(fā)生什么影響嗎背景 已知相機參數(shù)(傳感器寬度和高度、圖像寬度和高度、焦距、相對航高、像主點坐標 ),在給定像素坐標的前提下,求世界坐標,大部分通過AI來實現(xiàn),不知道哪個步驟有問題,望大家指正 腳本 impor…

背景

已知相機參數(shù)(傳感器寬度和高度、圖像寬度和高度、焦距、相對航高、像主點坐標 ),在給定像素坐標的前提下,求世界坐標,大部分通過AI來實現(xiàn),不知道哪個步驟有問題,望大家指正

腳本

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):# 獲取相機到世界的轉換參數(shù)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__":####################################################基本參數(shù)# 傳感器寬度和高度(毫米)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\計算畸變后坐標# 對稱畸變系數(shù)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數(shù)據(jù)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.risenshineclean.com/news/28064.html

相關文章:

  • asp網(wǎng)站搭建軟件南寧網(wǎng)站優(yōu)化
  • 代替手動修改網(wǎng)站模板標簽seo標題優(yōu)化分析范文
  • 網(wǎng)站標題如何書寫軟文接單平臺
  • 泰州網(wǎng)站設計哪家好網(wǎng)上營銷的平臺有哪些
  • 網(wǎng)站建設技能描述免費發(fā)布推廣平臺
  • nike網(wǎng)站建設方案診斷網(wǎng)站seo現(xiàn)狀的方法
  • 西安網(wǎng)站制作百億科技全國廣告投放平臺
  • 石家莊做網(wǎng)站的公司有哪些怎么制作鏈接網(wǎng)頁
  • 建模培訓機構優(yōu)化seo網(wǎng)站
  • 怎么在58上做公司網(wǎng)站企業(yè)網(wǎng)站推廣方案策劃
  • 幫網(wǎng)貸做網(wǎng)站會判刑嗎網(wǎng)站加速器
  • 個人網(wǎng)站營業(yè)執(zhí)照百度搜索引擎地址
  • WordPress P站優(yōu)化二十條
  • 如何做資源論壇網(wǎng)站百度推廣和優(yōu)化哪個好
  • 南昌網(wǎng)站建設費用四川seo優(yōu)化
  • 做網(wǎng)站的要多錢百度關鍵詞優(yōu)化
  • 網(wǎng)站開發(fā)難點站長工具seo查詢
  • wordpress添加文章副標題谷歌seo服務商
  • 泰興網(wǎng)站制作網(wǎng)絡營銷策劃方案模板
  • 搭建網(wǎng)站做財務系統(tǒng)網(wǎng)站建設流程步驟
  • 網(wǎng)友seo排名賺掛機
  • 成功網(wǎng)站管理系統(tǒng)十大網(wǎng)絡推廣公司排名
  • 做網(wǎng)站宣傳多少錢如何快速網(wǎng)絡推廣
  • 做網(wǎng)站的外包能學到什么磁力蜘蛛
  • 大連網(wǎng)站建設seo怎么去優(yōu)化
  • 重慶市衛(wèi)生健康委員會福州短視頻seo網(wǎng)站
  • 天津重型網(wǎng)站建設推薦沈陽網(wǎng)站seo公司
  • 國內(nèi)外網(wǎng)站建設長沙關鍵詞優(yōu)化平臺
  • 手機打開網(wǎng)站自動跳轉網(wǎng)站優(yōu)化排名推薦
  • 做生意必定紅火的公司名字win10優(yōu)化