AbstractRangeImagingSensor.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
22 
23 #ifndef __IPA_ABSTRACTRANGEIMAGINGSENSOR_H__
24 #define __IPA_ABSTRACTRANGEIMAGINGSENSOR_H__
25 
26 #include "StdAfx.h"
27 
28 #ifdef __LINUX__
31 #else
32  #include "cob_common/cob_vision_utils/common/include/cob_vision_utils/CameraSensorDefines.h"
33  #include "cob_common/cob_vision_utils/common/include/cob_vision_utils/CameraSensorTypes.h"
34 #endif
35 
36 #include <opencv/cv.h>
37 
38 #include <iostream>
39 #include <limits>
40 #include <vector>
41 
42 #include <boost/shared_ptr.hpp>
43 
44 namespace ipa_CameraSensors {
45 
49 
53 {
54 public:
55 
59  {
61  std::stringstream m_AmplitudeThreshold;
62  std::stringstream m_IntegrationTime;
64  std::stringstream m_ModulationFrequency;
65  std::stringstream m_AcquireMode;
66  std::stringstream m_ExposureMode;
67  std::stringstream m_DistanceOffset;
68  std::stringstream m_ROI;
69  std::stringstream m_LensCalibration;
70 
71  std::stringstream m_Interface;
72  std::stringstream m_IP;
73  };
74 
76  virtual ~AbstractRangeImagingSensor();
77 
83  virtual unsigned long Init(std::string directory, int cameraIndex = 0) = 0;
84 
89  virtual unsigned long Open() = 0;
90 
93  virtual unsigned long Close() = 0;
94 
99  virtual unsigned long SetProperty(t_cameraProperty* cameraProperty) =0;
100 
103  virtual unsigned long SetPropertyDefaults() =0;
104 
109  virtual unsigned long GetProperty(t_cameraProperty* cameraProperty) =0;
110 
121  virtual unsigned long AcquireImages(cv::Mat* rangeImage = 0, cv::Mat* intensityImage = 0,
122  cv::Mat* cartesianImage = 0, bool getLatestFrame=true, bool undistort=true,
123  ipa_CameraSensors::t_ToFGrayImageType grayImageType = ipa_CameraSensors::INTENSITY_32F1) = 0;
124 
137  virtual unsigned long AcquireImages(int widthStepRange, int widthStepGray, int widthStepCartesian, char* rangeImage=NULL, char* grayImage=NULL,
138  char* cartesianImage=NULL, bool getLatestFrame=true, bool undistort=true,
139  ipa_CameraSensors::t_ToFGrayImageType grayImageType = ipa_CameraSensors::INTENSITY_32F1) = 0;
140 
145  virtual unsigned long SaveParameters(const char* filename) = 0;
146 
149  virtual bool isInitialized() = 0;
150 
153  virtual bool isOpen() = 0;
154 
158  virtual t_CalibrationMethod GetCalibrationMethod() {return m_CalibrationMethod;}
159 
162  virtual t_cameraType GetCameraType() {return m_CameraType;}
163 
172  virtual unsigned long SetIntrinsics(cv::Mat& intrinsicMatrix,
173  cv::Mat& undistortMapX, cv::Mat& undistortMapY);
174 
177  virtual int GetNumberOfImages() {return std::numeric_limits<int>::max();};
178 
183  virtual unsigned long SetPathToImages(std::string path);
184 
185  unsigned int m_ImageCounter;
186 
187 protected:
188 
192 
194  bool m_open;
195 
196  unsigned int m_BufferSize;
197 
199  cv::Mat m_undistortMapX;
200  cv::Mat m_undistortMapY;
201 
202 private:
203 
209  virtual unsigned long LoadParameters(const char* filename, int cameraIndex) = 0;
210 };
211 
214 __DLL_LIBCAMERASENSORS__ AbstractRangeImagingSensorPtr CreateRangeImagingSensor_VirtualCam();
215 __DLL_LIBCAMERASENSORS__ AbstractRangeImagingSensorPtr CreateRangeImagingSensor_Swissranger();
216 __DLL_LIBCAMERASENSORS__ AbstractRangeImagingSensorPtr CreateRangeImagingSensor_PMDCam();
217 __DLL_LIBCAMERASENSORS__ AbstractRangeImagingSensorPtr CreateRangeImagingSensor_Kinect();
218 
219 } // end namespace ipa_CameraSensors
220 #endif // __IPA_ABSTRACTRANGEIMAGINGSENSOR_H__
221 
cv::Mat m_intrinsicMatrix
Intrinsic parameters [fx 0 cx; 0 fy cy; 0 0 1].
t_CalibrationMethod m_CalibrationMethod
Calibration method MATLAB, MATLAB_NO_Z or SWISSRANGER.
std::stringstream m_DistanceOffset
Distance offset added to each distance value.
std::stringstream m_LensCalibration
Apply lens calibration from manufacturer.
ipa_CameraSensors::t_cameraRole m_CameraRole
Master or slave camera.
__DLL_LIBCAMERASENSORS__ AbstractRangeImagingSensorPtr CreateRangeImagingSensor_VirtualCam()
__DLL_LIBCAMERASENSORS__ AbstractRangeImagingSensorPtr CreateRangeImagingSensor_PMDCam()
std::stringstream m_AmplitudeThreshold
their amplitude is lower than the amplitude threshold
unsigned int m_BufferSize
Number of images, the camera buffers internally.
boost::shared_ptr< AbstractRangeImagingSensor > AbstractRangeImagingSensorPtr
cv::Mat m_undistortMapX
The output array of x coordinates for the undistortion map.
unsigned int m_ImageCounter
Holds the index of the image that is extracted during the next call of AcquireImages ...
cv::Mat m_undistortMapY
The output array of Y coordinates for the undistortion map.
bool m_initialized
True, when the camera has sucessfully been initialized.
__DLL_LIBCAMERASENSORS__ AbstractRangeImagingSensorPtr CreateRangeImagingSensor_Kinect()
std::stringstream m_ModulationFrequency
Modulation Frequency. The higher the frequency, the lower the measurable distance.
__DLL_LIBCAMERASENSORS__ AbstractRangeImagingSensorPtr CreateRangeImagingSensor_Swissranger()
Definition: Swissranger.cpp:31
t_RangeCameraParameters m_RangeCameraParameters
Storage for xml configuration file parmeters.
std::stringstream m_Interface
Interface, the camera is connected to (i.e. USB or ETHERNET)
#define __DLL_LIBCAMERASENSORS__
bool m_open
True, when the camera has sucessfully been opend.


cob_camera_sensors
Author(s): Jan Fischer , Richard Bormann
autogenerated on Thu Mar 19 2020 03:23:05