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

Commit 8416e84

Browse files
committed
Merge branch 'develop'
2 parents 4905df9 + 17bb865 commit 8416e84

33 files changed

Lines changed: 41 additions & 2042 deletions

JenkinsFile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ node("master") {
44
moduleName="SolARPipelineNaturalImageMarker"
55
dirName="SolARBuild"
66
buildDir="SolARPipeline_NaturalImageMarker"
7-
android=true
87
}
98

109
SolArModulePipeline {
1110
moduleName="SolARSample_NaturalImageMarker"
1211
dirName="SolARBuild"
13-
buildDir="SolARSample_NaturalImageMarker_Mono,SolARSample_NaturalImageMarker_Multi,SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker"
14-
android=false
12+
buildDir="SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker"
1513
packageScripts="bundleSamples"
1614
}
1715

README.md

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ The SolAR **Natural Image Marker sample** show a SolAR pipeline for augmented re
77
This pipeline loads a reference image marker, then tries to detect it on real-time camera images and to estimate the pose of the camera in relation to the coordinate system of the image marker. If the marker is detected, the pipeline over the current camera image renders a 3D cube from a virtual camera which pose corresponds to the one estimated by the pipeline.
88

99

10-
| ![](./SolARSample_NaturalImageMarker_Mono/standalone.jpg) | ![](./SolARPipeline_NaturalImageMarker/plugin.jpg) |
10+
| ![](./SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker/standalone.jpg) | ![](./SolARPipeline_NaturalImageMarker/plugin.jpg) |
1111
|:-:|:-:|
12-
| SolARSample_NaturalImageMarker_Mono/SolARSample_NaturalImageMarker_Multi | SolARPipeline_NaturalImageMarker |
12+
| SolARPipelineTest_NaturalImageMarker | SolARPipeline_NaturalImageMarker |
1313

1414

1515
## How to run
1616

17-
* To run it, first print the marker [graf1.png](./SolARSample_NaturalImageMarker_Mono/graf1.png).
17+
* To run it, first print the marker [graf1.png](./SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker/graf1.png).
1818

19-
* If you want to change your natural image, you can edit the [grafMarker.yml](./SolARSample_NaturalImageMarker_Mono/grafMarker.yml).
19+
* If you want to change your natural image, you can edit the [grafMarker.yml](./SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker/grafMarker.yml).
2020

21-
* If you want to change the calibration parameters of the camera, edit the [camera_calibration.json](./SolARSample_NaturalImageMarker_Mono/camera_calibration.json).
21+
* If you want to change the calibration parameters of the camera, edit the [camera_calibration.json](./SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker/camera_calibration.json).
2222

23-
* To change properties of the components of the natural pipeline, edit the [conf_NaturalImageMarker.xml](./SolARSample_NaturalImageMarker_Mono/conf_NaturalImageMarker.xml) file.
23+
* To change properties of the components of the natural pipeline, edit the [conf_NaturalImageMarker.xml](./SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker/SolARPipelineTest_NaturalImageMarker_conf.xml) file.
2424

2525
If you want to run your Natural image samples after having built them, do not forget to install the required dependencies if not already done:
2626

@@ -32,35 +32,7 @@ and for debug mode:
3232

3333
For more information about how to install remaken on your machine, visit the [install page](https://solarframework.github.io/install/) on the SolAR website.
3434

35-
### SolARSample_NaturalImageMarker_Mono
3635

37-
* Open a terminal in the `bin/Release` or `bin/Debug`folder and execute :
38-
39-
> #### Windows
40-
>
41-
SolARSample_NaturalImageMarker_Mono.exe
42-
43-
> #### Linux
44-
>
45-
./run.sh ./ SolARSample_NaturalImageMarker_Mono.exe
46-
47-
* When the application is started, point the camera to the natural image marker (you can see a virtual cube on the marker).
48-
* Press `escape` to quit the application.
49-
50-
### SolARSample_NaturalImageMarker_Multi
51-
52-
* Open a terminal in the `bin/Release` or `bin/Debug`folder and execute :
53-
54-
> #### Windows
55-
>
56-
SolARSample_NaturalImageMarker_Multi.exe
57-
58-
> #### Linux
59-
>
60-
./run.sh ./SolARSample_NaturalImageMarker_Multi
61-
62-
* When the application is started, point the camera to the natural image marker (you can see a virtual cube on the marker).
63-
* Press `escape` to quit the application.
6436

6537
### SolARPipelineTest_NaturalImageMarker
6638

SolARPipeline_NaturalImageMarker/SolARPipeline_NaturalImageMarker.pro

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ QMAKE_PROJECT_DEPTH = 0
88
TARGET = SolARPipelineNaturalImageMarker
99
INSTALLSUBDIR = SolARBuild
1010
FRAMEWORK = $$TARGET
11-
VERSION=0.11.0
11+
VERSION=1.0.0
1212

1313
DEFINES += MYVERSION=$${VERSION}
1414
DEFINES += TEMPLATE_LIBRARY
@@ -53,30 +53,17 @@ unix {
5353
QMAKE_POST_LINK += "make install"
5454
}
5555

56-
unix:!android {
56+
unix {
5757
QMAKE_CXXFLAGS += -Wignored-qualifiers
5858
}
5959

60-
macx {
61-
DEFINES += _MACOS_TARGET_
62-
QMAKE_MAC_SDK= macosx
63-
QMAKE_CFLAGS += -mmacosx-version-min=10.7 -std=c11 #-x objective-c++
64-
QMAKE_CXXFLAGS += -mmacosx-version-min=10.7 -std=c11 -std=c++11 -O3 -fPIC#-x objective-c++
65-
QMAKE_LFLAGS += -mmacosx-version-min=10.7 -v -lstdc++
66-
LIBS += -lstdc++ -lc -lpthread
67-
}
68-
6960
win32 {
7061

7162
DEFINES += WIN64 UNICODE _UNICODE
7263
QMAKE_COMPILER_DEFINES += _WIN64
7364
QMAKE_CXXFLAGS += -wd4250 -wd4251 -wd4244 -wd4275
7465
}
7566

76-
android {
77-
ANDROID_ABIS="arm64-v8a"
78-
}
79-
8067
header_files.path = $${PROJECTDEPLOYDIR}/interfaces
8168
header_files.files = $$files($${PWD}/interfaces/*.h*)
8269

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
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
22

SolARPipeline_NaturalImageMarker/src/PipelineNaturalImageMarker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace xpcf=org::bcom::xpcf;
2222

2323
// Declaration of the module embedding the fiducial marker pipeline
24-
XPCF_DECLARE_MODULE("5bbc1452-8d7f-4512-83f1-7bf48453809f", "NaturalImageMarkerModule", "The module embedding a pipeline to estimate the pose based on a natural image marker")
24+
XPCF_DECLARE_MODULE("5bbc1452-8d7f-4512-83f1-7bf48453809f", "SolARPipelineNaturalImageMarker", "The module embedding a pipeline to estimate the pose based on a natural image marker")
2525

2626
extern "C" XPCF_MODULEHOOKS_API xpcf::XPCFErrorCode XPCF_getComponent(const boost::uuids::uuid& componentUUID,SRef<xpcf::IComponentIntrospect>& interfaceRef)
2727
{

SolARPipeline_NaturalImageMarker/src/component.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,6 @@ FrameworkReturnCode PipelineNaturalImageMarker::init()
121121
for(int j=0;j<4;j++)
122122
m_pose(i,j)=0.f;
123123

124-
// initialize pose estimation based on planar points with the camera intrinsec parameters (please refeer to the use of intrinsec parameters file)
125-
m_poseEstimationPlanar->setCameraParameters(m_camera->getIntrinsicsParameters(), m_camera->getDistortionParameters());
126-
127-
// initialize projection component with the camera intrinsec parameters (please refeer to the use of intrinsec parameters file)
128-
m_projection->setCameraParameters(m_camera->getIntrinsicsParameters(), m_camera->getDistortionParameters());
129-
130-
// initialize unprojection component with the camera intrinsec parameters (please refeer to the use of intrinsec parameters file)
131-
m_unprojection->setCameraParameters(m_camera->getIntrinsicsParameters(), m_camera->getDistortionParameters());
132-
133124
m_isTrack = false;
134125
m_needNewTrackedPoints = false;
135126

@@ -226,7 +217,7 @@ bool PipelineNaturalImageMarker::processDetection()
226217
m_img_mapper->map(ref2Dpoints, ref3Dpoints);
227218

228219
// Estimate the pose from the 2D-3D planar correspondence
229-
if (m_poseEstimationPlanar->estimate(cam2Dpoints, ref3Dpoints, inliers, pose) != FrameworkReturnCode::_SUCCESS)
220+
if (m_poseEstimationPlanar->estimate(cam2Dpoints, ref3Dpoints, m_camera->getParameters(), inliers, pose) != FrameworkReturnCode::_SUCCESS)
230221
{
231222
valid_pose = false;
232223
LOG_DEBUG("No pose from Detection for this frame");
@@ -299,7 +290,7 @@ bool PipelineNaturalImageMarker::processTracking()
299290
std::vector<Point2Df> projectedMarkerCorners;
300291
std::vector<Keypoint> newKeypoints;
301292
// Get the projection of the corner of the marker in the current image
302-
m_projection->project(m_markerWorldCorners, projectedMarkerCorners, m_pose);
293+
m_projection->project(m_markerWorldCorners, m_pose, m_camera->getParameters(), projectedMarkerCorners);
303294

304295
// Detect the keypoints within the contours of the marker defined by the projected corners
305296
m_kpDetectorRegion->detect(m_previousCamImage, projectedMarkerCorners, newKeypoints);
@@ -309,7 +300,7 @@ bool PipelineNaturalImageMarker::processTracking()
309300
m_imagePoints_track.push_back(Point2Df(keypoint.getX(), keypoint.getY()));
310301

311302
// get back the 3D positions of the detected keypoints in world space
312-
m_unprojection->unproject(m_imagePoints_track, m_worldPoints_track, m_pose);
303+
m_unprojection->unproject(m_imagePoints_track, m_pose, m_camera->getParameters(), m_worldPoints_track);
313304
LOG_DEBUG("Reinitialize points to track");
314305
}
315306
else {
@@ -343,7 +334,7 @@ bool PipelineNaturalImageMarker::processTracking()
343334
}
344335

345336
// Estimate the pose from the 2D-3D planar correspondence
346-
if (m_poseEstimationPlanar->estimate(pts2D, pts3D, inliers, m_pose) != FrameworkReturnCode::_SUCCESS)
337+
if (m_poseEstimationPlanar->estimate(pts2D, pts3D, m_camera->getParameters(), inliers, m_pose) != FrameworkReturnCode::_SUCCESS)
347338
{
348339
m_isTrack = false;
349340
valid_pose = false;

SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker/SolARPipelineTest_NaturalImageMarker.pro

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ QMAKE_PROJECT_DEPTH = 0
66

77
## global defintions : target lib name, version
88
TARGET = SolARPipelineTest_NaturalImageMarker
9-
VERSION=0.11.0
9+
VERSION=1.0.0
1010
PROJECTDEPLOYDIR = $${PWD}/../../../deploy
1111

1212
DEFINES += MYVERSION=$${VERSION}
@@ -45,15 +45,6 @@ unix {
4545
QMAKE_POST_LINK += "make install install_deps"
4646
}
4747

48-
macx {
49-
DEFINES += _MACOS_TARGET_
50-
QMAKE_MAC_SDK= macosx
51-
QMAKE_CFLAGS += -mmacosx-version-min=10.7 -std=c11 #-x objective-c++
52-
QMAKE_CXXFLAGS += -mmacosx-version-min=10.7 -std=c11 -std=c++11 -O3 -fPIC#-x objective-c++
53-
QMAKE_LFLAGS += -mmacosx-version-min=10.7 -v -lstdc++
54-
LIBS += -lstdc++ -lc -lpthread
55-
}
56-
5748
win32 {
5849

5950
DEFINES += WIN64 UNICODE _UNICODE
@@ -64,7 +55,7 @@ win32 {
6455
config_files.path = $${TARGETDEPLOYDIR}
6556
config_files.files=$$files($${PWD}/SolARPipelineTest_NaturalImageMarker_conf.xml)\
6657
$$files($${PWD}/camera_calibration.json)\
67-
$$files($${PWD}/NaturalImageMarker.yml)\
58+
$$files($${PWD}/grafMarker.yml)\
6859
$$files($${PWD}/graf1.png)
6960
INSTALLS += config_files
7061

SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker/SolARPipelineTest_NaturalImageMarker_conf.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0"?>
22
<xpcf-registry autoAlias="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3-
<module uuid="5bbc1452-8d7f-4512-83f1-7bf48453809f" name="SolARPipelineNaturalImageMarker" path="$XPCF_MODULE_ROOT/SolARBuild/SolARPipelineNaturalImageMarker/0.11.0/lib/x86_64/shared" description="The module embedding a pipeline to estimate the pose based on a natural Image marker">
3+
<module uuid="5bbc1452-8d7f-4512-83f1-7bf48453809f" name="SolARPipelineNaturalImageMarker" path="$XPCF_MODULE_ROOT/SolARBuild/SolARPipelineNaturalImageMarker/1.0.0/lib/x86_64/shared" description="The module embedding a pipeline to estimate the pose based on a natural Image marker">
44
<component uuid="6f6c7ae8-764c-49b3-a2fc-e9a4f539b9b1" name="PipelineNaturalImageMarker" description="A pipeline to estimate the pose based on a natural Image marker">
55
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect" />
66
<interface uuid="b5a6225e-6a91-4050-b298-886f4c17d9d2" name="IPoseEstimationPipeline" description="The interface to define a video see-throuh pipeline" />
77
</component>
88
</module>
9-
<module uuid="15e1990b-86b2-445c-8194-0cbe80ede970" name="SolARModuleOpenCV" path="$XPCF_MODULE_ROOT/SolARBuild/SolARModuleOpenCV/0.11.0/lib/x86_64/shared" description="moduleOpenCV">
9+
<module uuid="15e1990b-86b2-445c-8194-0cbe80ede970" name="SolARModuleOpenCV" path="$XPCF_MODULE_ROOT/SolARBuild/SolARModuleOpenCV/1.0.0/lib/x86_64/shared" description="moduleOpenCV">
1010
<component uuid="5B7396F4-A804-4F3C-A0EB-FB1D56042BB4" name="SolARCameraOpencv" description="SolARCameraOpencv">
1111
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect"/>
1212
<interface uuid="5DDC7DF0-8377-437F-9C81-3643F7676A5B" name="ICamera" description="ICamera"/>
@@ -64,7 +64,7 @@
6464
<interface uuid="81a20f52-6bf9-4949-b914-df2f614bc945" name="I3DOverlay" description="I3DOverlay"/>
6565
</component>
6666
</module>
67-
<module uuid="28b89d39-41bd-451d-b19e-d25a3d7c5797" name="SolARModuleTools" path="$XPCF_MODULE_ROOT/SolARBuild/SolARModuleTools/0.11.0/lib/x86_64/shared" description="Module Tools">
67+
<module uuid="28b89d39-41bd-451d-b19e-d25a3d7c5797" name="SolARModuleTools" path="$XPCF_MODULE_ROOT/SolARBuild/SolARModuleTools/1.0.0/lib/x86_64/shared" description="Module Tools">
6868
<component uuid="a2ef5542-029e-4fce-9974-0aea14b29d6f" name="SolARSBPatternReIndexer" description="SolARSBPatternReIndexer">
6969
<interface uuid="125f2007-1bf9-421d-9367-fbdc1210d006" name="IComponentIntrospect" description="IComponentIntrospect" />
7070
<interface uuid="79c5b810-d557-11e7-9296-cec278b6b50a" name="ISBPatternReIndexer" description="ISBPatternReIndexer" />

SolARPipeline_NaturalImageMarker/tests/SolARPipelineTest_NaturalImageMarker/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ int main(){
4848

4949
// Set camera parameters
5050
CameraParameters camParam = pipeline->getCameraParameters();
51-
overlay3DComponent->setCameraParameters(camParam.intrinsic, camParam.distortion);
5251

5352
unsigned char* r_imageData=new unsigned char[camParam.resolution.width * camParam.resolution.height * 3];
5453
SRef<Image> camImage=xpcf::utils::make_shared<Image>(r_imageData,camParam.resolution.width,camParam.resolution.height, Image::LAYOUT_BGR, Image::INTERLEAVED, Image::TYPE_8U);
@@ -75,7 +74,7 @@ int main(){
7574
for(int j=0;j<3;j++)
7675
s_pose(3,j)=0;
7776
s_pose(3,3)=1;
78-
overlay3DComponent->draw(s_pose, camImage);
77+
overlay3DComponent->draw(s_pose, camParam, camImage);
7978
}
8079

8180
if (imageViewerResult->display(camImage) == SolAR::FrameworkReturnCode::_STOP){
Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)