43#include <visp3/core/vpConfig.h>
44#ifdef VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES
46#if defined(VISP_HAVE_DISPLAY)
48#include <visp3/core/vpImage.h>
49#include <visp3/core/vpTime.h>
50#include <visp3/gui/vpDisplayFactory.h>
51#include <visp3/sensor/vpKinect.h>
55#ifdef ENABLE_VISP_NAMESPACE
58#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
63 int exit_status = EXIT_SUCCESS;
66#ifdef VISP_HAVE_LIBFREENECT_OLD
69 Freenect::Freenect<vpKinect> freenect;
70 vpKinect &kinect = freenect.createDevice(0);
72 Freenect::Freenect freenect;
79 kinect.setTiltDegrees(angle);
98#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
108 display->init(Idmap, 100, 200,
"Depth map");
109 displayRgb->init(Irgb, 900, 200,
"Color Image");
110 displayRgbWarped->init(Iwarped, 900, 700,
"Warped Color Image");
113 std::cout <<
"Click in one image to stop acquisition" << std::endl;
130 std::cout <<
"Stop acquisition" << std::endl;
133 exit_status = EXIT_SUCCESS;
136 std::cout <<
"Catch an exception: " <<
e << std::endl;
137 exit_status = EXIT_FAILURE;
140 std::cout <<
"Catch an exception " << std::endl;
141 exit_status = EXIT_FAILURE;
144#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
145 if (display !=
nullptr) {
149 if (displayRgb !=
nullptr) {
153 if (displayRgbWarped !=
nullptr) {
154 delete displayRgbWarped;
164 std::cout <<
"You do not have X11, or GDI (Graphical Device Interface), or GTK, or OpenCV functionalities to display "
167 std::cout <<
"Tip if you are on a unix-like system:" << std::endl;
168 std::cout <<
"- Install X11, configure again ViSP using cmake and build again this example" << std::endl;
169 std::cout <<
"Tip if you are on a windows-like system:" << std::endl;
170 std::cout <<
"- Install GDI, configure again ViSP using cmake and build again this example" << std::endl;
178 std::cout <<
"You do not have Freenect functionality enabled" << std::endl;
179 std::cout <<
"Tip if you are on a unix-like system:" << std::endl;
180 std::cout <<
"- Install libfreenect, configure again ViSP using cmake and build again this example" << std::endl;
Class that defines generic functionalities for display.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
error that can be emitted by ViSP classes.
Definition of the vpImage class member functions.
Driver for the Kinect-1 device.
void warpRGBFrame(const vpImage< vpRGBa > &Irgb, const vpImage< float > &Idepth, vpImage< vpRGBa > &IrgbWarped)
bool getDepthMap(vpImage< float > &map)
void start(vpKinect::vpDMResolution res=DMAP_LOW_RES)
bool getRGB(vpImage< vpRGBa > &IRGB)
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.