Skip to content
Snippets Groups Projects
Commit 27f8ce78 authored by Guillaume Duret's avatar Guillaume Duret
Browse files

add high quality

parent ec417408
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl ...@@ -18,6 +18,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl
[1.0000000, 0.0000000, 0.0000000]]) [1.0000000, 0.0000000, 0.0000000]])
list_count_categories = {} list_count_categories = {}
for i in range(World_begin, World_begin + Nb_world): # worlds for i in range(World_begin, World_begin + Nb_world): # worlds
catergories_instance_array_id_to_cat, catergories_instance_array_cat_to_id, catergories_label_to_id = compute_categories_id(data_name, i) catergories_instance_array_id_to_cat, catergories_instance_array_cat_to_id, catergories_label_to_id = compute_categories_id(data_name, i)
...@@ -86,9 +87,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl ...@@ -86,9 +87,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl
f.write(json.dumps(feeds, indent=4)) f.write(json.dumps(feeds, indent=4))
if (Nb_instance == 1): if (Nb_instance == 1):
for k in range(len(data_3D_pose)): for k in range(len(data_3D_pose)):
if data_3D_pose[k]['id'] == catergories_occ_array[categories][0]: if data_3D_pose[k]['id'] == catergories_occ_array[categories][0]:
rpy = data_3D_pose[k]['pose']['rpy'] rpy = data_3D_pose[k]['pose']['rpy']
rot = convert2(rpy) rot = convert2(rpy)
......
...@@ -50,7 +50,7 @@ if __name__ == '__main__': ...@@ -50,7 +50,7 @@ if __name__ == '__main__':
Nb_instance = 1 Nb_instance = 1
occ_target = 0.5 occ_target = 0.5
dataset_src = "/media/gduret/DATA/dataset/s2rg/Fruits_all_medium/data" dataset_src = "/media/gduret/DATA/dataset/s2rg/Fruits_all_medium/data"
choice = "low" # depth of rgb resolution datas choice = "high" # depth of rgb resolution datas
data_options = {"high": "ground_truth_rgb", data_options = {"high": "ground_truth_rgb",
"low": "ground_truth_depth"} "low": "ground_truth_depth"}
dataset_type = data_options[choice] dataset_type = data_options[choice]
...@@ -64,17 +64,21 @@ if __name__ == '__main__': ...@@ -64,17 +64,21 @@ if __name__ == '__main__':
camera = np.matrix([[1386.4138492513919, 0.0, 960.5], camera = np.matrix([[1386.4138492513919, 0.0, 960.5],
[0.0, 1386.4138492513919, 540.5], [0.0, 1386.4138492513919, 540.5],
[0.0, 0.0, 1.0]]) [0.0, 0.0, 1.0]])
else: # (640/1920 = 1 / 3), (480/1080 = 4 / 9)
trans = np.matrix([[1 / 3, 0.0, 0.0],
[0.0, (4 / 9), 0.0],
[0.0, 0.0, 1.0]])
elif choice == 'low':
camera = np.matrix([[1086.5054444841007, 0.0, 640.5], camera = np.matrix([[1086.5054444841007, 0.0, 640.5],
[0.0, 1086.5054444841007, 360.5], [0.0, 1086.5054444841007, 360.5],
[0.0, 0.0, 1.0]]) [0.0, 0.0, 1.0]])
#
trans = np.matrix([[0.5, 0.0, 0.0],
[0.0, (2 / 3), 0.0],
[0.0, 0.0, 1.0]])
new_size = (640, 480) new_size = (640, 480)
trans = np.matrix([[0.5, 0.0, 0.0],
[0.0, (2 / 3), 0.0],
[0.0, 0.0, 1.0]])
new_camera = trans @ camera new_camera = trans @ camera
np.savetxt(f'{dataset_name}/Generated/camera_{choice}.txt', camera) np.savetxt(f'{dataset_name}/Generated/camera_{choice}.txt', camera)
...@@ -107,5 +111,5 @@ if __name__ == '__main__': ...@@ -107,5 +111,5 @@ if __name__ == '__main__':
bbox = get_3D_bbox(ext) bbox = get_3D_bbox(ext)
np.savetxt(f'{dataset_name}/Generated/{categories}/{categories}_bbox_3d.txt', bbox) # save np.savetxt(f'{dataset_name}/Generated/{categories}/{categories}_bbox_3d.txt', bbox) # save
process_compute(dataset_name, camera, new_camera, new_size, Nb_camera, args.World_begin, args.Nb_worlds, list_categories, occ_target, False) process_compute(dataset_name, camera, new_camera, new_size, Nb_camera, args.World_begin, args.Nb_worlds, list_categories, occ_target, True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment