Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
67d76691
Commit
67d76691
authored
Mar 21, 2012
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched to use RunXmlScript always (missing '\n' at the end of xml script was a problem)
parent
faf845d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
22 deletions
+2
-22
cap_openni.cpp
modules/highgui/src/cap_openni.cpp
+2
-22
No files found.
modules/highgui/src/cap_openni.cpp
View file @
67d76691
...
...
@@ -41,15 +41,10 @@
#include "precomp.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#ifdef HAVE_OPENNI
#
define HACK_WITH_XML
#
ifdef HAVE_OPENNI
#ifdef HACK_WITH_XML
#include <iostream>
#include <fstream>
#endif
#include "XnCppWrapper.h"
const
std
::
string
XMLConfig
=
...
...
@@ -79,7 +74,7 @@ const std::string XMLConfig =
"</Configuration>"
"</Node>"
"</ProductionNodes>"
"</OpenNI>"
;
"</OpenNI>
\n
"
;
class
CvCapture_OpenNI
:
public
CvCapture
{
...
...
@@ -206,22 +201,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
return
;
}
#ifdef HACK_WITH_XML
// Write configuration to the temporary file.
// This is a hack, because there is a bug in RunXmlScript().
// TODO: remove hack when bug in RunXmlScript() will be fixed.
std
::
string
xmlFilename
=
"opencv_kinect_configure.xml"
;
std
::
ofstream
outfile
(
xmlFilename
.
c_str
()
);
outfile
.
write
(
XMLConfig
.
c_str
(),
XMLConfig
.
length
()
);
outfile
.
close
();
status
=
context
.
RunXmlScriptFromFile
(
xmlFilename
.
c_str
()
);
// Remove temporary configuration file.
remove
(
xmlFilename
.
c_str
()
);
#else
status
=
context
.
RunXmlScript
(
XMLConfig
.
c_str
()
);
#endif
if
(
status
!=
XN_STATUS_OK
)
{
std
::
cerr
<<
"CvCapture_OpenNI::CvCapture_OpenNI : Failed to run xml script: "
...
...
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