티스토리 뷰
https://logicatcore.github.io/scratchpad/lidar/sensor-fusion/jupyter/2021/04/20/2D-Oriented-Bounding-Box.html
http://www.open3d.org/docs/latest/python_api/open3d.geometry.OrientedBoundingBox.html
https://github.com/google-research-datasets/Objectron
# for 3d iou
# reorder the corners from open3d definition to objectron box
open3d2objectron = [0, 1, 2, 4, 7, 3, 8, 6, 5]
# return center + corners of oriented bounding box from a point cloud
def get_oriented_3d_bbox(point_cloud: np.ndarray) -> np.ndarray:
"""
point_cloud: (N, 3) np.ndarray
Return
vertices: (9, 3); 1 center + 8 corners
"""
o3d_points = o3d.utility.Vector3dVector(point_cloud)
oriented_3d_bbox = o3d.geometry.OrientedBoundingBox.create_from_points(o3d_points)
center = oriented_3d_bbox.get_center() # (3,)
corners = oriented_3d_bbox.get_box_points() # (8, 3)
vertices = np.concatenate([np.asarray(center)[None, :], np.asarray(corners)])
# reorder
vertices = vertices[open3d2objectron]
return vertices
# return 3d bounding box iou of two meshes (pointclouds)
def calc_3d_iou(mesh_a: np.ndarray, mesh_b: np.ndarray):
""""
mesh_a: (N1, 3)
mesh_b: (N2, 3)
Return
iou: scalar 0~1
"""
bbox_points_a = get_oriented_3d_bbox(mesh_a) # (9, 3) center + 8 corners
bbox_points_b = get_oriented_3d_bbox(mesh_b) # (9, 3) center + 8 corners
objectron_box_a = Box(bbox_points_a)
objectron_box_b = Box(bbox_points_b)
IoU_calculator = IoU(objectron_box_a, objectron_box_b)
iou = IoU_calculator.iou()
return iou
'Research (연구 관련)' 카테고리의 다른 글
DensePose rendering (0) | 2023.10.20 |
---|---|
Sparse Multi camera calibration (0) | 2023.08.23 |
Python multiprocessing (0) | 2023.06.21 |
Mask, Polygon, Simplify (0) | 2023.06.16 |
Open3D (0) | 2023.05.03 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Machine Learning
- part segmentation
- 2d pose
- 머신러닝
- 에디톨로지
- 문경식
- VAE
- 비전
- Interview
- Virtual Camera
- world coordinate
- Generative model
- densepose
- Pose2Mesh
- demo
- Docker
- nerf
- pyrender
- spin
- 컴퓨터비전
- deep learning
- Transformation
- 피트니스
- 인터뷰
- pytorch
- 컴퓨터비젼
- focal length
- nohup
- 헬스
- camera coordinate
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함