Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 2a39e1d

Browse files
committed
Merge branch 'develop'
2 parents 3765d3d + 5912aff commit 2a39e1d

File tree

181 files changed

+4642
-1188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+4642
-1188
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ doxygen/
7676
# Tests builds
7777
tests/bin
7878

79+
# Tests data
80+
tests/data
81+
7982
# Others
8083
*.*pre1
8184
*.rej

JenkinsFile

-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ node("master") {
44
dirName="SolARBuild"
55
runTests=true
66
buildDir="SolARModuleOpenCV"
7-
android=true
87
}
98

109
SolArModulePipeline {
1110
moduleName="SolARModuleOpenCVCuda"
1211
dirName="SolARBuild"
1312
runTests=true
1413
buildDir="SolARModuleOpenCVCuda"
15-
android=false
1614
}
1715
}

SolARModuleOpenCV.pri

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ HEADERS += $$PWD/interfaces/SolAR2D3DcorrespondencesFinderOpencv.h \
77
$$PWD/interfaces/SolARContoursExtractorOpencv.h \
88
$$PWD/interfaces/SolARContoursFilterBinaryMarkerOpencv.h \
99
$$PWD/interfaces/SolARCornerRefinementOpencv.h \
10+
$$PWD/interfaces/SolARGenericSemanticSegmentationOpencv.h \
1011
$$PWD/interfaces/SolARDescriptorMatcherHammingBruteForceOpencv.h \
1112
$$PWD/interfaces/SolARDescriptorMatcherKNNOpencv.h \
1213
$$PWD/interfaces/SolARDescriptorMatcherRadiusOpencv.h \
@@ -88,6 +89,7 @@ SOURCES += $$PWD/src/AKAZE2/akaze.cpp \
8889
$$PWD/src/SolARContoursExtractorOpencv.cpp \
8990
$$PWD/src/SolARContoursFilterBinaryMarkerOpencv.cpp \
9091
$$PWD/src/SolARCornerRefinementOpencv.cpp \
92+
$$PWD/src/SolARGenericSemanticSegmentationOpencv.cpp \
9193
$$PWD/src/SolARDescriptorMatcherHammingBruteForceOpencv.cpp \
9294
$$PWD/src/SolARDescriptorMatcherKNNOpencv.cpp \
9395
$$PWD/src/SolARDescriptorMatcherRadiusOpencv.cpp \

SolARModuleOpenCV/SolARModuleOpenCV.pro

+1-22
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ QMAKE_PROJECT_DEPTH = 0
88
INSTALLSUBDIR = SolARBuild
99
TARGET = SolARModuleOpenCV
1010
FRAMEWORK = $$TARGET
11-
VERSION=0.11.0
11+
VERSION=1.0.0
1212

1313
DEFINES += MYVERSION=$${VERSION}
1414
DEFINES += TEMPLATE_LIBRARY
@@ -48,29 +48,14 @@ include (../SolARModuleOpenCV.pri)
4848
unix {
4949
# Avoids adding install steps manually. To be commented to have a better control over them.
5050
QMAKE_POST_LINK += "make install install_deps"
51-
}
52-
53-
unix:!android {
5451
QMAKE_CXXFLAGS += -Wignored-qualifiers
55-
# QMAKE_LINK=clang++
56-
# QMAKE_CXX = clang++
5752
}
5853

5954
linux {
6055
QMAKE_LFLAGS += -ldl
6156
LIBS += -L/home/linuxbrew/.linuxbrew/lib # temporary fix caused by grpc with -lre2 ... without -L in grpc.pc
6257
}
6358

64-
macx {
65-
DEFINES += _MACOS_TARGET_
66-
QMAKE_MAC_SDK= macosx
67-
QMAKE_CFLAGS += -mmacosx-version-min=10.7 -std=c11 #-x objective-c++
68-
QMAKE_CXXFLAGS += -mmacosx-version-min=10.7 -std=c11 -std=c++11 -O3 -fPIC#-x objective-c++
69-
QMAKE_LFLAGS += -mmacosx-version-min=10.7 -v -lstdc++
70-
LIBS += -lstdc++ -lc -lpthread
71-
LIBS += -L/usr/local/lib
72-
}
73-
7459
win32 {
7560

7661
DEFINES += WIN64 UNICODE _UNICODE
@@ -80,10 +65,6 @@ win32 {
8065
QMAKE_CXXFLAGS_RELEASE += /O2
8166
}
8267

83-
android {
84-
ANDROID_ABIS="arm64-v8a"
85-
}
86-
8768
header_files.path = $${PROJECTDEPLOYDIR}/interfaces
8869
header_files.files = $$files($${PWD}/../interfaces/*.h*)
8970

@@ -96,9 +77,7 @@ INSTALLS += xpcf_xml_files
9677
OTHER_FILES += \
9778
packagedependencies.txt \
9879
packagedependencies-linux.txt \
99-
packagedependencies-mac.txt \
10080
packagedependencies-win.txt \
101-
packagedependencies-android.txt \
10281
extra-packages.txt \
10382
extra-packages-linux.txt
10483

SolARModuleOpenCV/bcom-SolARModuleOpenCV.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ libdir=${exec_prefix}/lib
55
includedir=${prefix}/interfaces
66
Name: SolARModuleOpenCV
77
Description:
8-
Version: 0.11.0
8+
Version: 1.0.0
99
Requires:
1010
Libs: -L${libdir} -l${libname}
1111
Libs.private: ${libdir}/${pfx}${libname}.${lext}

SolARModuleOpenCV/packagedependencies-android.txt

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
opencv|4.5.5|opencv|conan-solar@conan|conan-solar|default|
1+
opencv#1_0_0|4.5.5|opencv|conan-solar@conan|conan-solar|default|

SolARModuleOpenCV/packagedependencies-mac.txt

-2
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
opencv|4.5.5|opencv|conan-solar@conan|conan-solar|default|with_ffmpeg=False
1+
opencv#1_0_0|4.5.5|opencv|conan-solar@conan|conan-solar|default|with_ffmpeg=False
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SolARFramework|0.11.0|SolARFramework|SolARBuild@github|https://github.com/SolarFramework/SolarFramework/releases/download
1+
SolARFramework|1.0.0|SolARFramework|SolARBuild@github|https://github.com/SolarFramework/SolarFramework/releases/download

SolARModuleOpenCV/xpcf_SolARModuleOpenCV_registry.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
22
<xpcf-registry>
3-
<module uuid="15e1990b-86b2-445c-8194-0cbe80ede970" name="SolARModuleOpenCV" description="SolARModuleOpenCV" path="$XPCF_MODULE_ROOT/SolARBuild/SolARModuleOpenCV/0.11.0/lib/x86_64/shared">
3+
<module uuid="15e1990b-86b2-445c-8194-0cbe80ede970" name="SolARModuleOpenCV" description="SolARModuleOpenCV" path="$XPCF_MODULE_ROOT/SolARBuild/SolARModuleOpenCV/1.0.0/lib/x86_64/shared">
44
<component uuid="cedd8c47-e7b0-47bf-abb1-7fb54d198117" name="SolAR2D3DCorrespondencesFinderOpencv" description="SolAR2D3DCorrespondencesFinderOpencv">
55
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
66
<interface uuid="0404e8b9-b824-4852-a34d-6eafa7563918" name="I2D3DCorrespondencesFinder" description="I2D3DCorrespondencesFinder"/>
@@ -165,5 +165,13 @@
165165
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
166166
<interface uuid="5DDC7DF0-8377-437F-9C81-3643F7676A5B" name="ICamera" description="ICamera"/>
167167
</component>
168+
<component uuid="77a8b776-6b0c-4bc0-b0a8-437a796b8e29" name="SolARFCNSegmentationOpencv" description="SolARFCNSegmentationOpencv">
169+
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
170+
<interface uuid="2fd30b7c-c6e4-4af7-a711-0b69964e68c2" name="ISemanticSegmentation" description="ISemanticSegmentation"/>
171+
</component>
172+
<component uuid="063d3086-6c87-49ff-87db-9a4ff224b5c8" name="SolARGenericSemanticSegmentationOpencv" description="SolARGenericSemanticSegmentationOpencv">
173+
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
174+
<interface uuid="2fd30b7c-c6e4-4af7-a711-0b69964e68c2" name="ISemanticSegmentation" description="ISemanticSegmentation"/>
175+
</component>
168176
</module>
169177
</xpcf-registry>

SolARModuleOpenCVCuda/SolARModuleOpenCVCuda.pro

+1-22
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ QMAKE_PROJECT_DEPTH = 0
88
INSTALLSUBDIR = SolARBuild
99
TARGET = SolARModuleOpenCVCuda
1010
FRAMEWORK = $$TARGET
11-
VERSION=0.11.0
11+
VERSION=1.0.0
1212

1313
DEFINES += MYVERSION=$${VERSION}
1414
DEFINES += TEMPLATE_LIBRARY
@@ -48,29 +48,14 @@ include (../SolARModuleOpenCV.pri)
4848
unix {
4949
# Avoids adding install steps manually. To be commented to have a better control over them.
5050
QMAKE_POST_LINK += "make install install_deps"
51-
}
52-
53-
unix:!android {
5451
QMAKE_CXXFLAGS += -Wignored-qualifiers
55-
# QMAKE_LINK=clang++
56-
# QMAKE_CXX = clang++
5752
}
5853

5954
linux {
6055
QMAKE_LFLAGS += -ldl
6156
LIBS += -L/home/linuxbrew/.linuxbrew/lib # temporary fix caused by grpc with -lre2 ... without -L in grpc.pc
6257
}
6358

64-
macx {
65-
DEFINES += _MACOS_TARGET_
66-
QMAKE_MAC_SDK= macosx
67-
QMAKE_CFLAGS += -mmacosx-version-min=10.7 -std=c11 #-x objective-c++
68-
QMAKE_CXXFLAGS += -mmacosx-version-min=10.7 -std=c11 -std=c++11 -O3 -fPIC#-x objective-c++
69-
QMAKE_LFLAGS += -mmacosx-version-min=10.7 -v -lstdc++
70-
LIBS += -lstdc++ -lc -lpthread
71-
LIBS += -L/usr/local/lib
72-
}
73-
7459
win32 {
7560

7661
DEFINES += WIN64 UNICODE _UNICODE
@@ -80,10 +65,6 @@ win32 {
8065
QMAKE_CXXFLAGS_RELEASE += /O2
8166
}
8267

83-
android {
84-
ANDROID_ABIS="arm64-v8a"
85-
}
86-
8768
header_files.path = $${PROJECTDEPLOYDIR}/interfaces
8869
header_files.files = $$files($${PWD}/../interfaces/*.h*)
8970

@@ -96,9 +77,7 @@ INSTALLS += xpcf_xml_files
9677
OTHER_FILES += \
9778
packagedependencies.txt \
9879
packagedependencies-linux.txt \
99-
packagedependencies-mac.txt \
10080
packagedependencies-win.txt \
101-
packagedependencies-android.txt
10281

10382
#NOTE : Must be placed at the end of the .pro
10483
include ($$shell_quote($$shell_path($${QMAKE_REMAKEN_RULES_ROOT}/remaken_install_target.pri)))) # Shell_quote & shell_path required for visual on windows

SolARModuleOpenCVCuda/bcom-SolARModuleOpenCVCuda.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ libdir=${exec_prefix}/lib
55
includedir=${prefix}/interfaces
66
Name: SolARModuleOpenCVCuda
77
Description:
8-
Version: 0.11.0
8+
Version: 1.0.0
99
Requires:
1010
Libs: -L${libdir} -l${libname}
1111
Libs.private: ${libdir}/${pfx}${libname}.${lext}

SolARModuleOpenCVCuda/packagedependencies-android.txt

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
opencv|4.5.5|opencv|conan-solar@conan|conan-solar|default|contrib=True#with_cuda=True#with_cublas=True#with_cudnn=True#dnn=True
1+
opencv#1_0_0|4.5.5|opencv|conan-solar@conan|conan-solar|default|contrib=True#with_cuda=True#with_cublas=True#with_cudnn=True#dnn=True#dnn_cuda=True

SolARModuleOpenCVCuda/packagedependencies-mac.txt

-2
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
opencv|4.5.5|opencv|conan-solar@conan|conan-solar|default|contrib=True#with_cuda=True#with_cublas=True#with_cudnn=True#dnn=True#with_ffmpeg=False
1+
opencv#1_0_0|4.5.5|opencv|conan-solar@conan|conan-solar|default|contrib=True#with_cuda=True#with_cublas=True#with_cudnn=True#dnn=True#dnn_cuda=True#with_ffmpeg=False
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SolARFramework|0.11.0|SolARFramework|SolARBuild@github|https://github.com/SolarFramework/SolarFramework/releases/download
1+
SolARFramework|1.0.0|SolARFramework|SolARBuild@github|https://github.com/SolarFramework/SolarFramework/releases/download

SolARModuleOpenCVCuda/xpcf_SolARModuleOpenCVCuda_registry.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
22
<xpcf-registry>
3-
<module uuid="fde83ee6-3e22-4531-9e1c-54cb0a3bf3fa" name="SolARModuleOpenCVCuda" description="SolARModuleOpenCVCuda" path="$XPCF_MODULE_ROOT/SolARBuild/SolARModuleOpenCVCuda/0.11.0/lib/x86_64/shared">
3+
<module uuid="fde83ee6-3e22-4531-9e1c-54cb0a3bf3fa" name="SolARModuleOpenCVCuda" description="SolARModuleOpenCVCuda" path="$XPCF_MODULE_ROOT/SolARBuild/SolARModuleOpenCVCuda/1.0.0/lib/x86_64/shared">
44
<component uuid="cedd8c47-e7b0-47bf-abb1-7fb54d198117" name="SolAR2D3DCorrespondencesFinderOpencv" description="SolAR2D3DCorrespondencesFinderOpencv">
55
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
66
<interface uuid="0404e8b9-b824-4852-a34d-6eafa7563918" name="I2D3DCorrespondencesFinder" description="I2D3DCorrespondencesFinder"/>
@@ -165,5 +165,13 @@
165165
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
166166
<interface uuid="5DDC7DF0-8377-437F-9C81-3643F7676A5B" name="ICamera" description="ICamera"/>
167167
</component>
168+
<component uuid="77a8b776-6b0c-4bc0-b0a8-437a796b8e29" name="SolARFCNSegmentationOpencv" description="SolARFCNSegmentationOpencv">
169+
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
170+
<interface uuid="2fd30b7c-c6e4-4af7-a711-0b69964e68c2" name="ISemanticSegmentation" description="ISemanticSegmentation"/>
171+
</component>
172+
<component uuid="063d3086-6c87-49ff-87db-9a4ff224b5c8" name="SolARGenericSemanticSegmentationOpencv" description="SolARGenericSemanticSegmentationOpencv">
173+
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
174+
<interface uuid="2fd30b7c-c6e4-4af7-a711-0b69964e68c2" name="ISemanticSegmentation" description="ISemanticSegmentation"/>
175+
</component>
168176
</module>
169177
</xpcf-registry>

interfaces/SolAR3DOverlayBoxOpencv.h

+8-10
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,14 @@ class SOLAROPENCV_EXPORT_API SolAR3DOverlayBoxOpencv : public org::bcom::xpcf::C
5555
public:
5656
SolAR3DOverlayBoxOpencv();
5757

58-
59-
///@brief draw a projection of 3D box based on 3D pose on an image.
60-
/// @param[in] pose: 3D camera pose expressed in the world coordinate.
61-
/// @param[in,out] displayImage The image on which the projection of a 3D box will be drawn.
62-
void draw(const datastructure::Transform3Df & pose, SRef<datastructure::Image> displayImage) override;
63-
64-
/// @brief this method is used to set intrinsic parameters and distorsion of the camera
65-
/// @param[in] Camera calibration matrix parameters.
66-
/// @param[in] Camera distorsion parameters.
67-
void setCameraParameters(const datastructure::CamCalibration & intrinsic_parameters, const datastructure::CamDistortion & distorsion_parameters);
58+
/// @brief Draw a box on the given Image
59+
/// The box is displayed according to the pose given in parameter. The reference of the box is positionned on the center of its bottom face.
60+
/// @param[in] Transfomr3Df The pose of the camera from which the box is viewed.
61+
/// @param[in] camParams The camera parameters.
62+
/// @param[in,out] displayImage The image on which the box will be drawn
63+
void draw (const SolAR::datastructure::Transform3Df & pose,
64+
const SolAR::datastructure::CameraParameters & camParams,
65+
SRef<SolAR::datastructure::Image> displayImage) override;
6866

6967
org::bcom::xpcf::XPCFErrorCode onConfigured() override final;
7068
void unloadComponent () override final;

interfaces/SolARDescriptorMatcherGeometricOpencv.h

+24-12
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#include "opencv2/imgcodecs.hpp"
2626
#include "opencv2/highgui.hpp"
2727
#include <opencv2/calib3d.hpp>
28+
#ifdef WITHCUDA
29+
#include <opencv2/cudafeatures2d.hpp>
30+
#endif
2831

2932
namespace SolAR {
3033
namespace MODULES {
@@ -60,33 +63,42 @@ class SOLAROPENCV_EXPORT_API SolARDescriptorMatcherGeometricOpencv : public base
6063
/// @brief SolARDescriptorMatcherGeometricOpencv destructor
6164
~SolARDescriptorMatcherGeometricOpencv() override;
6265

63-
/// @brief Match two sets of descriptors from two frames based on epipolar constraint.
64-
/// @param[in] descriptors1 The first set of descriptors.
65-
/// @param[in] descriptors2 The second set of descriptors.
66-
/// @param[in] undistortedKeypoints1 The first set of undistorted keypoints.
67-
/// @param[in] undistortedKeypoints2 The second set of undistorted keypoints.
68-
/// @param[in] pose1 The first pose.
69-
/// @param[in] pose2 The second pose.
70-
/// @param[in] camParams The intrinsic parameters of the camera.
71-
/// @param[out] matches A vector of matches representing pairs of indices relatively to the first and second set of descriptors.
72-
/// @param[in] mask The indices of descriptors in the first frame are used for matching to the second frame. If it is empty then all will be used.
66+
/// @brief Match two sets of descriptors from two frames based on epipolar constraint.
67+
/// @param[in] descriptors1 The first set of descriptors.
68+
/// @param[in] descriptors2 The second set of descriptors.
69+
/// @param[in] undistortedKeypoints1 The first set of undistorted keypoints.
70+
/// @param[in] undistortedKeypoints2 The second set of undistorted keypoints.
71+
/// @param[in] pose1 The first pose.
72+
/// @param[in] pose2 The second pose.
73+
/// @param[in] camParams1 The intrinsic parameters of the camera 1.
74+
/// @param[in] camParams2 The intrinsic parameters of the camera 2.
75+
/// @param[out] matches A vector of matches representing pairs of indices relatively to the first and second set of descriptors.
76+
/// @param[in] mask1 The indices of descriptors in the first frame are used for matching to the second frame. If it is empty then all will be used.
77+
/// @param[in] mask2 The indices of descriptors in the second frame are used for matching to the first frame. If it is empty then all will be used.
7378
/// @return FrameworkReturnCode::_SUCCESS if matching succeed, else FrameworkReturnCode::_ERROR_
7479
FrameworkReturnCode match(const SRef<SolAR::datastructure::DescriptorBuffer> descriptors1,
7580
const SRef<SolAR::datastructure::DescriptorBuffer> descriptors2,
7681
const std::vector<SolAR::datastructure::Keypoint> &undistortedKeypoints1,
7782
const std::vector<SolAR::datastructure::Keypoint> &undistortedKeypoints2,
7883
const SolAR::datastructure::Transform3Df& pose1,
7984
const SolAR::datastructure::Transform3Df& pose2,
80-
const SolAR::datastructure::CameraParameters& camParams,
85+
const SolAR::datastructure::CameraParameters & camParams1,
86+
const SolAR::datastructure::CameraParameters & camParams2,
8187
std::vector<SolAR::datastructure::DescriptorMatch> & matches,
82-
const std::vector<uint32_t>& mask = {}) override;
88+
const std::vector<uint32_t>& mask1 = {},
89+
const std::vector<uint32_t>& mask2 = {}) override;
8390

91+
org::bcom::xpcf::XPCFErrorCode onConfigured() override final;
8492
void unloadComponent() override;
8593

8694
private:
8795
float m_distanceRatio = 0.75f;
8896
float m_paddingRatio = 0.003f;
8997
float m_matchingDistanceMax = 500.f;
98+
/// Matcher used only in case of cuda
99+
#ifdef WITHCUDA
100+
cv::Ptr<cv::cuda::DescriptorMatcher> m_matcher;
101+
#endif
90102
};
91103

92104
}

0 commit comments

Comments
 (0)