0. 데모파일로 slam 진행시 마지막에 segmentation fault(core dumped)가 뜨는 문제가 있었다.
1. 카메라 캘리브레이션
2. mono_euroc.cc 또는 mono_tum.cc 소스코드 수정 필요한지 파악하고, 어느 파일로 실행해야 하는지 파악
3. yaml 파일 수정 > 카메라 변수 알맞게 이해하고 입력
4. 영상 데이터 사진으로 변환하고 timestamp 생성하여 txt 파일로 알맞은 열 형식으로 작성.
참고자료
0.
이 문제를 해결한 레포지토리라고 한다. ORB_SLAM3_Fixed
https://github.com/shanpenghui/ORB_SLAM3_Fixed
GitHub - shanpenghui/ORB_SLAM3_Fixed: Optimized ORBSLAM3 to run on TUM/EuRoc/KITTI dataset
Optimized ORBSLAM3 to run on TUM/EuRoc/KITTI dataset - GitHub - shanpenghui/ORB_SLAM3_Fixed: Optimized ORBSLAM3 to run on TUM/EuRoc/KITTI dataset
github.com
1.
카메라 캘리브레이션의 기초를 제대로 배울수 있을 것 같은 블로그이다. 역시 mathworks 에서 나와서 그런지 내용이 너무 많다.
https://kr.mathworks.com/help/vision/ug/camera-calibration-using-apriltag-markers.html
Camera Calibration Using AprilTag Markers - MATLAB & Simulink - MathWorks 한국
이 예제의 수정된 버전이 있습니다. 사용자가 편집한 내용을 반영하여 이 예제를 여시겠습니까?
kr.mathworks.com
두번째는 내 팀에서 활용한 코드이다.
https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html
OpenCV: Camera Calibration
Goal In this section, we will learn about types of distortion caused by cameras how to find the intrinsic and extrinsic properties of a camera how to undistort images based off these properties Basics Some pinhole cameras introduce significant distortion t
docs.opencv.org
뭔가 도움이 될 것 같은 유투브 영상이다.
https://www.youtube.com/watch?v=26nV4oDLiqc&ab_channel=CyrillStachniss
이외에 ros를 활용하는 방법도 있지만, 내가 ros에 미숙하여 조사만 했다.
http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration
camera_calibration/Tutorials/MonocularCalibration - ROS Wiki
Note: This tutorial assumes that you have completed the previous tutorials: ROS Tutorials. Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of y
wiki.ros.org
4.
orb slam 타임스탬프를 검색해서 나온 결과이다.
첫번째는 큰 도움이 되지는 못했지만, 어떻게 자체 사진 데이터셋으로 slam을 진행하는지 참고할 수 있다. timestamp를 작성해야함을 처음 인지한 블로그이다. 해당 블로그는 이미 타임스탬프 변환을 파이썬 코드로 실행했다.
https://20sep1995.blogspot.com/2019/02/how-to-run-orb-slam-with-your-own-data.html
How to run ORB SLAM with your own data in Ubuntu 16.04
my daily life and what I've studied. In English or sometimes in Korean
20sep1995.blogspot.com
필요한 코드를 찾지 못해서 video to image timestamp 라는 검색어로 조사했다. bat 파일을 제공하는 깃허브 레포지토리를 알려주었다. 일정 간격으로 영상에서 사진 추출을 하고, 타임스탬프를 작성하는 bat 파일이었다. 하나의 파일로 어떻게 다 통제하고, 결과를 뽑는지는 확인하지 못했다.
https://superuser.com/questions/880546/extract-frames-from-video-and-set-timestamp-on-images
Extract frames from video and set timestamp on images
I want to extract frames every 10 seconds from a video and geotag these frames using a GPX track. On my Windows 8 computer I have tools to extract the frames (FFMPEG), set image timestamps (ExifTo...
superuser.com
다른 옵션으로, 매우 간단한 기능만이지만 확실해보이는 패키지이다.
https://github.com/saravanabalagi/video-to-image-timestamp
GitHub - saravanabalagi/video-to-image-timestamp: A simple shell script to pulverise a video into PNGs neatly logged in a timest
A simple shell script to pulverise a video into PNGs neatly logged in a timestamp imagename txt file. Uses ffprobe and ffmpeg - GitHub - saravanabalagi/video-to-image-timestamp: A simple shell scri...
github.com
복잡하지만, 리눅스 쉘 상에서 끝내버리는 코드도 있었다. 알고보니, 출력하는 타임스탬프가 내가 필요로하는 형식같아보이지는 않았다.
Create a video with timestamp from multiple images with "picture taken date/time" in the meta data with ffmpeg or similar?
I have two time lapse videos with a rate of 1 fps. The camera took 1 Image every minute. Unfortunately it was missed to set the camera to burn/print on every image the time and date. I am trying to...
stackoverflow.com
@echo off
set "INPUT=C:\t\video"
for %%a in ("%INPUT%\*.png") do (
ffmpeg -i "%%~a" -vf "drawtext=text=%%~na:x=50:y=100:fontfile=/Windows/Fonts/arial.ttf:fontsize=25:fontcolor=white" -c:v libx264 -pix_fmt yuv420p "output/%%~na.mp4"
)
마지막으로, opencv를 활용하는 코드이다.
https://www.geeksforgeeks.org/save-frames-of-live-video-with-timestamps-python-opencv/
Save frames of live video with timestamps - Python OpenCV - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
www.geeksforgeeks.org
# Import necessary libraries
import cv2
import os
from datetime import datetime
# set path in which you want to save images
path = r'C:\Users\vishal\Documents\Bandicam'
# changing directory to given path
os.chdir(path)
# i variable is to give unique name to images
i = 1
wait = 0
# Open the camera
video = cv2.VideoCapture(0)
while True:
# Read video by read() function and it
# will extract and return the frame
ret, img = video.read()
# Put current DateTime on each frame
font = cv2.FONT_HERSHEY_PLAIN
cv2.putText(img, str(datetime.now()), (20, 40),
font, 2, (255, 255, 255), 2, cv2.LINE_AA)
# Display the image
cv2.imshow('live video', img)
# wait for user to press any key
key = cv2.waitKey(100)
# wait variable is to calculate waiting time
wait = wait+100
if key == ord('q'):
break
# when it reaches to 5000 milliseconds
# we will save that frame in given folder
if wait == 5000:
filename = 'Frame_'+str(i)+'.jpg'
# Save the images in given path
cv2.imwrite(filename, img)
i = i+1
wait = 0
# close the camera
video.release()
# close open windows
cv2.destroyAllWindows()
또다른 opencv 코드
https://docs.opencv.org/4.x/d4/d94/tutorial_camera_calibration.html
OpenCV: Camera calibration With OpenCV
Prev Tutorial: Camera calibration with square chessboard Next Tutorial: Real Time pose estimation of a textured object Original author Bernát Gábor Compatibility OpenCV >= 4.0 Cameras have been around for a long-long time. However, with the introduction
docs.opencv.org
'건축 컴퓨터 비전 > ORB-SLAM3' 카테고리의 다른 글
slam 실행 전 libpango_display.so: cannot open shared object file: No such file or directory (0) | 2022.08.05 |
---|---|
c++ gdb 디버깅중 vector size가 음수인 문제(c++ gdb vector size minus) (0) | 2022.07.17 |
ORB SLAM Custom data, debugging (0) | 2022.07.15 |
ORB-SLAM3 카메라 캘리브레이션 (0) | 2022.07.06 |
ORB-SLAM3 설치(20.04) (0) | 2022.06.16 |