lamiastella

SR300Camera.h

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