From: Maria Dimashova Date: Thu, 27 Jan 2011 10:53:13 +0000 (+0000) Subject: added help on Kinect usage to user guide X-Git-Tag: accepted/2.0/20130307.220821~3605 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85e5de67e49654c1081801108f0929cf378daaa9;p=profile%2Fivi%2Fopencv.git added help on Kinect usage to user guide --- diff --git a/doc/opencv_user.pdf b/doc/opencv_user.pdf index fae2d69..b710d28 100644 Binary files a/doc/opencv_user.pdf and b/doc/opencv_user.pdf differ diff --git a/doc/user_guide/opencv_guide_body.tex b/doc/user_guide/opencv_guide_body.tex index ff51908..3c73543 100644 --- a/doc/user_guide/opencv_guide_body.tex +++ b/doc/user_guide/opencv_guide_body.tex @@ -2,6 +2,11 @@ \chapter{cv::Mat. Operations with images.} \renewcommand{\curModule}{cv::Mat. Operations with images.} \input{user_guide/user_mat} + \chapter{Features2d.} \renewcommand{\curModule}{Features2d} \input{user_guide/user_features2d} + +\chapter{Highgui.} +\renewcommand{\curModule}{Highgui.} +\input{user_guide/user_highgui} diff --git a/doc/user_guide/user_highgui.tex b/doc/user_guide/user_highgui.tex new file mode 100644 index 0000000..c2c4582 --- /dev/null +++ b/doc/user_guide/user_highgui.tex @@ -0,0 +1,88 @@ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% C++ % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\ifCpp +\section{Using Kinect sensor.} +To get Kinect data there is support in VideoCapture class. So the user can retrieve depth map, +rgb image and some other formats of Kinect output by using familiar interface of \texttt{VideoCapture}.\par + +To use existing support of Kinect sensor the user should do the following preliminary steps:\newline +1.) Install OpenNI library and PrimeSensor Module for OpenNI from here \url{http://www.openni. +org/downloadfiles}. The installation should be made in default folders listed in install instrac- +tions of these products: +\begin{lstlisting} +OpenNI: + Linux & MacOSX: + Libs into: /usr/lib + Includes into: /usr/include/ni + Windows: + Libs into: c:/Program Files/OpenNI/Lib + Includes into: c:/Program Files/OpenNI/Include +PrimeSensor Module: + Linux & MacOSX: + Libs into: /usr/lib + Bins into: /usr/bin + Windows: + Libs into: c:/Program Files/Prime Sense/Sensor/Lib + Bins into: c:/Program Files/Prime Sense/Sensor/Bin +\end{lstlisting} +2.) Configure OpenCV with OpenNI support by setting \texttt{WITH\_OPENNI} flag in CMake. If OpenNI +is found in default install folders OpenCV will be built with OpenNI library regardless of whether +PrimeSensor Module is found or not. If PrimeSensor Module was not found the user get warning +about this in CMake log. OpenCV is compiled with OpenNI library even though PrimeSensor +Module was not detected, but \texttt{VideoCapture} object can not grab the data from Kinect sensor in +such case. Build OpenCV.\par + +VideoCapture provides retrieving the following Kinect data: +\begin{lstlisting} +a.) data given from depth generator: + OPENNI_DEPTH_MAP - depth values in mm (CV_16UC1) + OPENNI_POINT_CLOUD_MAP - XYZ in meters (CV_32FC3) + OPENNI_DISPARITY_MAP - disparity in pixels (CV_8UC1) + OPENNI_DISPARITY_MAP_32F - disparity in pixels (CV_32FC1) + OPENNI_VALID_DEPTH_MASK - mask of valid pixels (not ocluded, + not shaded etc.) (CV_8UC1) +b.) data given from RGB image generator: + OPENNI_BGR_IMAGE - color image (CV_8UC3) + OPENNI_GRAY_IMAGE - gray image (CV_8UC1) +\end{lstlisting} + +To get depth map from Kinect the user can use \texttt{VideoCapture::operator >>}, e. g. +\begin{lstlisting} +VideoCapture capture(0); // or CV_CAP_OPENNI +for(;;) +{ + Mat depthMap; + + capture >> depthMap; + + if( waitKey( 30 ) >= 0 ) + break; +} +\end{lstlisting} +To get several Kinect maps the user should use \texttt{VideoCapture::grab + VideoCapture::retrieve}, +e. g. +\begin{lstlisting} +VideoCapture capture(0); // or CV_CAP_OPENNI +for(;;) +{ + Mat depthMap; + Mat rgbImage + + capture.grab(); + + capture.retrieve( depthMap, OPENNI_DEPTH_MAP ); + capture.retrieve( bgrImage, OPENNI_BGR_IMAGE ); + + if( waitKey( 30 ) >= 0 ) + break; +} +\end{lstlisting} + +For more information see example kinect maps.cpp in sample folder. + +\fi