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
40d8d11f
Commit
40d8d11f
authored
Apr 28, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed RGBD capture with Asus Xtion (by Gary Bradski)
parent
682f31a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
highgui_c.h
modules/highgui/include/opencv2/highgui/highgui_c.h
+1
-0
cap_openni.cpp
modules/highgui/src/cap_openni.cpp
+22
-2
No files found.
modules/highgui/include/opencv2/highgui/highgui_c.h
View file @
40d8d11f
...
...
@@ -300,6 +300,7 @@ enum
CV_CAP_PVAPI
=
800
,
// PvAPI, Prosilica GigE SDK
CV_CAP_OPENNI
=
900
,
// OpenNI (for Kinect)
CV_CAP_OPENNI_ASUS
=
910
,
// OpenNI (for Asus Xtion)
CV_CAP_ANDROID
=
1000
,
// Android
...
...
modules/highgui/src/cap_openni.cpp
View file @
40d8d11f
...
...
@@ -409,10 +409,11 @@ private:
class
CvCapture_OpenNI
:
public
CvCapture
{
public
:
enum
{
DEVICE_DEFAULT
=
0
,
DEVICE_MS_KINECT
=
0
,
DEVICE_ASUS_XTION
=
1
,
DEVICE_MAX
=
1
};
static
const
int
INVALID_PIXEL_VAL
=
0
;
static
const
int
INVALID_COORDINATE_VAL
=
0
;
#ifdef HAVE_TBB
static
const
int
DEFAULT_MAX_BUFFER_SIZE
=
8
;
#else
...
...
@@ -516,14 +517,25 @@ XnMapOutputMode defaultMapOutputMode()
return
mode
;
}
CvCapture_OpenNI
::
CvCapture_OpenNI
(
int
index
)
{
int
deviceType
=
DEVICE_DEFAULT
;
XnStatus
status
;
isContextOpened
=
false
;
maxBufferSize
=
DEFAULT_MAX_BUFFER_SIZE
;
isCircleBuffer
=
DEFAULT_IS_CIRCLE_BUFFER
;
maxTimeDuration
=
DEFAULT_MAX_TIME_DURATION
;
if
(
index
>=
10
)
{
deviceType
=
index
/
10
;
index
%=
10
;
}
if
(
deviceType
>
DEVICE_MAX
)
return
;
// Initialize and configure the context.
status
=
context
.
Init
();
...
...
@@ -620,6 +632,14 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
CV_DbgAssert
(
imageGenerator
.
SetMapOutputMode
(
defaultMapOutputMode
())
==
XN_STATUS_OK
);
}
if
(
deviceType
==
DEVICE_ASUS_XTION
)
{
//ps/asus specific
imageGenerator
.
SetIntProperty
(
"InputFormat"
,
1
/*XN_IO_IMAGE_FORMAT_YUV422*/
);
imageGenerator
.
SetPixelFormat
(
XN_PIXEL_FORMAT_RGB24
);
depthGenerator
.
SetIntProperty
(
"RegistrationType"
,
1
/*XN_PROCESSING_HARDWARE*/
);
}
// Start generating data.
status
=
context
.
StartGeneratingAll
();
if
(
status
!=
XN_STATUS_OK
)
...
...
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