当前位置:网站首页>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地址转换地址段
- Tech talk activity preview | building intelligent visual products based on Amazon kVs
- 871. 最低加油次数
- 相信自己,这次一把搞定JVM面试
- What is the difference between JSP and servlet?
- 智能垃圾桶(五)——点亮OLED
- go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
- john爆破出現Using default input encoding: UTF-8 Loaded 1 password hash (bcrypt [Blowfish 32/64 X3])
- 你想要的宏基因组-微生物组知识全在这(2022.7)
- Leetcode1380: lucky numbers in matrix
猜你喜欢
Hard core! One configuration center for 8 classes!
How to transfer business data with BorgWarner through EDI?
OpenHarmony如何启动远程设备的FA
Leetcode1380: lucky numbers in matrix
Yolov5 practice: teach object detection by hand
基于多元时间序列对高考预测分析案例
Weili holdings listed on the Hong Kong Stock Exchange: with a market value of HK $500million, it contributed an IPO to Hubei
Cell:清华程功组揭示皮肤菌群的一种气味挥发物促进黄病毒感染宿主吸引蚊虫...
The macrogenome microbiome knowledge you want is all here (2022.7)
[cloud native] briefly talk about the understanding of flume, a massive data collection component
随机推荐
System Verilog实现优先级仲裁器
P6774 [NOI2020] 时代的眼泪(分块)
Lampe respiratoire PWM
【征文活动】亲爱的开发者,RT-Thread社区喊你投稿啦
关于举办科技期刊青年编辑沙龙——新时代青年编辑应具备的能力及提升策略的通知...
寒门再出贵子:江西穷县考出了省状元,做对了什么?
剑指 Offer 24. 反转链表
剑指 Offer 25. 合并两个排序的链表
MySQL port
IP地址转换地址段
人生的开始
Configure ARP table entry restrictions and port security based on the interface (restrict users' private access to fool switches or illegal host access)
剑指 Offer 26. 树的子结构
C语言自定义函数的方法
綠竹生物沖刺港股:年期內虧損超5億 泰格醫藥與北京亦莊是股東
二、mock平台的扩展
LeetCode 6. Zigzag transformation (n-shaped transformation)
uboot的作用和功能
Domestic relatively good OJ platform [easy to understand]
Fuyuan medicine is listed on the Shanghai Stock Exchange: the market value is 10.5 billion, and Hu Baifan is worth more than 4billion