Commit 5bac71a8 authored by oscar's avatar oscar

提交更新

parent 77ed90d9
......@@ -431,18 +431,29 @@ def read_yaml(path):
if __name__ == '__main__':
cfg_path = "/home/oscar/ros/git/jfxmap_python/7-1.yaml"
cfg = read_yaml(cfg_path)
Trans=cfg.TRACKING.TRANS
Trans = np.array(Trans)
kitti2origin=cfg.POINTPILLARS.KITTI2ORIGIN
kitti2origin = np.array(kitti2origin)
root_path = "/home/oscar/ros/git/jfxmap_python/script/data_aug_samples/"
child_dir = "N10_1"
origin_root_path = "/home/oscar/ros/git/jfxmap_python/script/data/10-1/"
generate_root_path = "/home/oscar/ros/git/jfxmap_python/script/data/5-3/"
origin_child_dir = "N10_1"
generate_child_dir = "N5_3"
origin_cfg_path = origin_root_path + "config/10-1.yaml"
origin_cfg = read_yaml(origin_cfg_path)
origin_Trans=origin_cfg.TRACKING.TRANS
origin_Trans = np.array(origin_Trans)
origin_kitti2origin=origin_cfg.POINTPILLARS.KITTI2ORIGIN
origin_kitti2origin = np.array(origin_kitti2origin)
generate_cfg_path = generate_root_path + "config/5-3.yaml"
generate_cfg = read_yaml(generate_cfg_path)
generate_Trans=generate_cfg.TRACKING.TRANS
generate_Trans = np.array(generate_Trans)
generate_kitti2origin=generate_cfg.POINTPILLARS.KITTI2ORIGIN
generate_kitti2origin = np.array(generate_kitti2origin)
#读标注的json文件
anno = {}
jsn_file = os.path.join(root_path, child_dir + ".json")
jsn_file = os.path.join(origin_root_path, "origin/" + origin_child_dir + ".json")
print(jsn_file)
p_dir = "/home/oscar/ros/git/catkin_ws_xishan/src/jfx_traffic_events/thirdparty/jfxmap/"
......@@ -450,13 +461,16 @@ if __name__ == '__main__':
ret = init_jfxmap(p_dir,f_path)
print(ret)
base_file_path = os.path.join(generate_root_path, "base/1633640721.417269000.pcd")
g_xyzi,g_pcd,g_converted_pcd = parse_pandarmind_pcd(base_file_path, rotMat[generate_child_dir])
vis = True
with open(jsn_file, 'r',encoding='utf-8',errors='ignore') as fp:
jsn = json.load(fp)
annos = jsn["annotations"]
for an in annos:
fileuri = "10-1_pcds/" + an['fileuri'].split("/")[-1]
fileuri_path = os.path.join(root_path,fileuri)
fileuri = "origin/pcds/" + an['fileuri'].split("/")[-1]
fileuri_path = os.path.join(origin_root_path,fileuri)
# print(fileuri_path)
if os.path.isfile(fileuri_path):
print(fileuri_path," ",fileuri)
......@@ -472,7 +486,7 @@ if __name__ == '__main__':
# print(bbox_flag)
# print(bboxes)
# 地面转成水平面,地面点的z值几乎差不多
xyzi,pcd,converted_pcd = parse_pandarmind_pcd(file_path, rotMat[child_dir])
xyzi,pcd,converted_pcd = parse_pandarmind_pcd(file_path, rotMat[origin_child_dir])
print(xyzi)
print(pcd)
print(converted_pcd)
......@@ -482,7 +496,7 @@ if __name__ == '__main__':
drawpointcloud = []
merge_geos = [pcd]
for bbox in bboxes:
lidar_loc, out_BL, out_center_BL = get_loc([bbox[4][0], bbox[4][1], bbox[4][2], bbox[6][0], bbox[6][1], bbox[6][2], bbox[2]], 0, Trans, kitti2origin)
lidar_loc, out_BL, out_center_BL = get_loc([bbox[4][0], bbox[4][1], bbox[4][2], bbox[6][0], bbox[6][1], bbox[6][2], bbox[2]], 0, origin_Trans, origin_kitti2origin)
print(out_center_BL)
angle = bbox[2]/np.pi*180
isInMap = get_map_data(out_center_BL[0],out_center_BL[1],angle)
......@@ -519,8 +533,8 @@ if __name__ == '__main__':
merge_geos += [axis_pcd]
drawpointcloud += [axis_pcd]
#pcd.paint_uniform_color([1.00, 0, 0])
savefile = "D:/pointcloud" + str(num) + ".pcd"
o3d.io.write_point_cloud(savefile,savecloud)
# savefile = "D:/pointcloud" + str(num) + ".pcd"
# o3d.io.write_point_cloud(savefile,savecloud)
num += 1
# custom_draw_geometry_with_key_callback(merge_geos, file_path)
custom_draw_geometry_with_key_callback(drawpointcloud, file_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment