4 #include <visp3/core/vpImageConvert.h> 5 #include <visp3/gui/vpDisplayGDI.h> 6 #include <visp3/gui/vpDisplayX.h> 7 #include <visp3/sensor/vpOccipitalStructure.h> 8 #include <visp3/sensor/vpRealSense2.h> 13 int main(
int argc,
char **argv)
15 #if defined(VISP_HAVE_REALSENSE2) && defined(VISP_HAVE_OCCIPITAL_STRUCTURE) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 17 unsigned int width = 640, height = 480;
29 vpDisplayX d_rs_depth(I_depth_rs, 10, height + 10,
"RealSense Depth"), d_sc_depth(I_depth_sc, width + 10, height + 10,
"Structure Core Depth");
30 vpDisplayX d_color_rs(I_color_rs, 10, 10,
"RealSense Color"), d_color_sc(I_color_sc, width + 10, 10,
"Structure Core Color");
34 cfg.enable_stream(RS2_STREAM_COLOR, width, height, RS2_FORMAT_RGBA8, 30);
35 cfg.enable_stream(RS2_STREAM_DEPTH, width, height, RS2_FORMAT_Z16, 30);
39 ST::CaptureSessionSettings settings;
40 settings.source = ST::CaptureSessionSourceId::StructureCore;
41 settings.structureCore.visibleEnabled =
true;
42 settings.applyExpensiveCorrection =
true;
48 rs.
acquire(reinterpret_cast<unsigned char *>(I_color_rs.bitmap), reinterpret_cast<unsigned char *>(rs_I_depth_raw.bitmap),
49 NULL, NULL, NULL, NULL, NULL);
50 sc.
acquire(reinterpret_cast<unsigned char *>(I_color_sc.bitmap), reinterpret_cast<unsigned char *>(sc_I_depth_raw.bitmap));
75 #if !(defined(VISP_HAVE_OCCIPITAL_STRUCTURE)) 76 std::cout <<
"Install libStructure, configure and build ViSP again to use this example" << std::endl;
78 #if !(defined(VISP_HAVE_REALSENSE2)) 79 std::cout <<
"Install librealsense, configure and build ViSP again to use this example" << std::endl;
81 #if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11) 82 std::cout <<
"This turorial should be built with c++11 support" << std::endl;
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
bool open(const ST::CaptureSessionSettings &settings)
static void flush(const vpImage< unsigned char > &I)
bool open(const rs2::config &cfg=rs2::config())
void acquire(vpImage< unsigned char > &gray, bool undistorted=false, double *ts=NULL)
static void display(const vpImage< unsigned char > &I)
void acquire(vpImage< unsigned char > &grey, double *ts=NULL)
static void createDepthHistogram(const vpImage< uint16_t > &src_depth, vpImage< vpRGBa > &dest_rgba)