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

New panorama pipeline for fisheye images #749

Merged
merged 270 commits into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
270 commits
Select commit Hold shift + click to select a range
db3d5e7
add rotation estimation
servantftechnicolor Jan 15, 2020
742b567
fisheye
servantftechnicolor Jan 15, 2020
4b593a4
refinement of equidistant camera
servantftechnicolor Jan 15, 2020
e59376e
radial disto for equidistant
servantftechnicolor Jan 16, 2020
5cff4d9
fisheye wip
servantftechnicolor Jan 20, 2020
df1980e
Backup
servantftechnicolor Jan 23, 2020
5dad58b
add center of fisheye
servantftechnicolor Jan 23, 2020
f414530
New disto model
servantftechnicolor Jan 24, 2020
713cf8a
WIP debug distortion model
servantftechnicolor Jan 28, 2020
a6afd6e
WIP commit
servantftechnicolor Jan 31, 2020
51be467
Working numerical tests for fisheye
servantftechnicolor Feb 4, 2020
d018171
Tmp commit
servantftechnicolor Feb 5, 2020
7e05544
alternative bundle
servantftechnicolor Feb 6, 2020
df83a7b
Put last modifications before stashing
servantftechnicolor Feb 6, 2020
c22e7dc
remove camera types not useful
servantftechnicolor Feb 7, 2020
4dafb80
add a node to select fisheye circle properties
servantftechnicolor Feb 7, 2020
5a3aaa6
remove useless camera type
servantftechnicolor Feb 7, 2020
0183892
load/save fisheye circle properties
servantftechnicolor Feb 7, 2020
4744376
removing unused stuff
servantftechnicolor Feb 7, 2020
b7e83fd
remove debug stuff
servantftechnicolor Feb 7, 2020
e5cf255
Add radial derivatives
servantftechnicolor Feb 7, 2020
df5a379
Adding symbolic derivatives for cameras
servantftechnicolor Feb 7, 2020
e6597a4
bug removal
servantftechnicolor Feb 7, 2020
90b8778
debug
servantftechnicolor Feb 7, 2020
19f42eb
symbolic pinhole
servantftechnicolor Feb 10, 2020
8e404b2
Cleaning up
servantftechnicolor Feb 11, 2020
baaa488
Working symbolic
servantftechnicolor Feb 11, 2020
8384ef1
Some small changes
servantftechnicolor Feb 12, 2020
8ed402f
MOving initial scale out of intrinsicbase
servantftechnicolor Feb 12, 2020
554c027
moving initialFocalLengthPix
servantftechnicolor Feb 12, 2020
1c9ba85
Add the concept of sensor size in mm
servantftechnicolor Feb 12, 2020
6e8db78
add concept of sensr width and calculate fov instead of manually addi…
servantftechnicolor Feb 13, 2020
a5405b4
final sync
servantftechnicolor Feb 17, 2020
d85e852
add management of image orientation
servantftechnicolor Feb 19, 2020
aaec0cc
update fisheye circle radius to percent
servantftechnicolor Feb 21, 2020
92aeca3
Update tests
servantftechnicolor Feb 25, 2020
defdd56
restore previous tests
servantftechnicolor Feb 26, 2020
7b49b94
[software] panoramaExternalInfo: if there is no config, export the in…
fabiencastan Feb 26, 2020
c8d1504
[CMAKE] omp library name for clang
servantftechnicolor Feb 27, 2020
28c5567
[Samples] Forgot to adapt this sample to the new camera model
servantftechnicolor Feb 27, 2020
d263a0d
Remove static analysis warnings
servantftechnicolor Feb 27, 2020
af24f22
Other static analysis warning removal
servantftechnicolor Feb 27, 2020
eea2db2
[SFM] Forgot to assign sensor size values to objects
servantftechnicolor Feb 27, 2020
0fe6bc5
called the wrong function
servantftechnicolor Feb 27, 2020
dfae34e
Dynamic distortion parameters for symbolic panorama
servantftechnicolor Feb 27, 2020
bcd4f1c
update symbolic derivatives, add new derivatives for fisheye4
servantftechnicolor Feb 28, 2020
bdae8dd
Update pinhole to have dynamic size for jacobians
servantftechnicolor Feb 28, 2020
441cbfe
[software] rename PanoramaExternalInfo into PanoramaInit
fabiencastan Feb 27, 2020
2054e1f
[camera] add clone method to distortion
fabiencastan Feb 27, 2020
348c295
[software] merge FisheyeCircle into PanoramaInit
fabiencastan Feb 27, 2020
3ba7f92
[camera] formatting
simogasp Mar 2, 2020
245b664
[camera] missing destructor
simogasp Mar 2, 2020
c7dca94
[camera] use only override (no virtual)
simogasp Mar 2, 2020
9661af8
[camera] missing destructor
simogasp Mar 2, 2020
84da34d
[camera] use only override (no virtual) and consts
simogasp Mar 2, 2020
51ba4d1
[camera] missing destructor
simogasp Mar 2, 2020
72600ee
[camera] use only override (no virtual)
simogasp Mar 2, 2020
6fdbaec
[camera] missing destructor
simogasp Mar 2, 2020
a421146
[camera] use only override (no virtual) and consts
simogasp Mar 2, 2020
1f556cb
[camera] missing destructor
simogasp Mar 2, 2020
71cb0f4
[camera] unused variables
simogasp Mar 2, 2020
72c55bd
[camera] use c++ include
simogasp Mar 2, 2020
74b2d32
[camera] use only override (no virtual) and consts
simogasp Mar 2, 2020
f52b306
[camera] default constructor
simogasp Mar 2, 2020
6067980
[camera] use only override (no virtual) and consts
simogasp Mar 2, 2020
720926a
[camera] use only override (no virtual) and consts
simogasp Mar 2, 2020
2d5ad28
[camera] default constructor
simogasp Mar 2, 2020
8b69ab4
[camera] default constructor
simogasp Mar 2, 2020
ac90153
[camera] use only override (no virtual)
simogasp Mar 2, 2020
2f25de7
[camera] explicit
simogasp Mar 2, 2020
58d6c8f
[camera] use only override (no virtual) and consts
simogasp Mar 2, 2020
b7731bb
[camera] default constructor
simogasp Mar 2, 2020
b8df635
[camera] default constructor
simogasp Mar 2, 2020
5d5a1ff
[camera] explicit
simogasp Mar 2, 2020
6179037
[camera] default constructor
simogasp Mar 2, 2020
e9bd760
[camera] explicit
simogasp Mar 2, 2020
aef2133
[camera] default constructor
simogasp Mar 2, 2020
b4720b4
[camera] explicit
simogasp Mar 2, 2020
eb997ef
[camera] default destructor
simogasp Mar 2, 2020
7bc2a74
[camera] unused code
simogasp Mar 2, 2020
621e985
[camera] unused code
simogasp Mar 2, 2020
cd94a4d
[sfm] using override
simogasp Mar 2, 2020
339129f
[camera] const
simogasp Mar 2, 2020
338b042
[camera] pass by reference
simogasp Mar 2, 2020
3841cae
[software] panoramaInit: use 2 parameters for fisheye center x,y
fabiencastan Mar 6, 2020
9b6f0ae
add automatic circle detection
servantftechnicolor Mar 5, 2020
fb78007
Bug in sensor size if height > width
servantftechnicolor Mar 5, 2020
bbe98b8
Add check before using fisheye circle detection
servantftechnicolor Mar 5, 2020
ed2f601
Store points on unit sphere for visualization
servantftechnicolor Mar 6, 2020
60d4d5a
[panorama] colorize landmarks
fabiencastan Mar 9, 2020
0de8c42
[panorama] formatting cleanup
fabiencastan Mar 9, 2020
771048b
Forgot translation while restoring cameras projection
servantftechnicolor Mar 10, 2020
6a884c2
laguerre update
servantftechnicolor Mar 10, 2020
83de6fd
bad usage of operator ()
servantftechnicolor Mar 10, 2020
1748b57
remove junk cout
servantftechnicolor Mar 11, 2020
b1c29f6
Bad isValid function for camera
servantftechnicolor Mar 11, 2020
e858a48
some unused varibales removal
servantftechnicolor Mar 11, 2020
48eae62
Unused variables
servantftechnicolor Mar 12, 2020
5d0dda1
another unused variable
servantftechnicolor Mar 12, 2020
0c5e3d3
updates to HDR
servantftechnicolor Mar 18, 2020
0d20a3c
grossberg wip
servantftechnicolor Mar 20, 2020
6de0ee2
grossberg working ?
servantftechnicolor Mar 20, 2020
6a9a7dc
port to eigen
servantftechnicolor Mar 20, 2020
762546c
Clean up debevec
servantftechnicolor Mar 20, 2020
77c3857
[software] panoramaInit: add estimateFisheyeCircle
fabiencastan Mar 23, 2020
b424e6a
[software] panoramaCompositing: export colorspace shoud be auto
fabiencastan Mar 23, 2020
cbccca9
[hdr] keep compatibility with eigen-3.3.7
fabiencastan Mar 24, 2020
8c73e2f
[software] panoramaEstimation: remove unused code
fabiencastan Mar 24, 2020
1b071c7
hdr test wip
servantftechnicolor Mar 24, 2020
705e781
[software] cameraInit: fix sensorHeight
fabiencastan Mar 24, 2020
b0ceb7d
[camera] Pinhole: isVisibleRay ensure no division by zero
fabiencastan Mar 25, 2020
bb3623c
[camera] Pinhole: some code formatting
fabiencastan Mar 25, 2020
5a511c1
[camera] some renaming to use camelCase function names
fabiencastan Mar 25, 2020
db01587
[camera] Equidistant: add Circle in var names
fabiencastan Mar 25, 2020
0be7130
[software] panoramaEstimation: remove unused param "orientation"
fabiencastan Mar 26, 2020
54ce17d
Merge remote-tracking branch 'origin/develop' into dev/panoramaFisheye
fabiencastan Mar 26, 2020
2aefa6c
[software] imageProcessing; add option keepImageFilename
fabiencastan Mar 26, 2020
6356f40
[software] imageMatching: add option FrustumOrVocabularyTree
fabiencastan Mar 26, 2020
35917b1
[software] LDRToHDR: fix the middle exposed view
fabiencastan Mar 29, 2020
87240da
[camera] const
simogasp Mar 29, 2020
d951f38
[camera] const
simogasp Mar 31, 2020
4b409a9
[camera] doc DistortionRadial
simogasp Mar 31, 2020
842b525
[test] add EXPECT_MATRIX_CLOSE_FRACTION
simogasp Mar 31, 2020
7d39b2d
[camera] add one test to rule them all Distortion
simogasp Mar 31, 2020
ee7b5ae
[hdr] default constructor
simogasp Mar 31, 2020
48d6faf
[hdr] explicit constructor
simogasp Mar 31, 2020
bbbccdf
[hdr] range loop
simogasp Mar 31, 2020
befc01e
[hdr] remove register
simogasp Mar 31, 2020
5109544
[hdr] remove exit
simogasp Mar 31, 2020
85ab81f
[hdr] double has infinity in c++
simogasp Mar 31, 2020
9de8b10
[hdr] reduced scope, preincrement in loop and Eigen::Index
simogasp Mar 31, 2020
fed5ebc
[hdr] reduced scope, preincrement in loop and Eigen::Index
simogasp Mar 31, 2020
92681bc
[hdr] reduced scope
simogasp Mar 31, 2020
3f7011f
[hdr] reduced scope
simogasp Mar 31, 2020
632200d
[hdr] reduced scope, preincrement in loop and Eigen::Index
simogasp Mar 31, 2020
280f8f0
[hdr] pragma once
simogasp Mar 31, 2020
1f3648e
[hdr] uniform declaration
simogasp Mar 31, 2020
bdca0af
[sw] use range loop and avoid shadowing
simogasp Mar 31, 2020
7a254d1
[hdr] use built-in Eigen dot product
simogasp Mar 31, 2020
213b82e
[hdr] formatting
simogasp Mar 31, 2020
e18a265
[hdr] renaming file to cpp and hpp
simogasp Mar 31, 2020
df0e49f
[hdr] remove const from primitive types in args
simogasp Mar 31, 2020
1ebf01f
[test] fix missing BOOST_ prefix
simogasp Apr 1, 2020
aed868f
[test] remove do while
simogasp Apr 1, 2020
39b6c70
[cmake] just formatting
simogasp Apr 1, 2020
fed5340
WIP hdr tests
fabiencastan Apr 11, 2020
dac1091
Updates to hdr methods
fabiencastan Apr 11, 2020
bd78b39
HDR tests
fabiencastan Apr 11, 2020
04510b8
Hdr enhancements (Debevec speedup)
servantftechnicolor Mar 31, 2020
b70a8ec
lambda is very high ?
servantftechnicolor Mar 31, 2020
0402e3e
[hdr] add documentation
fabiencastan Apr 12, 2020
ac27e97
[hdr] formatting and minor code cleaning
fabiencastan Apr 12, 2020
82ca819
[hdr] fix missing include
fabiencastan Apr 16, 2020
c4a09d4
Merge branch 'develop' of https://github.com/alicevision/AliceVision …
fabiencastan Apr 29, 2020
0e63b6c
[software] LDRToHDR: bypass HDR convertion if there is only 1 bracket
servantftechnicolor Apr 22, 2020
f77966a
[image] bug fix: sampler needs to be initialized
servantftechnicolor Apr 26, 2020
cde2d37
[software] LDRToHDR: debevec add points
servantftechnicolor Apr 28, 2020
f72dc2e
[software] LDRToHDR: improve heuristics to deal with images rotation …
servantftechnicolor Apr 30, 2020
9b5884c
[software] LDRToHDR: fix exported display curve
servantftechnicolor Apr 30, 2020
136b002
[software] PanoramaInit: sort files per filename (instead of using fu…
servantftechnicolor May 5, 2020
2d183cd
[software] LDRToHDR: improve orientation merging
servantftechnicolor May 5, 2020
9f00594
[hdr] msvc minor build fix and formatting
fabiencastan Apr 18, 2020
0aa6a74
[software] LDRToHDR: more explicit message for multiple intrinsics
fabiencastan May 5, 2020
9ffb2f7
[hdr] Improve sampling for hdr calibration
servantftechnicolor May 10, 2020
c1ffef4
[hdr] Grossberg working again
servantftechnicolor May 11, 2020
818d1cd
[hdr] Laguerre working
servantftechnicolor May 11, 2020
5067066
Merge remote-tracking branch 'origin/develop' into dev/panoramaFisheye
fabiencastan May 31, 2020
2cea5f7
merge fixes
fabiencastan May 31, 2020
dfe296a
[hdr] temporarily disable some invalid tests
fabiencastan May 31, 2020
660c7c7
[sfm] panorama: split bundle in multiple steps
fabiencastan Jun 1, 2020
f7ae73c
minor fix for unittests
fabiencastan Jun 1, 2020
9655db9
[sfm] panorama: merge fixes
fabiencastan Jun 6, 2020
c09ec81
[sfm] formatting
fabiencastan Jun 7, 2020
cc65c2d
[multiview] RelativePoseSphericalKernel: remove unused normalizer
fabiencastan Jun 7, 2020
8eb69ea
[robustEstimation] initialization code style
fabiencastan Jun 7, 2020
e22d13a
[multiview] formatting
fabiencastan Jun 7, 2020
76338d8
formatting and remove some unused vars
fabiencastan Jun 7, 2020
6c76938
[image] use zero initialization
fabiencastan Jun 7, 2020
da11ac1
[multiview] fix bug introduced during merge
fabiencastan Jun 8, 2020
ee8ab3e
[multiview] some renaming to avoid ambiguities
fabiencastan Jun 8, 2020
cfb186e
Why are we using EIGEN_INCLUDE_DIRS and not EIGEN3_INCLUDE_DIRS ?
servantftechnicolor Jun 10, 2020
49e2a74
Add a symbolic bundle adjustment
servantftechnicolor Jun 16, 2020
af3c71e
Panorama sfm unit test
servantftechnicolor Jun 18, 2020
59bad7d
Bug in types for rotation estimation
servantftechnicolor Jun 18, 2020
0057e11
[multiview] use explicit names
fabiencastan Jun 17, 2020
34f07b7
[multiview] remove unused files
fabiencastan Jun 18, 2020
579af56
[sfm] panorama: fix access to inliers
fabiencastan Jun 18, 2020
447f943
Update tests for panoramas sfm
servantftechnicolor Jun 22, 2020
af53395
Merge branch 'develop' of https://github.com/alicevision/AliceVision …
fabiencastan Jun 22, 2020
9200b15
[software] ldrToHdr: update access to metadata
fabiencastan Jun 23, 2020
ef6671e
Hdr tests updated
servantftechnicolor Jun 24, 2020
d06ccef
[feature] remove duplicate virtual/override
fabiencastan Jun 24, 2020
fe2ec56
[camera] minor update tp equidistant "project" method
fabiencastan Jun 24, 2020
303d155
[camera] fix typo in comments
fabiencastan Jun 24, 2020
aeb50e0
[camera] Add backproject method
fabiencastan Jun 24, 2020
723c9a7
[sfmData] Add descType in Constraint2D
fabiencastan Jun 24, 2020
74faad4
[sfm] Panorama: Average landmarks position
fabiencastan Jun 24, 2020
9a19ef7
[software] PanoramaEstimation: change output params to fit with SfM node
fabiencastan Jun 24, 2020
785e8a5
[camera] fix copyright date for equidistant
fabiencastan Jun 25, 2020
1850942
[camera] improve backproject api: better parameters order
fabiencastan Jun 25, 2020
578d209
[camera] new equidistant unit test
fabiencastan Jun 25, 2020
1580cce
[camera] minor variables renaming
fabiencastan Jun 25, 2020
bdcd18e
[camera] add project/backproject in unittests
fabiencastan Jun 25, 2020
c741162
[camera] use a single backproject implementation
fabiencastan Jun 25, 2020
5c9ef57
Merge branch 'develop' of https://github.com/alicevision/AliceVision …
fabiencastan Jun 27, 2020
5d81b32
[sfm] Panorama: expose more parameters with a new Params class
fabiencastan Jun 25, 2020
b72b361
[camera] PinholeRadial: fix unit test with correct rotation matrix
fabiencastan Jun 28, 2020
1dff4f0
[hdr] fix unit test: reduce precision check
fabiencastan Jun 28, 2020
47ab15b
[software] PanoramaEstimation: display number of connections / landmarks
fabiencastan Jun 28, 2020
c68eb4c
[software] SfMTransform: allow empty/identity transformation
fabiencastan Jun 28, 2020
6c95672
[sfm] Alignment: remove extra 180° rotation on Y axis
fabiencastan Jun 29, 2020
dac79e1
[software] ImageProcessing: set output folder param instead of sfmDat…
fabiencastan Jun 29, 2020
0dff35a
[software] expose outputViewsAndPoses param in sfmAlignment, sfmTrans…
fabiencastan Jun 29, 2020
d8d7521
bug in sampling
servantftechnicolor Jun 29, 2020
db79783
Make sure we manage the horizontal loop on panoramas for fisheye
servantftechnicolor Jun 30, 2020
89b196b
[sfmData] recognize more metadata keys
fabiencastan Jun 30, 2020
b27cd74
[sfmData] Update UID creation to avoid same UID for different images
fabiencastan Jun 30, 2020
0c9d51c
Merge branch 'develop' into dev/panoramaFisheye
fabiencastan Jun 30, 2020
5994701
[hdr] Split ldrToHdr in 3 steps: sampling, calibration and merge
servantftechnicolor Jun 26, 2020
d054541
[hdr] move code from software to functions in the library
servantftechnicolor Jun 29, 2020
7b1ace3
[hdr] Add colorspace param to extract samples
servantftechnicolor Jul 1, 2020
3cd1955
[hdr] Multithreading sampling
servantftechnicolor Jul 1, 2020
e629edf
[hdr] change colorspace in hdr merge
servantftechnicolor Jul 1, 2020
26955b5
[hdr] windows build fix
fabiencastan Jul 2, 2020
a31b132
[hdr] cmake: declare new dependency to sfmData
fabiencastan Jul 2, 2020
7241d4a
[software] ldrToHdr: formatting
fabiencastan Jul 2, 2020
9bc3156
[software] LdrToHdrCalibration: clean params
fabiencastan Jul 5, 2020
931b3b8
[hdr] sampling: formatting
fabiencastan Jul 5, 2020
d47336e
[software] PanoramaWarping: add parallelization
fabiencastan Jul 5, 2020
05e56bf
[software] featureExtraction: use verbose enum directly in command line
fabiencastan Jul 5, 2020
d45a373
[software] LdrToHdr Sampling/Merge: add parallelization params
fabiencastan Jul 5, 2020
7953dd6
[software] Remove LDRToHDR
fabiencastan Jul 5, 2020
d8b0902
[software] PanoramaPrepareImages: update param names and formatting
fabiencastan Jul 5, 2020
1f0b973
[software] PanoramaWarping: minor syntax update
fabiencastan Jul 5, 2020
4e18767
[camera] tests: ensure positive depth value
fabiencastan Jul 6, 2020
3bbfd07
[camera] tests: formatting
fabiencastan Jul 6, 2020
ea8f120
[hdr] Sampling: expose sampling parameters
fabiencastan Jul 6, 2020
3cd5f02
[sfmData] uid: use generic_string when using path in uid
fabiencastan Jul 7, 2020
2ff3d52
[ci] Ground truth evaluation: Use image filename as UID
fabiencastan Jul 7, 2020
c64b3cc
[software] PanoramaCompositing: bug fix on offset (for display seams …
fabiencastan Jul 7, 2020
dedde27
[software] PanoramaEstimation: log the number of cameras with landmarks
fabiencastan Jul 7, 2020
75e6759
[software] PanoramaCompositing: skip non valid views
fabiencastan Jul 7, 2020
51cc941
[software] PanoramaWarping/Compositing: propagate metadata
fabiencastan Jul 7, 2020
1f6e544
[sfm] syntax and warning fixes
fabiencastan Jul 7, 2020
8668280
[sfmDataIO] bug fix on test of allowed intrinsic types
fabiencastan Jul 9, 2020
a557d54
[software] cameraInit: retrieve "allowed camera models" at the start
fabiencastan Jul 9, 2020
5601516
[software] PanoramaPrepareImages: more detailed message when intrinsi…
fabiencastan Jul 9, 2020
9f88c22
[hdr] improve brackets management
fabiencastan Jul 9, 2020
e735f56
[software] globalSfM: udpate params naming
fabiencastan Jul 9, 2020
0dd6ae6
[software] panoramaInit: udpate params naming
fabiencastan Jul 9, 2020
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
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
git clone --branch master https://github.com/alicevision/SfM_quality_evaluation.git
cd SfM_quality_evaluation/
# checkout a specific commit to ensure repeatability
git checkout 203e55c6e70de5f79496407961eb10b15deece4b
git checkout 9f7d5876a76aad8e8d45c258fddfbb04aaa11d60
export LD_LIBRARY_PATH=$PWD/../../../AV_install/lib64:${DEPS_INSTALL_DIR}/lib64:${DEPS_INSTALL_DIR}/lib:${LD_LIBRARY_PATH}
echo "ldd aliceVision_cameraInit"
ldd $PWD/../../../AV_install/bin/aliceVision_cameraInit
Expand Down
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ if(ALICEVISION_HAVE_OPENMP)
if(NOT MSVC)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# for those using the clang with OpenMP support
list(APPEND ALICEVISION_LIBRARY_DEPENDENCIES iomp)
list(APPEND ALICEVISION_LIBRARY_DEPENDENCIES omp)
else()
list(APPEND ALICEVISION_LIBRARY_DEPENDENCIES gomp)
endif()
Expand Down Expand Up @@ -344,7 +344,7 @@ endif()
# ==============================================================================
find_package(Eigen3 3.3 REQUIRED)
if(Eigen3_FOUND OR EIGEN3_FOUND)
message(STATUS "EIGEN_INCLUDE_DIR: ${EIGEN_INCLUDE_DIR}")
# message(STATUS "EIGEN_INCLUDE_DIR: ${EIGEN_INCLUDE_DIR}")
# See https://eigen.tuxfamily.org/dox/group__TopicUnalignedArrayAssert.html
set(AV_EIGEN_DEFINITIONS -DEIGEN_MAX_ALIGN_BYTES=0 -DEIGEN_MAX_STATIC_ALIGN_BYTES=0)
else()
Expand Down Expand Up @@ -806,7 +806,7 @@ set(ALICEVISION_INCLUDE_DIRS
${generatedDir}
${CMAKE_CURRENT_SOURCE_DIR}/dependencies
${LEMON_INCLUDE_DIRS}
${EIGEN_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
${UNCERTAINTYTE_INCLUDE_DIRS}
${MAGMA_INCLUDE_DIRS}
Expand Down
39 changes: 25 additions & 14 deletions src/aliceVision/camera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# Headers
set(camera_files_headers
camera.hpp
cameraCommon.hpp
cameraUndistortImage.hpp
IntrinsicBase.hpp
IntrinsicInitMode.hpp
Pinhole.hpp
PinholeBrown.hpp
PinholeFisheye.hpp
PinholeFisheye1.hpp
PinholeRadial.hpp
camera.hpp
cameraCommon.hpp
cameraUndistortImage.hpp
IntrinsicBase.hpp
IntrinsicInitMode.hpp
Distortion.hpp
DistortionRadial.hpp
DistortionBrown.hpp
DistortionFisheye.hpp
DistortionFisheye1.hpp
IntrinsicsScaleOffset.hpp
IntrinsicsScaleOffsetDisto.hpp
Pinhole.hpp
PinholeBrown.hpp
PinholeFisheye.hpp
PinholeFisheye1.hpp
PinholeRadial.hpp
Equidistant.hpp
EquidistantRadial.hpp
)

alicevision_add_interface(aliceVision_camera
Expand All @@ -23,7 +32,9 @@ alicevision_add_interface(aliceVision_camera
)

# Unit tests
alicevision_add_test(pinholeBrown_test.cpp NAME "camera_pinholeBrown" LINKS aliceVision_camera)
alicevision_add_test(pinholeFisheye_test.cpp NAME "camera_pinholeFisheye" LINKS aliceVision_camera)
alicevision_add_test(pinholeFisheye1_test.cpp NAME "camera_pinholeFisheye1" LINKS aliceVision_camera)
alicevision_add_test(pinholeRadial_test.cpp NAME "camera_pinholeRadial" LINKS aliceVision_camera)
alicevision_add_test(distortion_test.cpp NAME "camera_distortionRadial" LINKS aliceVision_camera)
alicevision_add_test(pinholeBrown_test.cpp NAME "camera_pinholeBrown" LINKS aliceVision_camera)
alicevision_add_test(pinholeFisheye_test.cpp NAME "camera_pinholeFisheye" LINKS aliceVision_camera)
alicevision_add_test(pinholeFisheye1_test.cpp NAME "camera_pinholeFisheye1" LINKS aliceVision_camera)
alicevision_add_test(pinholeRadial_test.cpp NAME "camera_pinholeRadial" LINKS aliceVision_camera)
alicevision_add_test(equidistant_test.cpp NAME "camera_equidistant" LINKS aliceVision_camera)
71 changes: 71 additions & 0 deletions src/aliceVision/camera/Distortion.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#pragma once

#include <vector>
#include <aliceVision/numeric/numeric.hpp>

namespace aliceVision{
namespace camera{

class Distortion
{
public:

Distortion() = default;

virtual Distortion* clone() const = 0;

std::vector<double>& getParameters()
{
return _distortionParams;
}

size_t getDistortionParametersCount()
{
return _distortionParams.size();
}

/// Add distortion to the point p (assume p is in the camera frame [normalized coordinates])
virtual Vec2 addDistortion(const Vec2& p) const
{
return p;
}

/// Remove distortion (return p' such that disto(p') = p)
virtual Vec2 removeDistortion(const Vec2& p) const
{
return p;
}

virtual double getUndistortedRadius(double r) const
{
return r;
}

virtual Eigen::Matrix2d getDerivativeAddDistoWrtPt(const Vec2& p) const
{
return Eigen::Matrix2d::Identity();
}

virtual Eigen::MatrixXd getDerivativeAddDistoWrtDisto(const Vec2& p) const
{
return Eigen::MatrixXd(0, 0);
}

virtual Eigen::Matrix2d getDerivativeRemoveDistoWrtPt(const Vec2& p) const
{
return Eigen::Matrix2d::Identity();
}

virtual Eigen::MatrixXd getDerivativeRemoveDistoWrtDisto(const Vec2& p) const
{
return Eigen::MatrixXd(0, 0);
}

virtual ~Distortion() = default;

protected:
std::vector<double> _distortionParams{};
};

} // namespace camera
} // namespace aliceVision
72 changes: 72 additions & 0 deletions src/aliceVision/camera/DistortionBrown.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// This file is part of the AliceVision project.
// Copyright (c) 2016 AliceVision contributors.
// Copyright (c) 2012 openMVG contributors.
// This Source Code Form is subject to the terms of the Mozilla Public License,
// v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.

#pragma once

#include <aliceVision/camera/Distortion.hpp>

namespace aliceVision {
namespace camera {

class DistortionBrown : public Distortion
{
public:
DistortionBrown()
{
_distortionParams = {0.0, 0.0, 0.0, 0.0, 0.0};
}

DistortionBrown(double p1, double p2, double p3, double p4, double p5)
{
_distortionParams = {p1, p2, p3, p4, p5};
}

DistortionBrown* clone() const override
{
return new DistortionBrown(*this);
}

/// Add distortion to the point p (assume p is in the camera frame [normalized coordinates])
Vec2 addDistortion(const Vec2& p) const override
{
return (p + distoFunction(_distortionParams, p));
}

/// Remove distortion (return p' such that disto(p') = p)
Vec2 removeDistortion(const Vec2& p) const override
{
const double epsilon = 1e-8; // criteria to stop the iteration
Vec2 p_u = p;

while((addDistortion(p_u) - p).lpNorm<1>() > epsilon) // manhattan distance between the two points
{
p_u = p - distoFunction(_distortionParams, p_u);
}

return p_u;
}

// Functor to calculate distortion offset accounting for both radial and tangential distortion
static Vec2 distoFunction(const std::vector<double>& params, const Vec2& p)
{
const double k1 = params[0], k2 = params[1], k3 = params[2], t1 = params[3], t2 = params[4];
const double r2 = p(0) * p(0) + p(1) * p(1);
const double r4 = r2 * r2;
const double r6 = r4 * r2;
const double k_diff = (k1 * r2 + k2 * r4 + k3 * r6);
const double t_x = t2 * (r2 + 2 * p(0) * p(0)) + 2 * t1 * p(0) * p(1);
const double t_y = t1 * (r2 + 2 * p(1) * p(1)) + 2 * t2 * p(0) * p(1);
Vec2 d(p(0) * k_diff + t_x, p(1) * k_diff + t_y);

return d;
}

~DistortionBrown() override = default;
};

} // namespace camera
} // namespace aliceVision
Loading