Commit 95adca206aa7a15c2d465ac70001b48620dfe1e6
1 parent
1998d428
initial ipc wrapper work
Showing
3 changed files
with
62 additions
and
0 deletions
sdk/plugins/ipc2013.cmake
0 → 100644
| 1 | +set(BR_WITH_IPC2013 OFF CACHE BOOL "Build with Intel Perceptual Computing SDK 2013") | |
| 2 | + | |
| 3 | +if(${BR_WITH_IPC2013}) | |
| 4 | + find_package(IPC2013 REQUIRED) | |
| 5 | + set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} plugins/ipc2013.cpp) | |
| 6 | + set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${IPC2013_LIBS}) | |
| 7 | + install(DIRECTORY ${IPC2013_DIR}/bin/x64/ DESTINATION bin) | |
| 8 | +endif() | ... | ... |
sdk/plugins/ipc2013.cpp
0 → 100644
| 1 | +#include <openbr_plugin.h> | |
| 2 | +#include <pxcaccelerator.h> | |
| 3 | +#include <pxcface.h> | |
| 4 | +#include <pxcimage.h> | |
| 5 | +#include <pxcsession.h> | |
| 6 | + | |
| 7 | +using namespace br; | |
| 8 | + | |
| 9 | +static PXCSession *pxcSession = NULL; | |
| 10 | +static PXCAccelerator *pxcAccelerator = NULL; | |
| 11 | + | |
| 12 | +/*! | |
| 13 | + * \ingroup initializers | |
| 14 | + * \brief Initializes Intel Perceptual Computing SDK 2013 | |
| 15 | + * \author Josh Klontz \cite jklontz | |
| 16 | + */ | |
| 17 | +class IPC2013Initializer : public Initializer | |
| 18 | +{ | |
| 19 | + void initialize() const | |
| 20 | + { | |
| 21 | + PXCSession_Create(&pxcSession); | |
| 22 | + pxcSession->CreateAccelerator(&pxcAccelerator); | |
| 23 | + } | |
| 24 | +}; | |
| 25 | + | |
| 26 | +BR_REGISTER(Initializer, IPC2013Initializer) | |
| 27 | + | |
| 28 | +/*! | |
| 29 | + * \ingroup transforms | |
| 30 | + * \brief Intel Perceptual Computing SDK 2013 Face Recognition | |
| 31 | + * \author Josh Klontz \cite jklontz | |
| 32 | + */ | |
| 33 | +class IPC2013FaceRecognitionTransfrom : public UntrainableTransform | |
| 34 | +{ | |
| 35 | + Q_OBJECT | |
| 36 | + | |
| 37 | + void project(const Template &src, Template &dst) const | |
| 38 | + { | |
| 39 | + PXCImage::ImageInfo pxcImageInfo; | |
| 40 | + pxcImageInfo.width = src.m().cols; | |
| 41 | + pxcImageInfo.height = src.m().rows; | |
| 42 | + pxcImageInfo.format = PXCImage::COLOR_FORMAT_RGB24; | |
| 43 | + | |
| 44 | + //PXCImage *pxcImage; | |
| 45 | + //pxcAccelerator->CreateImage(&pxcImageInfo, 0, src.m().data, &pxcImage); | |
| 46 | + } | |
| 47 | +}; | |
| 48 | + | |
| 49 | +BR_REGISTER(Transform, IPC2013FaceRecognitionTransfrom) | |
| 50 | + | |
| 51 | +#include "ipc2013.moc" | ... | ... |
share/openbr/cmake/FindIPC2013.cmake
| ... | ... | @@ -12,3 +12,6 @@ find_path(IPC2013_DIR include/pxcimage.h "C:/Program Files/Intel/PCSDK") |
| 12 | 12 | include_directories(${IPC2013_DIR}/include) |
| 13 | 13 | link_directories(${IPC2013_DIR}/lib/x64) |
| 14 | 14 | set(IPC2013_LIBS libpxc) |
| 15 | +if(MSVC) | |
| 16 | + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") | |
| 17 | +endif() | ... | ... |