From be776d0562db81d0664e5c437ab8907873295b30 Mon Sep 17 00:00:00 2001 From: David OK Date: Mon, 15 Jul 2024 23:14:30 +0100 Subject: [PATCH] MAINT: move code and fix compile errors. --- cpp/drafts/CMakeLists.txt | 2 -- cpp/examples/Sara/CMakeLists.txt | 1 + .../Sara/ChessboardDetection}/CMakeLists.txt | 0 .../Utilities/ImageOrVideoReader.cpp | 0 .../Utilities/ImageOrVideoReader.hpp | 0 .../ChessboardDetection}/detect_corners.cpp | 12 +++++------- .../find_chessboard_corners.cpp | 3 +-- .../find_chessboard_corners_2.cpp | 16 ++++++++-------- .../find_chessboard_corners.cpp | 6 +++--- cpp/src/DO/Sara/CMakeLists.txt | 3 +++ .../DO/Sara}/Calibration/CMakeLists.txt | 2 -- .../DO/Sara}/Calibration/Chessboard.cpp | 2 +- .../DO/Sara}/Calibration/Chessboard.hpp | 2 +- .../DO/Sara}/Calibration/Utilities.hpp | 2 +- .../Sara}/ChessboardDetection/CMakeLists.txt | 2 -- .../ChessboardDetector.cpp | 10 +++++----- .../ChessboardDetector.hpp | 8 ++++---- .../CircularProfileExtractor.cpp | 2 +- .../CircularProfileExtractor.hpp | 0 .../DO/Sara}/ChessboardDetection/Corner.cpp | 4 ++-- .../DO/Sara}/ChessboardDetection/Corner.hpp | 0 .../ChessboardDetection/EdgeStatistics.cpp | 2 +- .../ChessboardDetection/EdgeStatistics.hpp | 0 .../ChessboardDetection/EllipseFitting.cpp | 0 .../ChessboardDetection/EllipseFitting.hpp | 0 .../DO/Sara}/ChessboardDetection/Erode.hpp | 0 .../ChessboardDetection/JunctionDetection.cpp | 9 ++++----- .../ChessboardDetection/JunctionDetection.hpp | 0 .../LineReconstruction.cpp | 4 ++-- .../LineReconstruction.hpp | 6 ++---- .../ChessboardDetection/LineUtilities.hpp | 2 +- .../NonMaximumSuppression.hpp | 0 .../OrientationHistogram.hpp | 0 .../ChessboardDetection/ParabolaFitting.hpp | 0 .../Sara}/ChessboardDetection/SquareGraph.hpp | 19 +++++-------------- .../SquareReconstruction.cpp | 2 +- .../SquareReconstruction.hpp | 4 ++-- .../DO/Sara}/ChessboardDetection/notes.md | 0 cpp/tools/CMakeLists.txt | 1 + .../tool => tools/Calibration}/CMakeLists.txt | 0 .../calibrate_omnidirectional_cameras.cpp | 8 +++----- .../Calibration}/calibrate_pinhole_camera.cpp | 9 ++++----- 42 files changed, 62 insertions(+), 81 deletions(-) rename cpp/{drafts/ChessboardDetection/examples => examples/Sara/ChessboardDetection}/CMakeLists.txt (100%) rename cpp/{drafts/ChessboardDetection/examples => examples/Sara/ChessboardDetection}/Utilities/ImageOrVideoReader.cpp (100%) rename cpp/{drafts/ChessboardDetection/examples => examples/Sara/ChessboardDetection}/Utilities/ImageOrVideoReader.hpp (100%) rename cpp/{drafts/ChessboardDetection/examples => examples/Sara/ChessboardDetection}/detect_corners.cpp (98%) rename cpp/{drafts/ChessboardDetection/examples => examples/Sara/ChessboardDetection}/find_chessboard_corners.cpp (99%) rename cpp/{drafts/ChessboardDetection/examples => examples/Sara/ChessboardDetection}/find_chessboard_corners_2.cpp (99%) rename cpp/{drafts => src/DO/Sara}/Calibration/CMakeLists.txt (92%) rename cpp/{drafts => src/DO/Sara}/Calibration/Chessboard.cpp (98%) rename cpp/{drafts => src/DO/Sara}/Calibration/Chessboard.hpp (98%) rename cpp/{drafts => src/DO/Sara}/Calibration/Utilities.hpp (99%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/CMakeLists.txt (96%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/ChessboardDetector.cpp (98%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/ChessboardDetector.hpp (97%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/CircularProfileExtractor.cpp (98%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/CircularProfileExtractor.hpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/Corner.cpp (97%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/Corner.hpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/EdgeStatistics.cpp (98%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/EdgeStatistics.hpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/EllipseFitting.cpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/EllipseFitting.hpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/Erode.hpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/JunctionDetection.cpp (95%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/JunctionDetection.hpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/LineReconstruction.cpp (98%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/LineReconstruction.hpp (96%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/LineUtilities.hpp (98%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/NonMaximumSuppression.hpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/OrientationHistogram.hpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/ParabolaFitting.hpp (100%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/SquareGraph.hpp (97%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/SquareReconstruction.cpp (99%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/SquareReconstruction.hpp (96%) rename cpp/{drafts => src/DO/Sara}/ChessboardDetection/notes.md (100%) rename cpp/{drafts/Calibration/tool => tools/Calibration}/CMakeLists.txt (100%) rename cpp/{drafts/Calibration/tool => tools/Calibration}/calibrate_omnidirectional_cameras.cpp (99%) rename cpp/{drafts/Calibration/tool => tools/Calibration}/calibrate_pinhole_camera.cpp (99%) diff --git a/cpp/drafts/CMakeLists.txt b/cpp/drafts/CMakeLists.txt index 08226d969..372f3235e 100644 --- a/cpp/drafts/CMakeLists.txt +++ b/cpp/drafts/CMakeLists.txt @@ -9,8 +9,6 @@ if(SARA_BUILD_TESTS) add_definitions(-DBOOST_ALL_NO_LIB) endif() -add_subdirectory(ChessboardDetection) -add_subdirectory(Calibration) add_subdirectory(Compute) add_subdirectory(MatchPropagation) add_subdirectory(NuScenes) diff --git a/cpp/examples/Sara/CMakeLists.txt b/cpp/examples/Sara/CMakeLists.txt index dd71f81b5..eba9d237b 100644 --- a/cpp/examples/Sara/CMakeLists.txt +++ b/cpp/examples/Sara/CMakeLists.txt @@ -13,4 +13,5 @@ if (SARA_BUILD_VIDEOIO) add_subdirectory(VideoIO) endif () +add_subdirectory(ChessboardDetection) add_subdirectory(NeuralNetworks) diff --git a/cpp/drafts/ChessboardDetection/examples/CMakeLists.txt b/cpp/examples/Sara/ChessboardDetection/CMakeLists.txt similarity index 100% rename from cpp/drafts/ChessboardDetection/examples/CMakeLists.txt rename to cpp/examples/Sara/ChessboardDetection/CMakeLists.txt diff --git a/cpp/drafts/ChessboardDetection/examples/Utilities/ImageOrVideoReader.cpp b/cpp/examples/Sara/ChessboardDetection/Utilities/ImageOrVideoReader.cpp similarity index 100% rename from cpp/drafts/ChessboardDetection/examples/Utilities/ImageOrVideoReader.cpp rename to cpp/examples/Sara/ChessboardDetection/Utilities/ImageOrVideoReader.cpp diff --git a/cpp/drafts/ChessboardDetection/examples/Utilities/ImageOrVideoReader.hpp b/cpp/examples/Sara/ChessboardDetection/Utilities/ImageOrVideoReader.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/examples/Utilities/ImageOrVideoReader.hpp rename to cpp/examples/Sara/ChessboardDetection/Utilities/ImageOrVideoReader.hpp diff --git a/cpp/drafts/ChessboardDetection/examples/detect_corners.cpp b/cpp/examples/Sara/ChessboardDetection/detect_corners.cpp similarity index 98% rename from cpp/drafts/ChessboardDetection/examples/detect_corners.cpp rename to cpp/examples/Sara/ChessboardDetection/detect_corners.cpp index 9a0cd3f53..116e339db 100644 --- a/cpp/drafts/ChessboardDetection/examples/detect_corners.cpp +++ b/cpp/examples/Sara/ChessboardDetection/detect_corners.cpp @@ -11,18 +11,16 @@ //! @example -#ifdef _OPENMP -#include -#endif - +#include #include - #include -#include - #include "Utilities/ImageOrVideoReader.hpp" +#ifdef _OPENMP +# include +#endif + #include diff --git a/cpp/drafts/ChessboardDetection/examples/find_chessboard_corners.cpp b/cpp/examples/Sara/ChessboardDetection/find_chessboard_corners.cpp similarity index 99% rename from cpp/drafts/ChessboardDetection/examples/find_chessboard_corners.cpp rename to cpp/examples/Sara/ChessboardDetection/find_chessboard_corners.cpp index 57b3ac298..6b43d674f 100644 --- a/cpp/drafts/ChessboardDetection/examples/find_chessboard_corners.cpp +++ b/cpp/examples/Sara/ChessboardDetection/find_chessboard_corners.cpp @@ -17,10 +17,9 @@ #include +#include #include -#include - #include "Utilities/ImageOrVideoReader.hpp" #include diff --git a/cpp/drafts/ChessboardDetection/examples/find_chessboard_corners_2.cpp b/cpp/examples/Sara/ChessboardDetection/find_chessboard_corners_2.cpp similarity index 99% rename from cpp/drafts/ChessboardDetection/examples/find_chessboard_corners_2.cpp rename to cpp/examples/Sara/ChessboardDetection/find_chessboard_corners_2.cpp index a4c3cfa5d..b7262ffc9 100644 --- a/cpp/drafts/ChessboardDetection/examples/find_chessboard_corners_2.cpp +++ b/cpp/examples/Sara/ChessboardDetection/find_chessboard_corners_2.cpp @@ -13,13 +13,7 @@ //! This partially implements OpenCV ideas used to detect the chessboard to draw //! some intuitions. -#ifdef _OPENMP -# include -#endif - -#include -#include - +#include #include #include #include @@ -32,7 +26,13 @@ #include #include -#include + +#ifdef _OPENMP +# include +#endif + +#include +#include namespace sara = DO::Sara; diff --git a/cpp/examples/Sara/ImageProcessing/find_chessboard_corners.cpp b/cpp/examples/Sara/ImageProcessing/find_chessboard_corners.cpp index c544873e4..82dcd6b26 100644 --- a/cpp/examples/Sara/ImageProcessing/find_chessboard_corners.cpp +++ b/cpp/examples/Sara/ImageProcessing/find_chessboard_corners.cpp @@ -24,9 +24,9 @@ #include #include -#include "Chessboard/CircularProfileExtractor.hpp" -#include "Chessboard/JunctionDetection.hpp" -#include "Chessboard/NonMaximumSuppression.hpp" +#include +#include +#include namespace sara = DO::Sara; diff --git a/cpp/src/DO/Sara/CMakeLists.txt b/cpp/src/DO/Sara/CMakeLists.txt index 9011f2cad..92d68a74b 100644 --- a/cpp/src/DO/Sara/CMakeLists.txt +++ b/cpp/src/DO/Sara/CMakeLists.txt @@ -32,4 +32,7 @@ include(UseDOSaraRANSAC) include(UseDOSaraVisualization) +add_subdirectory(ChessboardDetection) +add_subdirectory(Calibration) + add_subdirectory(NeuralNetworks) diff --git a/cpp/drafts/Calibration/CMakeLists.txt b/cpp/src/DO/Sara/Calibration/CMakeLists.txt similarity index 92% rename from cpp/drafts/Calibration/CMakeLists.txt rename to cpp/src/DO/Sara/Calibration/CMakeLists.txt index 30fcbf246..4445729c3 100644 --- a/cpp/drafts/Calibration/CMakeLists.txt +++ b/cpp/src/DO/Sara/Calibration/CMakeLists.txt @@ -5,5 +5,3 @@ add_library( target_link_libraries(DO_Sara_Calibration PUBLIC DO::Sara::Core DO::Sara::Graphics) set_property(TARGET DO_Sara_Calibration PROPERTY FOLDER "Libraries/Sara") - -add_subdirectory(tool) diff --git a/cpp/drafts/Calibration/Chessboard.cpp b/cpp/src/DO/Sara/Calibration/Chessboard.cpp similarity index 98% rename from cpp/drafts/Calibration/Chessboard.cpp rename to cpp/src/DO/Sara/Calibration/Chessboard.cpp index 8a49850d7..aa05215f7 100644 --- a/cpp/drafts/Calibration/Chessboard.cpp +++ b/cpp/src/DO/Sara/Calibration/Chessboard.cpp @@ -11,7 +11,7 @@ //! @file -#include +#include namespace DO::Sara { diff --git a/cpp/drafts/Calibration/Chessboard.hpp b/cpp/src/DO/Sara/Calibration/Chessboard.hpp similarity index 98% rename from cpp/drafts/Calibration/Chessboard.hpp rename to cpp/src/DO/Sara/Calibration/Chessboard.hpp index e37dfa7af..4c6afeec0 100644 --- a/cpp/drafts/Calibration/Chessboard.hpp +++ b/cpp/src/DO/Sara/Calibration/Chessboard.hpp @@ -13,7 +13,7 @@ #pragma once -#include +#include #include diff --git a/cpp/drafts/Calibration/Utilities.hpp b/cpp/src/DO/Sara/Calibration/Utilities.hpp similarity index 99% rename from cpp/drafts/Calibration/Utilities.hpp rename to cpp/src/DO/Sara/Calibration/Utilities.hpp index 075371d5c..aea55e0ca 100644 --- a/cpp/drafts/Calibration/Utilities.hpp +++ b/cpp/src/DO/Sara/Calibration/Utilities.hpp @@ -11,7 +11,7 @@ #pragma once -#include +#include #include #include diff --git a/cpp/drafts/ChessboardDetection/CMakeLists.txt b/cpp/src/DO/Sara/ChessboardDetection/CMakeLists.txt similarity index 96% rename from cpp/drafts/ChessboardDetection/CMakeLists.txt rename to cpp/src/DO/Sara/ChessboardDetection/CMakeLists.txt index 78d816dae..1a0276280 100644 --- a/cpp/drafts/ChessboardDetection/CMakeLists.txt +++ b/cpp/src/DO/Sara/ChessboardDetection/CMakeLists.txt @@ -28,5 +28,3 @@ target_link_libraries( DO_Sara_ChessboardDetection PUBLIC DO::Sara::ImageProcessing # DO::Sara::FeatureDetectors) - -add_subdirectory(examples) diff --git a/cpp/drafts/ChessboardDetection/ChessboardDetector.cpp b/cpp/src/DO/Sara/ChessboardDetection/ChessboardDetector.cpp similarity index 98% rename from cpp/drafts/ChessboardDetection/ChessboardDetector.cpp rename to cpp/src/DO/Sara/ChessboardDetection/ChessboardDetector.cpp index a0b6181ee..89296e333 100644 --- a/cpp/drafts/ChessboardDetection/ChessboardDetector.cpp +++ b/cpp/src/DO/Sara/ChessboardDetection/ChessboardDetector.cpp @@ -9,11 +9,11 @@ // you can obtain one at http://mozilla.org/MPL/2.0/. // ========================================================================== // -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/cpp/drafts/ChessboardDetection/ChessboardDetector.hpp b/cpp/src/DO/Sara/ChessboardDetection/ChessboardDetector.hpp similarity index 97% rename from cpp/drafts/ChessboardDetection/ChessboardDetector.hpp rename to cpp/src/DO/Sara/ChessboardDetection/ChessboardDetector.hpp index dc1a066fd..769870d7e 100644 --- a/cpp/drafts/ChessboardDetection/ChessboardDetector.hpp +++ b/cpp/src/DO/Sara/ChessboardDetection/ChessboardDetector.hpp @@ -18,10 +18,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace DO::Sara { diff --git a/cpp/drafts/ChessboardDetection/CircularProfileExtractor.cpp b/cpp/src/DO/Sara/ChessboardDetection/CircularProfileExtractor.cpp similarity index 98% rename from cpp/drafts/ChessboardDetection/CircularProfileExtractor.cpp rename to cpp/src/DO/Sara/ChessboardDetection/CircularProfileExtractor.cpp index c940b220d..2406ede7d 100644 --- a/cpp/drafts/ChessboardDetection/CircularProfileExtractor.cpp +++ b/cpp/src/DO/Sara/ChessboardDetection/CircularProfileExtractor.cpp @@ -9,7 +9,7 @@ // you can obtain one at http://mozilla.org/MPL/2.0/. // ========================================================================== // -#include "CircularProfileExtractor.hpp" +#include #include diff --git a/cpp/drafts/ChessboardDetection/CircularProfileExtractor.hpp b/cpp/src/DO/Sara/ChessboardDetection/CircularProfileExtractor.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/CircularProfileExtractor.hpp rename to cpp/src/DO/Sara/ChessboardDetection/CircularProfileExtractor.hpp diff --git a/cpp/drafts/ChessboardDetection/Corner.cpp b/cpp/src/DO/Sara/ChessboardDetection/Corner.cpp similarity index 97% rename from cpp/drafts/ChessboardDetection/Corner.cpp rename to cpp/src/DO/Sara/ChessboardDetection/Corner.cpp index 0162f050b..6f0a0664d 100644 --- a/cpp/drafts/ChessboardDetection/Corner.cpp +++ b/cpp/src/DO/Sara/ChessboardDetection/Corner.cpp @@ -9,8 +9,8 @@ // you can obtain one at http://mozilla.org/MPL/2.0/. // ========================================================================== // -#include "Corner.hpp" -#include "NonMaximumSuppression.hpp" +#include +#include #include diff --git a/cpp/drafts/ChessboardDetection/Corner.hpp b/cpp/src/DO/Sara/ChessboardDetection/Corner.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/Corner.hpp rename to cpp/src/DO/Sara/ChessboardDetection/Corner.hpp diff --git a/cpp/drafts/ChessboardDetection/EdgeStatistics.cpp b/cpp/src/DO/Sara/ChessboardDetection/EdgeStatistics.cpp similarity index 98% rename from cpp/drafts/ChessboardDetection/EdgeStatistics.cpp rename to cpp/src/DO/Sara/ChessboardDetection/EdgeStatistics.cpp index 6d3556207..e31d8068b 100644 --- a/cpp/drafts/ChessboardDetection/EdgeStatistics.cpp +++ b/cpp/src/DO/Sara/ChessboardDetection/EdgeStatistics.cpp @@ -9,7 +9,7 @@ // you can obtain one at http://mozilla.org/MPL/2.0/. // ========================================================================== // -#include "EdgeStatistics.hpp" +#include namespace DO::Sara { diff --git a/cpp/drafts/ChessboardDetection/EdgeStatistics.hpp b/cpp/src/DO/Sara/ChessboardDetection/EdgeStatistics.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/EdgeStatistics.hpp rename to cpp/src/DO/Sara/ChessboardDetection/EdgeStatistics.hpp diff --git a/cpp/drafts/ChessboardDetection/EllipseFitting.cpp b/cpp/src/DO/Sara/ChessboardDetection/EllipseFitting.cpp similarity index 100% rename from cpp/drafts/ChessboardDetection/EllipseFitting.cpp rename to cpp/src/DO/Sara/ChessboardDetection/EllipseFitting.cpp diff --git a/cpp/drafts/ChessboardDetection/EllipseFitting.hpp b/cpp/src/DO/Sara/ChessboardDetection/EllipseFitting.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/EllipseFitting.hpp rename to cpp/src/DO/Sara/ChessboardDetection/EllipseFitting.hpp diff --git a/cpp/drafts/ChessboardDetection/Erode.hpp b/cpp/src/DO/Sara/ChessboardDetection/Erode.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/Erode.hpp rename to cpp/src/DO/Sara/ChessboardDetection/Erode.hpp diff --git a/cpp/drafts/ChessboardDetection/JunctionDetection.cpp b/cpp/src/DO/Sara/ChessboardDetection/JunctionDetection.cpp similarity index 95% rename from cpp/drafts/ChessboardDetection/JunctionDetection.cpp rename to cpp/src/DO/Sara/ChessboardDetection/JunctionDetection.cpp index 02fb44d1f..f29d2f990 100644 --- a/cpp/drafts/ChessboardDetection/JunctionDetection.cpp +++ b/cpp/src/DO/Sara/ChessboardDetection/JunctionDetection.cpp @@ -9,19 +9,18 @@ // you can obtain one at http://mozilla.org/MPL/2.0/. // ========================================================================== // +#include + #ifdef _OPENMP -#include +# include #endif -#include "JunctionDetection.hpp" - namespace DO::Sara { auto junction_map(const ImageView& image, const ImageView& gradients, - const float sigma) - -> Image + const float sigma) -> Image { auto junction_map = Image{image.sizes()}; junction_map.flat_array().fill(0); diff --git a/cpp/drafts/ChessboardDetection/JunctionDetection.hpp b/cpp/src/DO/Sara/ChessboardDetection/JunctionDetection.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/JunctionDetection.hpp rename to cpp/src/DO/Sara/ChessboardDetection/JunctionDetection.hpp diff --git a/cpp/drafts/ChessboardDetection/LineReconstruction.cpp b/cpp/src/DO/Sara/ChessboardDetection/LineReconstruction.cpp similarity index 98% rename from cpp/drafts/ChessboardDetection/LineReconstruction.cpp rename to cpp/src/DO/Sara/ChessboardDetection/LineReconstruction.cpp index c4029fc9d..2ddafbc34 100644 --- a/cpp/drafts/ChessboardDetection/LineReconstruction.cpp +++ b/cpp/src/DO/Sara/ChessboardDetection/LineReconstruction.cpp @@ -9,8 +9,8 @@ // you can obtain one at http://mozilla.org/MPL/2.0/. // ========================================================================== // -#include "LineReconstruction.hpp" -#include "SquareReconstruction.hpp" +#include +#include namespace DO::Sara { diff --git a/cpp/drafts/ChessboardDetection/LineReconstruction.hpp b/cpp/src/DO/Sara/ChessboardDetection/LineReconstruction.hpp similarity index 96% rename from cpp/drafts/ChessboardDetection/LineReconstruction.hpp rename to cpp/src/DO/Sara/ChessboardDetection/LineReconstruction.hpp index 2acbbf6ec..344bf4655 100644 --- a/cpp/drafts/ChessboardDetection/LineReconstruction.hpp +++ b/cpp/src/DO/Sara/ChessboardDetection/LineReconstruction.hpp @@ -11,12 +11,10 @@ #pragma once -#include - +#include #include -#include "SquareReconstruction.hpp" - +#include namespace DO::Sara { diff --git a/cpp/drafts/ChessboardDetection/LineUtilities.hpp b/cpp/src/DO/Sara/ChessboardDetection/LineUtilities.hpp similarity index 98% rename from cpp/drafts/ChessboardDetection/LineUtilities.hpp rename to cpp/src/DO/Sara/ChessboardDetection/LineUtilities.hpp index 540cabce8..ee2849c33 100644 --- a/cpp/drafts/ChessboardDetection/LineUtilities.hpp +++ b/cpp/src/DO/Sara/ChessboardDetection/LineUtilities.hpp @@ -11,7 +11,7 @@ #pragma once -#include "ChessboardDetector.hpp" +#include namespace DO::Sara { diff --git a/cpp/drafts/ChessboardDetection/NonMaximumSuppression.hpp b/cpp/src/DO/Sara/ChessboardDetection/NonMaximumSuppression.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/NonMaximumSuppression.hpp rename to cpp/src/DO/Sara/ChessboardDetection/NonMaximumSuppression.hpp diff --git a/cpp/drafts/ChessboardDetection/OrientationHistogram.hpp b/cpp/src/DO/Sara/ChessboardDetection/OrientationHistogram.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/OrientationHistogram.hpp rename to cpp/src/DO/Sara/ChessboardDetection/OrientationHistogram.hpp diff --git a/cpp/drafts/ChessboardDetection/ParabolaFitting.hpp b/cpp/src/DO/Sara/ChessboardDetection/ParabolaFitting.hpp similarity index 100% rename from cpp/drafts/ChessboardDetection/ParabolaFitting.hpp rename to cpp/src/DO/Sara/ChessboardDetection/ParabolaFitting.hpp diff --git a/cpp/drafts/ChessboardDetection/SquareGraph.hpp b/cpp/src/DO/Sara/ChessboardDetection/SquareGraph.hpp similarity index 97% rename from cpp/drafts/ChessboardDetection/SquareGraph.hpp rename to cpp/src/DO/Sara/ChessboardDetection/SquareGraph.hpp index 9b93f9497..fe2ff18e5 100644 --- a/cpp/drafts/ChessboardDetection/SquareGraph.hpp +++ b/cpp/src/DO/Sara/ChessboardDetection/SquareGraph.hpp @@ -11,8 +11,7 @@ #pragma once -#include "Corner.hpp" - +#include #include #include @@ -297,9 +296,7 @@ namespace DO::Sara { for (auto x = 0; x < cols(cb); ++x) { new_row.push_back(ChessboardSquare{ - -1, - Eigen::Vector2i{anchor.x() + x, curr_coords.y() - 1}, - {} // + -1, Eigen::Vector2i{anchor.x() + x, curr_coords.y() - 1}, {} // }); } cb.emplace_front(std::move(new_row)); @@ -312,9 +309,7 @@ namespace DO::Sara { for (auto x = 0; x < cols(cb); ++x) { new_row.push_back(ChessboardSquare{ - -1, - Eigen::Vector2i{anchor.x() + x, curr_coords.y() + 1}, - {} // + -1, Eigen::Vector2i{anchor.x() + x, curr_coords.y() + 1}, {} // }); } @@ -327,9 +322,7 @@ namespace DO::Sara { for (auto y = 0; y < rows(cb); ++y) { cb[y].push_front(ChessboardSquare{ - -1, - Eigen::Vector2i{curr_coords.x() - 1, anchor.y() + y}, - {} // + -1, Eigen::Vector2i{curr_coords.x() - 1, anchor.y() + y}, {} // }); } } @@ -339,9 +332,7 @@ namespace DO::Sara { for (auto y = 0; y < rows(cb); ++y) { cb[y].push_back(ChessboardSquare{ - -1, - Eigen::Vector2i{curr_coords.x() + 1, anchor.y() + y}, - {} // + -1, Eigen::Vector2i{curr_coords.x() + 1, anchor.y() + y}, {} // }); } } diff --git a/cpp/drafts/ChessboardDetection/SquareReconstruction.cpp b/cpp/src/DO/Sara/ChessboardDetection/SquareReconstruction.cpp similarity index 99% rename from cpp/drafts/ChessboardDetection/SquareReconstruction.cpp rename to cpp/src/DO/Sara/ChessboardDetection/SquareReconstruction.cpp index 5f34bc169..b24fd4b16 100644 --- a/cpp/drafts/ChessboardDetection/SquareReconstruction.cpp +++ b/cpp/src/DO/Sara/ChessboardDetection/SquareReconstruction.cpp @@ -9,7 +9,7 @@ // you can obtain one at http://mozilla.org/MPL/2.0/. // ========================================================================== // -#include "SquareReconstruction.hpp" +#include namespace DO::Sara { diff --git a/cpp/drafts/ChessboardDetection/SquareReconstruction.hpp b/cpp/src/DO/Sara/ChessboardDetection/SquareReconstruction.hpp similarity index 96% rename from cpp/drafts/ChessboardDetection/SquareReconstruction.hpp rename to cpp/src/DO/Sara/ChessboardDetection/SquareReconstruction.hpp index ba1e2b4bf..509ec3dcc 100644 --- a/cpp/drafts/ChessboardDetection/SquareReconstruction.hpp +++ b/cpp/src/DO/Sara/ChessboardDetection/SquareReconstruction.hpp @@ -11,11 +11,11 @@ #pragma once +#include + #include #include -#include "Corner.hpp" - namespace DO::Sara { diff --git a/cpp/drafts/ChessboardDetection/notes.md b/cpp/src/DO/Sara/ChessboardDetection/notes.md similarity index 100% rename from cpp/drafts/ChessboardDetection/notes.md rename to cpp/src/DO/Sara/ChessboardDetection/notes.md diff --git a/cpp/tools/CMakeLists.txt b/cpp/tools/CMakeLists.txt index 1cc84502c..b9785e4fe 100644 --- a/cpp/tools/CMakeLists.txt +++ b/cpp/tools/CMakeLists.txt @@ -1 +1,2 @@ +add_subdirectory(Calibration) add_subdirectory(ImageAnnotator) diff --git a/cpp/drafts/Calibration/tool/CMakeLists.txt b/cpp/tools/Calibration/CMakeLists.txt similarity index 100% rename from cpp/drafts/Calibration/tool/CMakeLists.txt rename to cpp/tools/Calibration/CMakeLists.txt diff --git a/cpp/drafts/Calibration/tool/calibrate_omnidirectional_cameras.cpp b/cpp/tools/Calibration/calibrate_omnidirectional_cameras.cpp similarity index 99% rename from cpp/drafts/Calibration/tool/calibrate_omnidirectional_cameras.cpp rename to cpp/tools/Calibration/calibrate_omnidirectional_cameras.cpp index 795e445fd..ab96249f5 100644 --- a/cpp/drafts/Calibration/tool/calibrate_omnidirectional_cameras.cpp +++ b/cpp/tools/Calibration/calibrate_omnidirectional_cameras.cpp @@ -11,15 +11,13 @@ //! @file -#include -#include - +#include +#include #include #include -#include - #include #include +#include namespace sara = DO::Sara; diff --git a/cpp/drafts/Calibration/tool/calibrate_pinhole_camera.cpp b/cpp/tools/Calibration/calibrate_pinhole_camera.cpp similarity index 99% rename from cpp/drafts/Calibration/tool/calibrate_pinhole_camera.cpp rename to cpp/tools/Calibration/calibrate_pinhole_camera.cpp index bb7b716f3..6288011cd 100644 --- a/cpp/drafts/Calibration/tool/calibrate_pinhole_camera.cpp +++ b/cpp/tools/Calibration/calibrate_pinhole_camera.cpp @@ -11,17 +11,15 @@ //! @file -#include - +#include #include #include #include -#include - #include #include #include #include +#include namespace sara = DO::Sara; @@ -33,7 +31,8 @@ class ChessboardCalibrationData static constexpr auto extrinsic_parameter_count = sara::PinholeCameraReprojectionError::extrinsic_parameter_count; - auto initialize_intrinsics(const sara::v2::PinholeCamera& camera) -> void + auto initialize_intrinsics(const sara::v2::PinholeCamera& camera) + -> void { // fx _intrinsics.fx() = camera.fx();