Skip to content

Commit

Permalink
Fix notes about cmake files. Fix build warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Bystricky committed Dec 17, 2013
1 parent 4088013 commit cc08e00
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 89 deletions.
55 changes: 12 additions & 43 deletions cmake/OpenCVFindIntelPerCSDK.cmake
Original file line number Diff line number Diff line change
@@ -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)
1 change: 0 additions & 1 deletion cmake/OpenCVFindLibsVideo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 3 additions & 3 deletions cmake/templates/cvconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
7 changes: 3 additions & 4 deletions doc/user_guide/ug_intelperc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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
2 changes: 1 addition & 1 deletion modules/highgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions modules/highgui/include/opencv2/highgui/highgui_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,19 +469,19 @@ 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,
CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006,
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,
};

Expand Down
44 changes: 22 additions & 22 deletions modules/highgui/src/cap_intelperc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CvIntelPerCStreamBase
}
int getProfileIDX() const
{
return m_profileIdx;
return m_profileIdx;
}
public:
virtual bool initStream(PXCSession *session) = 0;
Expand Down Expand Up @@ -132,29 +132,29 @@ class CvIntelPerCStreamBase
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;
Expand All @@ -172,19 +172,19 @@ class CvIntelPerCStreamBase

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();
}
Expand All @@ -206,7 +206,7 @@ class CvIntelPerCStreamBase
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);
Expand Down Expand Up @@ -422,7 +422,7 @@ class CvIntelPerCStreamImage
return false;
PXCImage::ImageInfo info;
pxcImage->QueryInfo(&info);

PXCImage::ImageData data;
pxcImage->AcquireAccess(PXCImage::ACCESS_READ, PXCImage::COLOR_FORMAT_RGB24, &data);

Expand Down Expand Up @@ -574,7 +574,7 @@ class CvIntelPerCStreamDepth
return false;
PXCImage::ImageInfo info;
pxcImage->QueryInfo(&info);

PXCImage::ImageData data;
pxcImage->AcquireAccess(PXCImage::ACCESS_READ, &data);

Expand Down Expand Up @@ -610,7 +610,7 @@ class CvCapture_IntelPerC : public CvCapture
: 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);
Expand Down
18 changes: 8 additions & 10 deletions samples/cpp/intelperc_capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <tchar.h>
#include "opencv2/highgui/highgui.hpp"
//#include "opencv2/imgproc/imgproc.hpp"

#include <iostream>

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
Expand All @@ -375,5 +374,4 @@ int _tmain(int argc, char* argv[])
}

return 0;
}

}

0 comments on commit cc08e00

Please sign in to comment.