     // config.enable_stream(RS2_STREAM_COLOR, 848, 480, RS2_FORMAT_YUYV, 60)
 
     auto selection = pipe.start(config);
-    auto dev = selection.get_device();
     auto sensor = dev.first<rs2::depth_sensor>();
-
-    // load json preset for high accuracy mode
-    auto dev_adv = rs400::advanced_mode::advanced_mode(dev);
-    std::ifstream settingsJSONFile("preset.json");
-    std::string settingsJSON((std::istreambuf_iterator<char>(settingsJSONFile)), std::istreambuf_iterator<char>());
-    dev_adv.load_json(settingsJSON);
 
     // get dimension (to be sure)
     auto depth_stream = selection.get_stream(RS2_STREAM_DEPTH).as<rs2::video_stream_profile>();

    }
}

int main(int argc, char *argv[])
try
{
    using namespace cv;
    using namespace rs2;

    // Start the camera
    pipeline pipe;
    rs2::config config;
    config.enable_stream(RS2_STREAM_DEPTH, 1280, 720, RS2_FORMAT_Z16, 30);
    // config.enable_stream(RS2_STREAM_COLOR, 1280, 720, RS2_FORMAT_YUYV, 30);
    config.enable_stream(RS2_STREAM_COLOR, 1920, 1080, RS2_FORMAT_YUYV, 30);

#define BLOCK_SIZE 256
#define DOWNSCALE_MAX_FRAME_HIGHT 400

#include <fstream>
#include <librealsense2/rs.hpp> // Include RealSense Cross Platform API
#include <librealsense2/rs_advanced_mode.hpp>
#include <librealsense2/rsutil.h>
