앞서 Depth Estimation 비교 분석을 진행하여 Depth-Anything-V2가 가장 실제와 유사한 결과를 도출하였기 때문에 해당 프로세스로 진행!!
Depth만 추출하는 것에 끝내지 않고 해당 데이터를 기반으로 Point Cloud Data까지 생성할 수 있도록 추가하여 작성해 보았음.
GitHub - Oh-JongJin/Image2PCD: Single image to Point Cloud Data converter using Depth Estimation
Single image to Point Cloud Data converter using Depth Estimation - Oh-JongJin/Image2PCD
github.com
위 레포지토리의 run.py를 실행하면 되는데, 먼저 Depth-Anythin-V2를 사용하는 것이기 때문에 먼저 git clone 진행 후 동일한 경로에 run.py를 위치하고 실행해야 한다.
또한 코드 기준으로는 이미지가 들어있는 data 폴더, 결과가 저장될 result 폴더를 생성해놓아야 한다.
그리고 이미지 파일명을 image_name 변수에 선언.
# 66, 67번 줄
# 출력할 기준 이미지의 파일 명, 경로 입력
image_name = "test" # input image file name
raw = cv2.imread(f"data/{image_name}.jpg")
실행 시 result 폴더에 Depth 이미지와 PCD 파일이 생성된 결과를 얻을 수 있다.


* PCD 파일은 윈도우 환경에서 pptk 라이브러리를 사용하여 볼 수 있음!
반응형
'Development > Depth Estimation' 카테고리의 다른 글
Depth Estimation 실행 결과 비교 (0) | 2024.11.09 |
---|