当前位置:网站首页>ETH数据集下载及相关问题
ETH数据集下载及相关问题
2022-07-02 14:33:00 【LBJ_wz】
ETH数据集下载
存在问题
我尝试对其中的数据进行可视化,因为数据集给的数据是世界坐标系下的数据,我们希望在图片中进行展示,即将世界坐标系转为像素坐标系。按照H.txt中给出的但影星矩阵进行变换之后,发现了以下问题
代码如下:
class A:
def __init__(self):
self.h11 = 1.1048200e-02
self.h12 = 6.6958900e-04
self.h13 = -3.3295300e+00
self.h21 = -1.5966000e-03
self.h22 = 1.1632400e-02
self.h23 = -5.3951400e+00
self.h31 = 1.1190700e-04
self.h32 = 1.3617400e-05
self.h33 = 5.4276600e-01
self.P = np.array([
[self.h11,self.h12,self.h13],
[self.h21,self.h22,self.h23],
[self.h31,self.h32,self.h33]
])
self.P1 = inv(self.P)
def transform_coordinate(self, point):
# 输入像素点,返回世界坐标
x, y = point
x_ = (self.h11*x + self.h12*y + self.h13)/(self.h31*x + self.h32*y + self.h33)
y_ = (self.h21*x + self.h22*y + self.h23)/(self.h31*x + self.h32*y + self.h33)
return (x_,y_)
def w_to_p(self,point):
point_ = np.append(point,1)
p_point_ = np.matmul(self.P1,point_)
p_point_ /= p_point_[-1]
return p_point_[:-1]
其中transform_coordinate,w_to_p方法分别为像素坐标转世界坐标和世界坐标转像素坐标。
我们执行以下可视化代码,将obsmat.txt中的第一帧数据进行可视化
file_path = r"./ewap_dataset/seq_hotel/obsmat.txt"
data = pd.read_csv(file_path,header=None,sep='\s+',names=["frame_number", "human_id", "pos_x", "pos_z", "pos_y", "v_x", "v_z", "v_y" ])[["frame_number", "human_id", "pos_x", "pos_y"]]
data1 = data[data["frame_number"]==1]
a = A()
w_ps = []
for i,row in data1.iterrows():
point = np.array([row["pos_x"], row["pos_y"]])
w_p = a.w_to_p(point)
w_ps.append(w_p)
import cv2
img_path = r"./ewap_dataset/seq_hotel/jpg/1.jpg"
img = cv2.imread(img_path) # 读取图片
for i in w_ps:
cv2.circle(img, (int(i[0]), int(i[1])), 10, (0, 0, 255))
输出图片如下:
感觉好像不太对阿……不过代码看了好多遍都没有任何问题。
根据向师姐请教发现把x,y换一下位置即可正确输出
file_path = r"./ewap_dataset/seq_hotel/obsmat.txt"
data = pd.read_csv(file_path,header=None,sep='\s+',names=["frame_number", "human_id", "pos_x", "pos_z", "pos_y", "v_x", "v_z", "v_y" ])[["frame_number", "human_id", "pos_x", "pos_y"]]
data1 = data[data["frame_number"]==1]
a = A()
w_ps = []
for i,row in data1.iterrows():
point = np.array([row["pos_x"], row["pos_y"]])
w_p = a.w_to_p(point)
w_ps.append(w_p)
import cv2
img_path = r"./ewap_dataset/seq_hotel/jpg/1.jpg"
img = cv2.imread(img_path) # 读取图片
for i in w_ps:
cv2.circle(img, (int(i[1]), int(i[0])), 10, (0, 0, 255))

然后这里应该是数据给错了吧,或者是单应性矩阵给错了。个人感觉,如果有懂得大佬请指正!!
边栏推荐
- IP address translation address segment
- The macrogenome microbiome knowledge you want is all here (2022.7)
- Tech talk activity preview | building intelligent visual products based on Amazon kVs
- 【云原生】简单谈谈海量数据采集组件Flume的理解
- L'explosion de John utilise l'encodage d'entrée par défaut: UTF - 8 Loaded 1 password Hash (bcrypt [blowfish 32 / 64 X3])
- 如何与博格华纳BorgWarner通过EDI传输业务数据?
- 绿竹生物冲刺港股:年期内亏损超5亿 泰格医药与北京亦庄是股东
- Amazon cloud technology community builder application window opens
- < IV & gt; H264 decode output YUV file
- 剑指 Offer 21. 调整数组顺序使奇数位于偶数前面
猜你喜欢

QWebEngineView崩溃及替代方案

Seven charts, learn to do valuable business analysis

go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)

LeetCode 2. Add two numbers

Leetcode1380: lucky numbers in matrix

TCP congestion control details | 2 background

Soul, a social meta universe platform, rushed to Hong Kong stocks: Tencent is a shareholder with an annual revenue of 1.28 billion

QStyle实现自绘界面项目实战(二)

In MySQL and Oracle, the boundary and range of between and precautions when querying the date

PhD battle-11 preview | review and prospect backdoor attack and defense of neural network
随机推荐
LeetCode 2. Add two numbers
Weili holdings listed on the Hong Kong Stock Exchange: with a market value of HK $500million, it contributed an IPO to Hubei
移动应用性能工具探索之路
QWebEngineView崩溃及替代方案
P6774 [NOI2020] 时代的眼泪(分块)
【Leetcode】14. Longest Common Prefix
2、 Expansion of mock platform
LeetCode 1. Sum of two numbers
Exploration of mobile application performance tools
Penetration tool - intranet permission maintenance -cobalt strike
Notice on holding a salon for young editors of scientific and Technological Journals -- the abilities and promotion strategies that young editors should have in the new era
Xiaopeng P7 had an accident on rainy days, and the airbag did not pop up. Official response: the impact strength did not meet the ejection requirements
PhD battle-11 preview | review and prospect backdoor attack and defense of neural network
綠竹生物沖刺港股:年期內虧損超5億 泰格醫藥與北京亦莊是股東
13、Darknet YOLO3
JS delete substring in string
[cloud native] briefly talk about the understanding of flume, a massive data collection component
2322. Remove the minimum fraction of edges from the tree (XOR and & Simulation)
上传代码到远程仓库报错error: remote origin already exists.
【Leetcode】14. 最長公共前綴