Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
masterarbeit-kai
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Philipp Adolf
masterarbeit-kai
Commits
0cf35e2b
Commit
0cf35e2b
authored
Jul 04, 2017
by
wester
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prä test vortrag
parent
6813e21f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
main.cpp
3_PointCloud/main.cpp
+16
-14
Zwischen.pptx
Zwischen.pptx
+0
-0
No files found.
3_PointCloud/main.cpp
View file @
0cf35e2b
...
@@ -127,7 +127,7 @@ void getDepthData(IMultiSourceFrame* frame) {
...
@@ -127,7 +127,7 @@ void getDepthData(IMultiSourceFrame* frame) {
if
(
depthframe
)
depthframe
->
Release
();
if
(
depthframe
)
depthframe
->
Release
();
}
}
void
getRgbData
(
IMultiSourceFrame
*
frame
,
bool
writ
FrameToFile
)
{
void
getRgbData
(
IMultiSourceFrame
*
frame
,
bool
writ
eFrameInVector
)
{
IColorFrame
*
colorframe
;
IColorFrame
*
colorframe
;
IColorFrameReference
*
frameref
=
NULL
;
IColorFrameReference
*
frameref
=
NULL
;
frame
->
get_ColorFrameReference
(
&
frameref
);
frame
->
get_ColorFrameReference
(
&
frameref
);
...
@@ -136,6 +136,14 @@ void getRgbData(IMultiSourceFrame* frame, bool writFrameToFile) {
...
@@ -136,6 +136,14 @@ void getRgbData(IMultiSourceFrame* frame, bool writFrameToFile) {
if
(
!
colorframe
)
return
;
if
(
!
colorframe
)
return
;
if
(
writeFrameInVector
)
{
snapshotPoints
.
clear
();
snapshotPoints
.
reserve
(
width
*
height
);
snapshotColors
.
clear
();
snapshotColors
.
reserve
(
width
*
height
*
3
);
}
// Get data from frame
// Get data from frame
colorframe
->
CopyConvertedFrameDataToArray
(
colorwidth
*
colorheight
*
4
,
rgbimage
,
ColorImageFormat_Rgba
);
colorframe
->
CopyConvertedFrameDataToArray
(
colorwidth
*
colorheight
*
4
,
rgbimage
,
ColorImageFormat_Rgba
);
...
@@ -155,7 +163,7 @@ void getRgbData(IMultiSourceFrame* frame, bool writFrameToFile) {
...
@@ -155,7 +163,7 @@ void getRgbData(IMultiSourceFrame* frame, bool writFrameToFile) {
*
fdest
++
=
rgbimage
[
4
*
idx
+
1
]
/
255.
f
;
*
fdest
++
=
rgbimage
[
4
*
idx
+
1
]
/
255.
f
;
*
fdest
++
=
rgbimage
[
4
*
idx
+
2
]
/
255.
f
;
*
fdest
++
=
rgbimage
[
4
*
idx
+
2
]
/
255.
f
;
if
(
writ
FrameToFile
)
{
if
(
writ
eFrameInVector
)
{
//copy points with valid Color
//copy points with valid Color
snapshotPoints
.
push_back
(
framePositions
[
i
]);
snapshotPoints
.
push_back
(
framePositions
[
i
]);
...
@@ -176,13 +184,6 @@ void getKinectData(bool writeFrameInVector) {
...
@@ -176,13 +184,6 @@ void getKinectData(bool writeFrameInVector) {
delete
currentControlerPos
;
delete
currentControlerPos
;
currentControlerPos
=
steamTracking
->
getTransformationForDevice
(
0
);
currentControlerPos
=
steamTracking
->
getTransformationForDevice
(
0
);
if
(
writeFrameInVector
)
{
snapshotPoints
.
clear
();
snapshotPoints
.
reserve
(
width
*
height
);
snapshotColors
.
clear
();
snapshotColors
.
reserve
(
width
*
height
*
3
);
}
getDepthData
(
frame
);
getDepthData
(
frame
);
getRgbData
(
frame
,
writeFrameInVector
);
getRgbData
(
frame
,
writeFrameInVector
);
...
@@ -206,11 +207,12 @@ void writePointCloud() {
...
@@ -206,11 +207,12 @@ void writePointCloud() {
pntsHeader
header
;
pntsHeader
header
;
size_t
pointArrayByteSize
=
points
.
size
()
*
sizeof
(
glm
::
vec3
);
size_t
pointArrayByteSize
=
points
.
size
()
*
sizeof
(
glm
::
vec3
);
std
::
cout
<<
points
.
size
()
<<
" "
<<
sizeof
(
glm
::
vec3
);
size_t
coloArrayByteSize
=
colors
.
size
()
*
sizeof
(
unsigned
char
);
size_t
coloArrayByteSize
=
colors
.
size
()
*
sizeof
(
unsigned
char
);
header
.
featureTableByteLenght
=
pointArrayByteSize
+
coloArrayByteSize
;
header
.
featureTableByteLenght
=
pointArrayByteSize
+
coloArrayByteSize
;
std
::
ostringstream
os
;
std
::
ostringstream
os
;
os
<<
"{
\"
POINTS_LENGTH
\"
:"
<<
(
points
.
size
()
/
3
)
<<
",
\"
POSITION
\"
: {
\"
byteOffset
\"
:0},
\"
RGB
\"
: {
\"
byteOffset
\"
:"
<<
pointArrayByteSize
<<
"}}"
;
os
<<
"{
\"
POINTS_LENGTH
\"
:"
<<
(
points
.
size
()
)
<<
",
\"
POSITION
\"
: {
\"
byteOffset
\"
:0},
\"
RGB
\"
: {
\"
byteOffset
\"
:"
<<
pointArrayByteSize
<<
"}}"
;
std
::
string
json
=
os
.
str
();
std
::
string
json
=
os
.
str
();
header
.
featureTableJSONByteLenght
=
json
.
size
();
header
.
featureTableJSONByteLenght
=
json
.
size
();
...
@@ -248,11 +250,11 @@ void drawKinectData() {
...
@@ -248,11 +250,11 @@ void drawKinectData() {
//get controler pos
//get controler pos
points
.
clear
();
points
.
clear
();
colors
.
clear
();
colors
.
clear
();
points
.
reserve
(
points
.
capacity
()
+
width
*
height
);
points
.
reserve
(
points
.
size
()
+
width
*
height
);
colors
.
reserve
(
colors
.
capacity
()
+
width
*
height
*
3
);
colors
.
reserve
(
colors
.
size
()
+
width
*
height
*
3
);
for
(
int
i
=
0
;
i
<
snapshotPoints
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
snapshotPoints
.
size
();
i
++
)
{
points
.
push_back
(
*
currentControlerPos
*
snapshotPoints
[
i
]);
points
.
push_back
(
/*currentControlerPos */
snapshotPoints
[
i
]);
colors
.
push_back
(
snapshotColors
[
i
*
3
]);
colors
.
push_back
(
snapshotColors
[
i
*
3
]);
colors
.
push_back
(
snapshotColors
[
i
*
3
+
1
]);
colors
.
push_back
(
snapshotColors
[
i
*
3
+
1
]);
colors
.
push_back
(
snapshotColors
[
i
*
3
+
2
]);
colors
.
push_back
(
snapshotColors
[
i
*
3
+
2
]);
...
@@ -347,7 +349,7 @@ int main(int argc, char* argv[]) {
...
@@ -347,7 +349,7 @@ int main(int argc, char* argv[]) {
for
(
int
i
=
0
;
i
<
width
;
i
++
)
{
for
(
int
i
=
0
;
i
<
width
;
i
++
)
{
*
fdest
++
=
1.0
*
i
/
width
;
*
fdest
++
=
1.0
*
i
/
width
;
*
fdest
++
=
1.0
*
j
/
height
;
*
fdest
++
=
1.0
*
j
/
height
;
*
fdest
++
=
0
;
*
fdest
++
=
1
;
snapshotPoints
.
push_back
(
glm
::
vec3
(
1.0
*
i
/
width
,
1.0
*
j
/
height
,
0
));
snapshotPoints
.
push_back
(
glm
::
vec3
(
1.0
*
i
/
width
,
1.0
*
j
/
height
,
0
));
snapshotColors
.
push_back
(
1.0
*
i
/
width
*
255
);
snapshotColors
.
push_back
(
1.0
*
i
/
width
*
255
);
...
...
Zwischen.pptx
View file @
0cf35e2b
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment