Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00058
00059
00060 #ifndef __IPA_AVTPIKECAM_H__
00061 #define __IPA_AVTPIKECAM_H__
00062
00063 #include "StdAfx.h"
00064
00065 #ifdef __LINUX__
00066 #include "cob_camera_sensors/AbstractColorCamera.h"
00067 #else
00068 #include "cob_driver/cob_camera_sensors/common/include/cob_camera_sensors/AbstractColorCamera.h"
00069 #endif
00070
00071 #include <cstdlib>
00072
00073 #ifdef _WIN32
00074 #include <fgcamera.h>
00075 #ifdef __MINGW__
00076 typedef unsigned char UINT8;
00077 #endif
00078 #endif
00079
00080 #define UINT8P_CAST(x) reinterpret_cast<UINT8*>(x)
00081
00082 #ifdef __LINUX__
00083 #include <dc1394/dc1394.h>
00084 typedef struct
00085 {
00086 unsigned long Low;
00087 unsigned long High;
00088 }UINT32HL;
00089 #define UINT32 unsigned long
00090 #define _UINT32HL
00091 #endif
00092
00093 #ifdef SWIG
00094 %module Sensors
00095 %include "Source/Vision/CameraSensors/AbstractColorCamera.h"
00096
00097 %{
00098 #include "AVTPikeCam.h"
00099 %}
00100 #endif
00101
00102 using namespace std;
00103
00104 namespace ipa_CameraSensors {
00105
00109 class __DLL_LIBCAMERASENSORS__ AVTPikeCam : public AbstractColorCamera
00110 {
00116 class AVTPikeCamDeleter
00117 {
00118 public:
00119 ~AVTPikeCamDeleter()
00120 {
00121 #ifndef __LINUX__
00122 FGExitModule();
00123 #endif
00124 };
00125 };
00126
00127 private:
00129 bool m_operationMode_B;
00130 UINT32HL m_GUID;
00131 static bool m_OpenExecuted;
00132 static AVTPikeCamDeleter m_Deleter;
00133
00134 #ifdef __LINUX__
00135 dc1394video_frame_t* m_Frame;
00136 dc1394_t* m_IEEE1394Info;
00137 dc1394camera_list_t* m_IEEE1394Cameras;
00138 dc1394camera_t* m_cam;
00139 dc1394video_modes_t m_availableVideoModes;
00140
00141 dc1394speed_t m_IsoSpeed;
00142 dc1394framerate_t m_FrameRate;
00143 dc1394video_mode_t m_VideoMode;
00144 dc1394color_coding_t m_ColorCoding;
00145 #endif
00146
00147 #ifdef _WIN32
00148 CFGCamera m_cam;
00149 FGNODEINFO m_nodeInfo[5];
00150 UINT32 m_NodeCnt;
00151 FGFRAME m_Frame;
00152 #endif
00153
00154
00155
00156
00157
00158 unsigned long LoadParameters(const char* filename, int cameraIndex);
00159
00163 unsigned long SetParameters();
00164
00165 public:
00166
00168 AVTPikeCam ();
00170 ~AVTPikeCam ();
00171
00172
00173
00174
00175
00176 unsigned long Init(std::string directory, int cameraIndex = 0);
00177
00178 unsigned long Open();
00179 unsigned long Close();
00180
00181 unsigned long GetColorImage(char* colorImageData, bool getLatestFrame);
00182 unsigned long GetColorImage(cv::Mat* colorImage, bool getLatestFrame);
00183
00184 unsigned long SaveParameters(const char* filename);
00185
00201 unsigned long SetProperty(t_cameraProperty* cameraProperty);
00202 unsigned long SetPropertyDefaults();
00203 unsigned long GetProperty(t_cameraProperty* cameraProperty);
00204
00207 unsigned long PrintCameraInformation();
00208 unsigned long TestCamera(const char* filename);
00209
00210
00211
00212
00213
00214 };
00215
00218 __DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_AVTPikeCam();
00219
00220 }
00221
00222 #endif //__IPA_AVTPIKECAM_H__
00223
00224