본문 바로가기

Study/event-based camera

e2calib 설치 및 사용

https://github.com/uzh-rpg/e2calib

@InProceedings{Muglikar2021CVPR,
  author = {Manasi Muglikar and Mathias Gehrig and Daniel Gehrig and Davide Scaramuzza},
  title = {How to Calibrate Your Event Camera},
  booktitle = {{IEEE} Conf. Comput. Vis. Pattern Recog. Workshops (CVPRW)},
  month = {June},
  year = {2021}
}

설치는 두 과정으로 나뉘어진다.

  1. Installation of packages for the conversion code that must be completed outside of any virtual environment for compatibility reasons.
  1. Installation of packages in a conda environment to run the reconstruction code.

1. Installation: Outside of conda

git clone https://github.com/uzh-rpg/e2calib
cd e2calib

pip3 install --no-cache-dir -r requirements.txt
pip3 install dataclasses # if your system Python version is < 3.7

2. Installation: inside of conda

cuda_version=10.1

conda create -y -n e2calib python=3.7
conda activate e2calib
conda install -y -c anaconda numpy scipy
conda install -y -c conda-forge h5py opencv tqdm

pip install python/ # this installs e2vid

Calibration 과정

  1. Conversion of different event data files → hdf5 format.
  1. Reconstruction of images at a certain frequency from this file using E2VID (Requires the activation of the conda environment e2calib.)
  1. Calibration using your favorite image-based calibration toolbox.

0. Acquisition

체스보드를 다양한 각도, 거리에서 촬영하고 /dvs/event 가 포함된 rosbag을 수집한다.
roslaunch dvs_renderrer davis_mono.launch #연구실에서 쓰는 모델이 davis346_mono라서.
rosbag record /dvs/event

1. Conversion: bagfile → h5 format

오류 해결 과정

증상

해결

  1. try-except에서 인식을 못하니 처음에 그냥 받아온다.
  1. rospkg가 없다고 하니 받는다.
    pip3 install rospkg
  1. Cryptodome이 없다고 하니 받는다.
    pip3 install pycryptodomex
  1. gnupg가 없다고 하니 받는다.
    pip3 install gnupg

convert.py 정상작동!

cd e2calib/python
python convert.py /path/to/rosbagfile.bag # rosbag이 있는 위치에 따라서 조정

/e2calib/python/convert.py 를 사용해 rosbag→h5 파일로 변환한다.

생성된 h5 파일 확인

2. Reconstruction: event→img

  • event→img reconstruction에는 h5 file이 필요하다.

조정 가능 요소

  • height, width: reconstructed image’s size
  • freq_hz: the frequency at which the image reconstructions will be saved FIXED FREQUENCY → useful for intrinsic calibration!
  • upsample_rate: option to multiply the reconstruction rate i.e. setting this value to 3 will lead to 3 times higher reconstruction rate BUT does not influence the final number of reconstructed images that will be saved.
cd e2calib/python
python offline_reconstruction.py --h5file ../calib_test_00.h5 --freq_hz 5 --upsample_rate 4 --height 260 --width 346
  • DAVIS 346 model’s resolution: 346(width) x 260(height)

3. Calibration

매트랩을 사용하거나 제시하는 kalib 같은 다른 방법을 찾자.

아무 칼리브레이션 툴을 사용해도 좋다.


Uploaded by N2T

'Study > event-based camera' 카테고리의 다른 글

E2VID 설치 및 사용  (0) 2023.01.12
HASTE 설치  (0) 2023.01.12