42 #include <visp3/core/vpConfig.h>
44 #if defined(VISP_HAVE_OCCIPITAL_STRUCTURE) && ( VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11 ) \
45 && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI))
47 #include <visp3/core/vpImageConvert.h>
48 #include <visp3/gui/vpDisplayGDI.h>
49 #include <visp3/gui/vpDisplayX.h>
50 #include <visp3/sensor/vpOccipitalStructure.h>
54 #ifdef ENABLE_VISP_NAMESPACE
59 unsigned int display_scale = 1;
62 ST::CaptureSessionSettings settings;
63 settings.source = ST::CaptureSessionSourceId::StructureCore;
64 settings.structureCore.visibleEnabled =
true;
65 settings.applyExpensiveCorrection =
true;
73 #if defined(VISP_HAVE_X11)
74 vpDisplayX display_visible;
75 vpDisplayX display_depth;
76 #elif defined(VISP_HAVE_GDI)
81 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)
84 display_visible.setDownScalingFactor(display_scale);
85 display_visible.init(I_visible, 10, 10,
"Visible image");
90 display_depth.setDownScalingFactor(display_scale);
91 display_depth.init(I_depth,
static_cast<int>(I_visible.
getWidth() / display_scale) + 20, 10,
"Depth image");
115 std::cerr <<
"Structure SDK error " << e.
what() << std::endl;
117 catch (
const std::exception &e) {
118 std::cerr << e.what() << std::endl;
126 #if !defined(VISP_HAVE_OCCIPITAL_STRUCTURE)
127 std::cout <<
"You do not have Occipital Structure SDK functionality enabled..." << std::endl;
128 std::cout <<
"Tip:" << std::endl;
129 std::cout <<
"- Install libStructure, configure again ViSP using cmake and build again this example" << std::endl;
131 #elif ( VISP_CXX_STANDARD < VISP_CXX_STANDARD_11 )
132 std::cout <<
"You do not build ViSP with c++11 or higher compiler flag" << std::endl;
133 std::cout <<
"Tip:" << std::endl;
134 std::cout <<
"- Configure ViSP again using cmake -DUSE_CXX_STANDARD=11, and build again this example" << std::endl;
135 #elif !(defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI))
136 std::cout <<
"You don't have X11 or GDI display capabilities" << std::endl;
Display for windows using GDI (available on any windows 32 platform).
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)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
error that can be emitted by ViSP classes.
const char * what() const
static void createDepthHistogram(const vpImage< uint16_t > &src_depth, vpImage< vpRGBa > &dest_rgba)
unsigned int getWidth() const
Type * bitmap
points toward the bitmap
unsigned int getHeight(vpOccipitalStructureStream stream_type)
void acquire(vpImage< unsigned char > &gray, bool undistorted=false, double *ts=nullptr)
unsigned int getWidth(vpOccipitalStructureStream stream_type)
bool open(const ST::CaptureSessionSettings &settings)
VISP_EXPORT double measureTimeMs()