Fix notes about cmake files. Fix build warning.

pull/2003/head
Vladimir Bystricky 11 years ago
parent 4088013251
commit cc08e00876
  1. 55
      cmake/OpenCVFindIntelPerCSDK.cmake
  2. 1
      cmake/OpenCVFindLibsVideo.cmake
  3. 6
      cmake/templates/cvconfig.h.in
  4. 7
      doc/user_guide/ug_intelperc.rst
  5. 2
      modules/highgui/CMakeLists.txt
  6. 10
      modules/highgui/include/opencv2/highgui/highgui_c.h
  7. 44
      modules/highgui/src/cap_intelperc.cpp
  8. 18
      samples/cpp/intelperc_capture.cpp

@ -1,51 +1,20 @@
# Main variables:
# INTELPERC_LIBRARY and INTELPERC_INCLUDES to link Intel Perceptial Computing SDK modules
# INTELPERC_LIBRARIES and INTELPERC_INCLUDE to link Intel Perceptial Computing SDK modules
# HAVE_INTELPERC for conditional compilation OpenCV with/without Intel Perceptial Computing SDK
if(NOT "${INTELPERC_LIB_DIR}" STREQUAL "${INTELPERC_LIB_DIR_INTERNAL}")
unset(INTELPERC_LIBRARY CACHE)
unset(INTELPERC_LIB_DIR CACHE)
endif()
if(NOT "${INTELPERC_INCLUDE_DIR}" STREQUAL "${INTELPERC_INCLUDE_DIR_INTERNAL}")
unset(INTELPERC_INCLUDES CACHE)
unset(INTELPERC_INCLUDE_DIR CACHE)
endif()
if(WIN32)
if(NOT (MSVC64 OR MINGW64))
find_file(INTELPERC_INCLUDES "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Intel Perceptual Computing SDK interface header")
find_library(INTELPERC_LIBRARY "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/Win32" DOC "Intel Perceptual Computing SDK library")
else()
find_file(INTELPERC_INCLUDES "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Intel Perceptual Computing SDK interface header")
find_library(INTELPERC_LIBRARY "libpxc.lib" PATHS "$ENV{PCSDK_DIR}/lib/x64" DOC "Intel Perceptual Computing SDK library")
endif()
endif()
if(INTELPERC_LIBRARY AND INTELPERC_INCLUDES)
set(HAVE_INTELPERC TRUE)
endif() #if(INTELPERC_LIBRARY AND INTELPERC_INCLUDES)
get_filename_component(INTELPERC_LIB_DIR "${INTELPERC_LIBRARY}" PATH)
get_filename_component(INTELPERC_INCLUDE_DIR "${INTELPERC_INCLUDES}" PATH)
if(HAVE_INTELPERC)
set(INTELPERC_LIB_DIR "${INTELPERC_LIB_DIR}" CACHE PATH "Path to Intel Perceptual Computing SDK interface libraries" FORCE)
set(INTELPERC_INCLUDE_DIR "${INTELPERC_INCLUDE_DIR}" CACHE PATH "Path to Intel Perceptual Computing SDK interface headers" FORCE)
endif()
if(INTELPERC_LIBRARY)
set(INTELPERC_LIB_DIR_INTERNAL "${INTELPERC_LIB_DIR}" CACHE INTERNAL "This is the value of the last time INTELPERC_LIB_DIR was set successfully." FORCE)
if(X86_64)
find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/x64" DOC "Path to Intel Perceptual Computing SDK interface libraries")
else()
message( WARNING, " Intel Perceptual Computing SDK library directory (set by INTELPERC_LIB_DIR variable) is not found or does not have Intel Perceptual Computing SDK libraries." )
find_path(INTELPERC_INCLUDE_DIR "pxcsession.h" PATHS "$ENV{PCSDK_DIR}include" DOC "Path to Intel Perceptual Computing SDK interface headers")
find_file(INTELPERC_LIBRARIES "libpxc.lib" PATHS "$ENV{PCSDK_DIR}lib/Win32" DOC "Path to Intel Perceptual Computing SDK interface libraries")
endif()
if(INTELPERC_INCLUDES)
set(INTELPERC_INCLUDE_DIR_INTERNAL "${INTELPERC_INCLUDE_DIR}" CACHE INTERNAL "This is the value of the last time INTELPERC_INCLUDE_DIR was set successfully." FORCE)
if(INTELPERC_INCLUDE_DIR AND INTELPERC_LIBRARIES)
set(HAVE_INTELPERC TRUE)
else()
message( WARNING, " Intel Perceptual Computing SDK include directory (set by INTELPERC_INCLUDE_DIR variable) is not found or does not have Intel Perceptual Computing SDK include files." )
endif()
mark_as_advanced(FORCE INTELPERC_LIBRARY)
mark_as_advanced(FORCE INTELPERC_INCLUDES)
set(HAVE_INTELPERC FALSE)
message(WARNING "Intel Perceptual Computing SDK library directory (set by INTELPERC_LIB_DIR variable) is not found or does not have Intel Perceptual Computing SDK libraries.")
endif() #if(INTELPERC_INCLUDE_DIR AND INTELPERC_LIBRARIES)
mark_as_advanced(FORCE INTELPERC_LIBRARIES INTELPERC_INCLUDE_DIR)

@ -252,7 +252,6 @@ if (NOT IOS)
endif()
# --- Intel Perceptual Computing SSDK ---
ocv_clear_vars(HAVE_INTELPERC)
if(WITH_INTELPERC)
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindIntelPerCSDK.cmake")
endif(WITH_INTELPERC)

@ -85,6 +85,9 @@
/* Apple ImageIO Framework */
#cmakedefine HAVE_IMAGEIO
/* Intel Perceptual Computing SDK library */
#cmakedefine HAVE_INTELPERC
/* Intel Integrated Performance Primitives */
#cmakedefine HAVE_IPP
@ -158,9 +161,6 @@
/* Xine video library */
#cmakedefine HAVE_XINE
/* Intel Perceptual Computing SDK library */
#cmakedefine HAVE_INTELPERC
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#cmakedefine WORDS_BIGENDIAN

@ -12,7 +12,7 @@ Depth sensors compatible with Intel Perceptual Computing SDK are supported throu
In order to use depth sensor with OpenCV you should do the following preliminary steps:
#.
Install Intel Perceptual Computing SDK (from here http://www.intel.com/software/perceptual).
Install Intel Perceptual Computing SDK (from here http://www.intel.com/software/perceptual).
#.
Configure OpenCV with Intel Perceptual Computing SDK support by setting ``WITH_INTELPERC`` flag in CMake. If Intel Perceptual Computing SDK is found in install folders OpenCV will be built with Intel Perceptual Computing SDK library (see a status ``INTELPERC`` in CMake log). If CMake process doesn't find Intel Perceptual Computing SDK installation folder automatically, the user should change corresponding CMake variables ``INTELPERC_LIB_DIR`` and ``INTELPERC_INCLUDE_DIR`` to the proper value.
@ -56,7 +56,7 @@ For getting several data maps use ``VideoCapture::grab`` and ``VideoCapture::ret
capture.retrieve( depthMap, CV_CAP_INTELPERC_DEPTH_MAP );
capture.retrieve( image, CV_CAP_INTELPERC_IMAGE );
capture.retrieve( irImage, CV_CAP_INTELPERC_IR_MAP);
capture.retrieve( irImage, CV_CAP_INTELPERC_IR_MAP);
if( waitKey( 30 ) >= 0 )
break;
@ -76,5 +76,4 @@ Since two types of sensor's data generators are supported (image generator and d
For more information please refer to the example of usage intelperc_capture.cpp_ in ``opencv/samples/cpp`` folder.
.. _intelperc_capture.cpp: https://github.com/Itseez/opencv/tree/master/samples/cpp/intelperc_capture.cpp
.. _intelperc_capture.cpp: https://github.com/Itseez/opencv/tree/master/samples/cpp/intelperc_capture.cpp

@ -221,7 +221,7 @@ endif()
if(HAVE_INTELPERC)
list(APPEND highgui_srcs src/cap_intelperc.cpp)
ocv_include_directories(${INTELPERC_INCLUDE_DIR})
list(APPEND HIGHGUI_LIBRARIES ${INTELPERC_LIBRARY})
list(APPEND HIGHGUI_LIBRARIES ${INTELPERC_LIBRARIES})
endif(HAVE_INTELPERC)
if(IOS)

@ -469,10 +469,10 @@ enum
CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003,
CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004,
CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,
CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006
CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006,
,CV_CAP_PROP_INTELPERC_PROFILE_COUNT = 11001,
CV_CAP_PROP_INTELPERC_PROFILE_IDX = 11002,
CV_CAP_PROP_INTELPERC_PROFILE_COUNT = 11001,
CV_CAP_PROP_INTELPERC_PROFILE_IDX = 11002,
CV_CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003,
CV_CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004,
CV_CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005,
@ -480,8 +480,8 @@ enum
CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007,
// Intel PerC streams
CV_CAP_INTELPERC_DEPTH_GENERATOR = 1 << 31,
CV_CAP_INTELPERC_IMAGE_GENERATOR = 1 << 30,
CV_CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29,
CV_CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28,
CV_CAP_INTELPERC_GENERATORS_MASK = CV_CAP_INTELPERC_DEPTH_GENERATOR + CV_CAP_INTELPERC_IMAGE_GENERATOR,
};

@ -63,7 +63,7 @@ public:
}
int getProfileIDX() const
{
return m_profileIdx;
return m_profileIdx;
}
public:
virtual bool initStream(PXCSession *session) = 0;
@ -132,29 +132,29 @@ protected:
return false;
pxcStatus sts = PXC_STATUS_NO_ERROR;
PXCSession::ImplDesc templat;
memset(&templat,0,sizeof(templat));
templat.group = PXCSession::IMPL_GROUP_SENSOR;
templat.subgroup= PXCSession::IMPL_SUBGROUP_VIDEO_CAPTURE;
PXCSession::ImplDesc templat;
memset(&templat,0,sizeof(templat));
templat.group = PXCSession::IMPL_GROUP_SENSOR;
templat.subgroup= PXCSession::IMPL_SUBGROUP_VIDEO_CAPTURE;
for (int modidx = 0; PXC_STATUS_NO_ERROR <= sts; modidx++)
for (int modidx = 0; PXC_STATUS_NO_ERROR <= sts; modidx++)
{
PXCSession::ImplDesc desc;
sts = session->QueryImpl(&templat, modidx, &desc);
if (PXC_STATUS_NO_ERROR > sts)
if (PXC_STATUS_NO_ERROR > sts)
break;
PXCSmartPtr<PXCCapture> capture;
sts = session->CreateImpl<PXCCapture>(&desc, &capture);
if (!capture.IsValid())
if (!capture.IsValid())
continue;
/* enumerate devices */
for (int devidx = 0; PXC_STATUS_NO_ERROR <= sts; devidx++)
for (int devidx = 0; PXC_STATUS_NO_ERROR <= sts; devidx++)
{
PXCSmartPtr<PXCCapture::Device> device;
sts = capture->CreateDevice(devidx, &device);
if (PXC_STATUS_NO_ERROR <= sts)
if (PXC_STATUS_NO_ERROR <= sts)
{
m_device = device.ReleasePtr();
return true;
@ -172,19 +172,19 @@ protected:
pxcStatus sts = PXC_STATUS_NO_ERROR;
/* enumerate streams */
for (int streamidx = 0; PXC_STATUS_NO_ERROR <= sts; streamidx++)
for (int streamidx = 0; PXC_STATUS_NO_ERROR <= sts; streamidx++)
{
PXCCapture::Device::StreamInfo sinfo;
sts = m_device->QueryStream(streamidx, &sinfo);
if (PXC_STATUS_NO_ERROR > sts)
if (PXC_STATUS_NO_ERROR > sts)
break;
if (PXCCapture::VideoStream::CUID != sinfo.cuid)
if (PXCCapture::VideoStream::CUID != sinfo.cuid)
continue;
if (type != sinfo.imageType)
if (type != sinfo.imageType)
continue;
sts = m_device->CreateStream<PXCCapture::VideoStream>(streamidx, &m_stream);
if (PXC_STATUS_NO_ERROR == sts)
if (PXC_STATUS_NO_ERROR == sts)
break;
m_stream.ReleaseRef();
}
@ -206,7 +206,7 @@ protected:
if (!m_stream.IsValid())
return;
pxcStatus sts = PXC_STATUS_NO_ERROR;
for (int profidx = 0; PXC_STATUS_NO_ERROR <= sts; profidx++)
for (int profidx = 0; PXC_STATUS_NO_ERROR <= sts; profidx++)
{
PXCCapture::VideoStream::ProfileInfo pinfo;
sts = m_stream->QueryProfile(profidx, &pinfo);
@ -422,7 +422,7 @@ protected:
return false;
PXCImage::ImageInfo info;
pxcImage->QueryInfo(&info);
PXCImage::ImageData data;
pxcImage->AcquireAccess(PXCImage::ACCESS_READ, PXCImage::COLOR_FORMAT_RGB24, &data);
@ -574,7 +574,7 @@ protected:
return false;
PXCImage::ImageInfo info;
pxcImage->QueryInfo(&info);
PXCImage::ImageData data;
pxcImage->AcquireAccess(PXCImage::ACCESS_READ, &data);
@ -610,7 +610,7 @@ public:
: m_contextOpened(false)
{
pxcStatus sts = PXCSession_Create(&m_session);
if (PXC_STATUS_NO_ERROR > sts)
if (PXC_STATUS_NO_ERROR > sts)
return;
m_contextOpened = m_imageStream.initStream(m_session);
m_contextOpened &= m_depthStream.initStream(m_session);

@ -3,7 +3,6 @@
#include <tchar.h>
#include "opencv2/highgui/highgui.hpp"
//#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
@ -122,11 +121,11 @@ static void printStreamProperties(VideoCapture &capture)
{
capture.set(CV_CAP_INTELPERC_IMAGE_GENERATOR | CV_CAP_PROP_INTELPERC_PROFILE_IDX, (double)i);
cout << " Profile[" << i << "]: ";
cout << "width = " <<
cout << "width = " <<
(int)capture.get(CV_CAP_INTELPERC_IMAGE_GENERATOR | CV_CAP_PROP_FRAME_WIDTH);
cout << ", height = " <<
cout << ", height = " <<
(int)capture.get(CV_CAP_INTELPERC_IMAGE_GENERATOR | CV_CAP_PROP_FRAME_HEIGHT);
cout << ", fps = " <<
cout << ", fps = " <<
capture.get(CV_CAP_INTELPERC_IMAGE_GENERATOR | CV_CAP_PROP_FPS);
cout << endl;
}
@ -143,11 +142,11 @@ static void printStreamProperties(VideoCapture &capture)
{
capture.set(CV_CAP_INTELPERC_DEPTH_GENERATOR | CV_CAP_PROP_INTELPERC_PROFILE_IDX, (double)i);
cout << " Profile[" << i << "]: ";
cout << "width = " <<
cout << "width = " <<
(int)capture.get(CV_CAP_INTELPERC_DEPTH_GENERATOR | CV_CAP_PROP_FRAME_WIDTH);
cout << ", height = " <<
cout << ", height = " <<
(int)capture.get(CV_CAP_INTELPERC_DEPTH_GENERATOR | CV_CAP_PROP_FRAME_HEIGHT);
cout << ", fps = " <<
cout << ", fps = " <<
capture.get(CV_CAP_INTELPERC_DEPTH_GENERATOR | CV_CAP_PROP_FPS);
cout << endl;
}
@ -353,7 +352,7 @@ int _tmain(int argc, char* argv[])
{
if (g_closedDepthPoint)
{
double minVal = 0.0; double maxVal = 0.0;
double minVal = 0.0; double maxVal = 0.0;
minMaxIdx(depthImage, &minVal, &maxVal, g_closedDepthPoint);
}
imshowDepth("depth image", depthImage, capture);
@ -375,5 +374,4 @@ int _tmain(int argc, char* argv[])
}
return 0;
}
}
Loading…
Cancel
Save