lamiastella

SR300Camera.cpp

May 23rd, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.67 KB | None | 0 0
  1. #define NOMINMAX
  2. #define _WINSOCKAPI_  
  3.  
  4. #pragma once
  5.  
  6. // C++ Libraries
  7. #include<string.h>
  8.  
  9. //realsense library
  10. #include "RealSense/SenseManager.h"
  11. #include "RealSense/SampleReader.h"
  12. #include "RealSense/Session.h"
  13. #include "RealSense/Image.h"
  14. #include <opencv2/opencv.hpp>
  15. // OpenCV Libraries
  16. #include <opencv/cxcore.h>
  17. #include <opencv/highgui.h>
  18. #include "opencv2/highgui/highgui.hpp"
  19. #include <opencv2/video/tracking.hpp>
  20. #include "opencv2/imgproc/imgproc.hpp"
  21. #include <opencv2/objdetect/objdetect.hpp>
  22. #include <opencv2/features2d/features2d.hpp>
  23.  
  24. // OpenARK Libraries
  25. #include "DepthCamera.h"
  26.  
  27.  
  28. /**
  29. * Class defining the behavior of an SR300 Camera.
  30. * Example on how to read from sensor and visualize its output
  31. * @include SensorIO.cpp
  32. */
  33. class SR300Camera : public DepthCamera
  34. {
  35. public:
  36.  
  37.    
  38.  
  39.     /**
  40.     * Public constructor initializing the SR300 Camera.
  41.     * @param use_live_sensor uses input from real sensor if TRUE. Otherwise reads from input file. Default is set to TRUE.
  42.     */
  43.  
  44.  
  45.     SR300Camera(bool use_live_sensor = true);
  46.  
  47.     /**
  48.     * Deconstructor for the SR300 Camera.
  49.     */
  50.     ~SR300Camera();
  51.  
  52.  
  53.  
  54.     /**
  55.     * Gets new frame from sensor.
  56.     * Updates xyzMap, ampMap, and flagMap. Resets clusters.
  57.     */
  58.     void update();
  59.  
  60.     /**
  61.     * Gracefully closes the SR300 camera.
  62.     */
  63.     void destroyInstance();
  64.  
  65. private:
  66.     /**
  67.     * Getter method for the x-coordinate at (i,j).
  68.     * @param i ith row
  69.     * @param j jth column
  70.     * @return x-coodinate at (i,j)
  71.     */
  72.     //void getXYZbuffer();
  73.  
  74.     float getX(int i, int j) const;
  75.  
  76.  
  77.     /**
  78.     * Getter method for the x-coordinate at (i,j).
  79.     * @param i ith row
  80.     * @param j jth column
  81.     * @return x-coodinate at (i,j)
  82.     */
  83.     float getY(int i, int j) const;
  84.  
  85.     /**
  86.     * Getter method for the x-coordinate at (i,j).
  87.     * @param i ith row
  88.     * @param j jth column
  89.     * @return x-coodinate at (i,j)
  90.     */
  91.     float getZ(int i, int j) const;
  92.  
  93.     /**
  94.     * Update the z-coordinates of the xyzMap.
  95.     */
  96. //  void fillInZCoords();
  97.  
  98.     /**
  99.     * Update the values in the ampMap.
  100.     */
  101.     void fillInAmps();
  102.  
  103.  
  104.  
  105.     /**
  106.     * Convert the depth coordinates to world coordinates
  107.     */
  108.     //void DepthToWorld(Image *depth, vector<PointF32> dcords, vector<PointF32> &wcords) const;
  109.  
  110.  
  111.  
  112.     //Private Variable
  113.     const char* SOURCE_PLUGIN = "camboardpico";
  114.     const char* SOURCE_PARAM = "";
  115.     const char* PROC_PLUGIN = "camboardpicoproc";
  116.     const char* PROC_PARAM = "";
  117.  
  118.     //SR300handle hnd;
  119.     //SR300DataDescription dd;
  120.     char err[128]; // Char array for storing PMD's error log
  121.  
  122.     int numPixels;
  123.     float* dists;
  124.     float* amps;
  125.  
  126.     IplImage * frame;
  127.     cv::KalmanFilter KF;
  128.     cv::Mat_<float> measurement;
  129.  
  130.  
  131.  
  132. };
  133.  
  134.  
  135.  
  136.  
  137. /*
  138. * \include SensorIO.cpp
  139. * Example of how to read from sensor
  140. */
Add Comment
Please, Sign In to add comment