Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ar_sandbox_app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AR_Sandbox
ar_sandbox_app
Commits
20213e24
Commit
20213e24
authored
5 years ago
by
simon.fanetti
Browse files
Options
Downloads
Patches
Plain Diff
adjust app to lib
parent
4c88772f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+9
-1
9 additions, 1 deletion
Makefile
app.cpp
+61
-36
61 additions, 36 deletions
app.cpp
beamer_config.sh
+2
-2
2 additions, 2 deletions
beamer_config.sh
sandbox_conf.yaml
+13
-0
13 additions, 0 deletions
sandbox_conf.yaml
with
85 additions
and
39 deletions
Makefile
+
9
−
1
View file @
20213e24
...
...
@@ -4,11 +4,19 @@ API_PATH=../ar_sandbox_lib
CFLAGS
=
-std
=
c++11
-Wall
-Wextra
-g
CCP
=
g++
all
:
app
app
:
app.o
$(
CCP
)
$^
-o
$@
-L
$(
API_PATH
)
-lsandbox
$(
DEP_SANDBOX
)
%.o
:
%.cpp
$(
CCP
)
$(
CFLAGS
)
-I
$(
API_PATH
)
/includes
-c
$<
-o
$@
$(
CCP
)
$(
CFLAGS
)
-I
$(
API_PATH
)
/inc
-c
$<
-o
$@
run
:
./app
setup
:
$(
API_PATH
)
/app/SandboxSetupApp
clean
:
rm
-f
*
.o app
This diff is collapsed.
Click to expand it.
app.cpp
+
61
−
36
View file @
20213e24
#include
"../ar_sandbox_lib/
includes/
sandbox.h"
#include
"../ar_sandbox_lib/sandbox.h"
#include
<numeric>
#include
<fstream>
#include
<string>
...
...
@@ -10,7 +10,59 @@ using namespace cv;
#define ESCAPE_CHAR 27
Mat
coloredFrame
(
Mat
frameDepth
);
void
showLevel
();
void
showDiff
();
//vector<int> findCercleZ(Mat &rgb);
//void trackCircle();
Sandbox
client
;
void
(
*
apps
[
2
])()
=
{
showLevel
,
showDiff
};
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
client
.
loadConfig
()){
std
::
cout
<<
"Error : Couldn't load the configuration"
<<
std
::
endl
;
return
1
;
}
showLevel
();
/*cout << "Press: \n 0: Show level \n 1: Show difference \n";
int n = 0;
cin >> n;
apps[n]();*/
}
void
showLevel
()
{
char
windowName
[]
=
"Sandbox"
;
Mat
frameData
;
Mat
colored
;
Mat
proj_frame
;
//client.initWindowsFullScreen();
cv
::
namedWindow
(
windowName
,
CV_WINDOW_AUTOSIZE
);
do
{
client
.
getDepthFrame
().
copyTo
(
frameData
);
colored
=
coloredFrame
(
frameData
);
colored
.
copyTo
(
proj_frame
);
Mat
*
res
=
client
.
adjustProjection
(
&
proj_frame
);
cv
::
imshow
(
windowName
,
*
res
);
//client.showImage(&colored);
}
while
(
waitKey
(
10
)
!=
ESCAPE_CHAR
);
cv
::
destroyAllWindows
();
}
Mat
coloredFrame
(
Mat
frameDepth
)
{
...
...
@@ -45,29 +97,16 @@ Mat coloredFrame(Mat frameDepth)
}
}
}
bitwise_not
(
depthFrameColored
,
depthFrameColored
);
//reverse colormap
applyColorMap
(
depthFrameColored
,
depthFrameColored
,
cv
::
COLORMAP_JET
);
cv
::
bitwise_not
(
depthFrameColored
,
depthFrameColored
);
//reverse colormap
cv
::
applyColorMap
(
depthFrameColored
,
depthFrameColored
,
cv
::
COLORMAP_JET
);
depthFrameColored
.
setTo
(
cv
::
Scalar
(
0
,
0
,
0
),
(
frameDepth
==
0
));
return
depthFrameColored
;
}
void
showLevel
()
{
//char windowName[] = "Sandbox";
Mat
frameData
;
client
.
getDepthFrame
().
copyTo
(
frameData
);
Mat
colored
;
do
{
client
.
getDepthFrame
().
copyTo
(
frameData
);
colored
=
coloredFrame
(
frameData
);
client
.
showImage
(
&
colored
);
}
while
(
waitKey
(
10
)
!=
ESCAPE_CHAR
);
destroyAllWindows
();
}
void
showDiff
(){
/*
void showDiff(
Mat frame
Base)
{
Mat frame
Data;
client.getDepthFrame(&frameData);
Mat frameData;
client.getDepthFrame(&frameData);
resize(frameBase, frameBase, frameData.size()); //to match with camera frame
...
...
@@ -89,8 +128,10 @@ void showDiff(Mat frameBase)
keyCode = waitKey(10);
} while (keyCode!= ESCAPE_CHAR);
destroyAllWindows();
*/
}
/*
vector<int> findCercleZ(Mat &rgb)
{
Mat src_gray;
...
...
@@ -136,20 +177,4 @@ void trackCircle()
} while (waitKey(100) != ESCAPE_CHAR);
destroyAllWindows();
}*/
int
main
(
int
argc
,
char
*
argv
[])
{
client
=
Sandbox
();
cout
<<
"Press:
\n
0: Show difference
\n
1: Show level
\n
"
;
int
f
=
0
;
cin
>>
f
;
if
(
f
==
0
)
{
//Mat frameData;
//client.getDepthFrame(&frameData);
//showDiff(frameData);
}
else
if
(
f
==
1
)
showLevel
();
}
\ No newline at end of file
}*/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
beamer_config.sh
+
2
−
2
View file @
20213e24
SCREEN
=
DVI-D-0
SCREEN
=
eDP-1
SCN_RES
=
1920x1080
BEAMER
=
HDMI-
0
BEAMER
=
HDMI-
1
BM_RES
=
1400x1050
xrandr
--output
$SCREEN
--rate
60
--mode
$SCN_RES
--fb
$SCN_RES
--panning
$SCN_RES
*
\
...
...
This diff is collapsed.
Click to expand it.
sandbox_conf.yaml
0 → 100644
+
13
−
0
View file @
20213e24
AdjustingMatrix
:
width
:
3
height
:
2
matrix
:
[
1
,
0
,
0
,
-0
,
1
,
0
]
CroppingMask
:
x
:
160
y
:
120
width
:
320
height
:
245
BeamerPosition
:
x
:
0
y
:
0
z
:
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment