Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added various possible camera models for the photometric and response calibration #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ include_directories(
)


add_executable(responseCalib src/main_responseCalib.cpp src/FOVUndistorter.cpp src/PhotometricUndistorter.cpp)
add_executable(responseCalib src/main_responseCalib.cpp src/FOVUndistorter.cpp src/Undistorter.cpp src/PhotometricUndistorter.cpp)
target_link_libraries(responseCalib ${OpenCV_LIBS} ${LIBZIP_LIBRARY})

add_executable(playDataset src/main_playbackDataset.cpp src/FOVUndistorter.cpp src/PhotometricUndistorter.cpp)
add_executable(playDataset src/main_playbackDataset.cpp src/FOVUndistorter.cpp src/Undistorter.cpp src/PhotometricUndistorter.cpp)
target_link_libraries(playDataset ${OpenCV_LIBS} ${LIBZIP_LIBRARY})


Expand All @@ -40,7 +40,7 @@ SET(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/lib/cmake/ )
find_package(aruco)

IF(aruco_FOUND)
add_executable(vignetteCalib src/main_vignetteCalib.cpp src/FOVUndistorter.cpp src/PhotometricUndistorter.cpp)
add_executable(vignetteCalib src/main_vignetteCalib.cpp src/FOVUndistorter.cpp src/Undistorter.cpp src/PhotometricUndistorter.cpp)
target_link_libraries(vignetteCalib ${OpenCV_LIBS} ${aruco_LIBS} ${LIBZIP_LIBRARY})
ELSE()
message("================ aruco not found. not compiling vignetteCalib. ========================")
Expand Down
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

Update (AlbertoJaenal): the calibration accepts various camera model. The code was copied from [https://github.com/JakobEngel/dso](https://github.com/JakobEngel/dso) and reformed to fit.

# Install

Expand Down Expand Up @@ -69,6 +69,44 @@ vignetteSmoothed.png is a slightly smoothed version, mainly to remove the black
**WARNING: requires a lot of Memory (16GB ram for 1000 input images)**! Can easily be changed at the cost of slightly slower runtime... you'll have to do that yourself though.


##### Geometric Calibration File (from [https://github.com/JakobEngel/dso](https://github.com/JakobEngel/dso#geometric-calibration-file))


###### Calibration File for Pre-Rectified Images

Pinhole fx fy cx cy 0
in_width in_height
"crop" / "full" / "none" / "fx fy cx cy 0"
out_width out_height

###### Calibration File for FOV camera model:

FOV fx fy cx cy omega
in_width in_height
"crop" / "full" / "fx fy cx cy 0"
out_width out_height


###### Calibration File for Radio-Tangential camera model

RadTan fx fy cx cy k1 k2 r1 r2
in_width in_height
"crop" / "full" / "fx fy cx cy 0"
out_width out_height


###### Calibration File for Equidistant camera model

EquiDistant fx fy cx cy k1 k2 r1 r2
in_width in_height
"crop" / "full" / "fx fy cx cy 0"
out_width out_height


(note: for backwards-compatibility, "Pinhole", "FOV" and "RadTan" can be omitted). See the respective
`::distortCoordinates` implementation in `Undistorter.cpp` for the exact corresponding projection function.
Furthermore, it should be straight-forward to implement other camera models.


# Usage: Matlab evaluation code
Implements Sim(3) alignment of a tracked trajectory to the ground-truth segments, and subsequent computation of the different error values. See MatlabEvaluationCode/Example.m for an example, and some documentation regarding the computed values. Further, we include example results computed with DSO for all 50 sequences.
Expand Down
16 changes: 12 additions & 4 deletions src/BenchmarkDatasetReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
#include <algorithm>

#include "opencv2/opencv.hpp"
#include "FOVUndistorter.h"
//#include "FOVUndistorter.h"
#include "Undistorter.h"
#include "PhotometricUndistorter.h"

#include "zip.h"
Expand Down Expand Up @@ -132,7 +133,8 @@ class DatasetReader


// create undistorter.
undistorter = new UndistorterFOV((path+"camera.txt").c_str());
//undistorter = new UndistorterFOV((path+"camera.txt").c_str());
undistorter = Undistort::getUndistorterForFile((path+"camera.txt").c_str());
photoUndistorter = new PhotometricUndistorter(path+"pcalib.txt", path+"vignette.png",undistorter->getInputDims()[0],undistorter->getInputDims()[1]);


Expand All @@ -156,7 +158,12 @@ class DatasetReader

}

UndistorterFOV* getUndistorter()
/*UndistorterFOV* getUndistorter()
{
return undistorter;
}*/

Undistort* getUndistorter()
{
return undistorter;
}
Expand Down Expand Up @@ -336,7 +343,8 @@ class DatasetReader


// internal structures.
UndistorterFOV* undistorter;
//UndistorterFOV* undistorter;
Undistort* undistorter;
PhotometricUndistorter* photoUndistorter;
zip_t* ziparchive;
char* databuffer;
Expand Down
Loading