AbstractColorCamera.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_ABSTRACTCOLORCAMERA_H__
24 #define __IPA_ABSTRACTCOLORCAMERA_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 <boost/shared_ptr.hpp>
37 #include <sstream>
38 #include <opencv/cv.h>
39 
40 namespace ipa_CameraSensors {
41 
45 
51 {
52  public:
53 
57  {
59  std::stringstream m_VideoFormat;
60  std::stringstream m_VideoMode;
61  std::stringstream m_ColorMode;
62  std::stringstream m_IsoSpeed;
63  std::stringstream m_FrameRate;
64  std::stringstream m_Shutter;
65  std::stringstream m_WhiteBalanceU;
66  std::stringstream m_WhiteBalanceV;
67  std::stringstream m_Hue;
68  std::stringstream m_Saturation;
69  std::stringstream m_Gamma;
70  std::stringstream m_ExposureTime;
71  std::stringstream m_Gain;
72  std::stringstream m_Brightness;
73  std::stringstream m_ImageWidth;
74  std::stringstream m_ImageHeight;
75  std::stringstream m_Interface;
76  std::stringstream m_IP;
77  };
78 
86  virtual unsigned long Init(std::string directory, int cameraIndex = 0) =0;
87 
90  virtual bool isInitialized() {return m_initialized;}
91 
94  virtual bool isOpen() {return m_open;}
95 
100  virtual unsigned long Open() =0;
101 
104  virtual unsigned long Close() =0; //Save intrinsic params back to File
105 
111  unsigned long GetColorImage(char* colorImageData, bool getLatestFrame=true) {return RET_FAILED;}
112 
120  virtual unsigned long GetColorImage(cv::Mat* colorImage, bool getLatestFrame=true)=0;
121 
124  virtual t_cameraType GetCameraType();
125 
130  virtual unsigned long SetProperty(t_cameraProperty* cameraProperty) =0;
131 
134  virtual unsigned long SetPropertyDefaults() =0;
135 
140  virtual unsigned long GetProperty(t_cameraProperty* cameraProperty) =0;
141 
145  virtual unsigned long PrintCameraInformation() =0;
146 
150  virtual unsigned long SaveParameters(const char* filename)=0;
151 
157  virtual unsigned long TestCamera(const char* filename);
158 
161  virtual int GetNumberOfImages() {return std::numeric_limits<int>::max();};
162 
167  virtual unsigned long SetPathToImages(std::string path) {return RET_OK;};
168 
170  virtual ~AbstractColorCamera();
171 
172  protected:
173 
175  bool m_open;
176 
178 
180 
181  unsigned int m_BufferSize;
182  private:
183 
188  virtual unsigned long LoadParameters(const char* filename, int cameraIndex)=0;
189 
192  virtual unsigned long SetParameters()=0;
193 
194 };
195 
199 __DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_ICCam();
200 __DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_AxisCam();
203 
204 
205 } // end namespace
206 #endif // __IPA_ABSTRACTCOLORCAMERA_H__
virtual unsigned long SetPathToImages(std::string path)
__DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_OpenCVCamera()
unsigned long GetColorImage(char *colorImageData, bool getLatestFrame=true)
boost::shared_ptr< AbstractColorCamera > AbstractColorCameraPtr
t_ColorCameraParameters m_ColorCameraParameters
Storage for xml configuration file data.
ipa_CameraSensors::t_cameraRole m_CameraRole
Master or slave camera.
std::stringstream m_ColorMode
Mono8/16S/16, YUV411/422, Raw16, RGB8, ...
std::stringstream m_Interface
Interface, the camera is connected to (i.e. USB, ETHERNET or FIREWIRE)
std::stringstream m_IsoSpeed
Guaranteed speed of isochronous transfer rate.
bool m_initialized
True, when the camera has sucessfully been initialized.
__DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_VirtualCam()
__DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_ICCam()
__DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_AxisCam()
bool m_open
True, when the camera has sucessfully been opend.
unsigned int m_BufferSize
Number of images, the camera buffers internally.
__DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_AVTPikeCam()
Definition: AVTPikeCam.cpp:36
#define __DLL_LIBCAMERASENSORS__


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