Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions examples/protonect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ SET(LIBRARY_OUTPUT_PATH ${MY_DIR}/lib)
FIND_PACKAGE(OpenCL)

# dependencies
FIND_PACKAGE(OpenCV REQUIRED)

# OpenCV
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIR})
FIND_PACKAGE(OpenCV)

# LibUSB
INCLUDE_DIRECTORIES("${MY_DIR}/../../depends/libusb/include/libusb-1.0/")
Expand Down Expand Up @@ -94,7 +91,6 @@ SET(SOURCES

SET(LIBRARIES
usb-1.0
${OpenCV_LIBS}
turbojpeg
${LIBFREENECT2_THREADING_LIBRARIES}
)
Expand Down
13 changes: 7 additions & 6 deletions examples/protonect/Protonect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
#include <iostream>
#include <signal.h>

#include <opencv2/opencv.hpp>
//#include <opencv2/opencv.hpp>

#include <libfreenect2/libfreenect2.hpp>
#include <libfreenect2/frame_listener_impl.h>
#include <libfreenect2/threading.h>
#include <libfreenect2/packet_pipeline.h>

bool protonect_shutdown = false;

Expand All @@ -55,7 +56,7 @@ int main(int argc, char *argv[])


libfreenect2::Freenect2 freenect2;
libfreenect2::Freenect2Device *dev = freenect2.openDefaultDevice();
libfreenect2::Freenect2Device *dev = freenect2.openDefaultDevice(new libfreenect2::CpuPacketPipeline());

if(dev == 0)
{
Expand Down Expand Up @@ -83,11 +84,11 @@ int main(int argc, char *argv[])
libfreenect2::Frame *ir = frames[libfreenect2::Frame::Ir];
libfreenect2::Frame *depth = frames[libfreenect2::Frame::Depth];

cv::imshow("rgb", cv::Mat(rgb->height, rgb->width, CV_8UC3, rgb->data));
cv::imshow("ir", cv::Mat(ir->height, ir->width, CV_32FC1, ir->data) / 20000.0f);
cv::imshow("depth", cv::Mat(depth->height, depth->width, CV_32FC1, depth->data) / 4500.0f);
//cv::imshow("rgb", cv::Mat(rgb->height, rgb->width, CV_8UC3, rgb->data));
//cv::imshow("ir", cv::Mat(ir->height, ir->width, CV_32FC1, ir->data) / 20000.0f);
//cv::imshow("depth", cv::Mat(depth->height, depth->width, CV_32FC1, depth->data) / 4500.0f);

int key = cv::waitKey(1);
int key = 1;//cv::waitKey(1);
protonect_shutdown = protonect_shutdown || (key > 0 && ((key & 0xFF) == 27)); // shutdown on escape

listener.release(frames);
Expand Down
Loading