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
00054
00055
00056 #ifndef _LINUX_1394_CAPTURE_2_H_
00057 #define _LINUX_1394_CAPTURE_2_H_
00058
00059
00060
00061
00062
00063
00064 #include "Interfaces/VideoCaptureInterface.h"
00065 #include "Image/ImageProcessor.h"
00066 #include <string>
00067 #include <vector>
00068
00069 #include <libraw1394/raw1394.h>
00070 #include <dc1394/dc1394.h>
00071
00072
00073
00074
00075
00076
00077 class CByteImage;
00078
00079
00080
00081
00082
00083
00084
00085 #define MAX_CAMERAS 4
00086
00087 #define MAX_S400_BANDWIDTH 4915
00088
00089
00090
00091
00092
00093
00094
00095 class CLinux1394Capture2 : public CVideoCaptureInterface
00096 {
00097 public:
00098
00099 CLinux1394Capture2(int nCameras, VideoMode mode, ColorMode colorMode, ImageProcessor::BayerPatternType bayerPatternType = ImageProcessor::eBayerRG, FrameRate frameRate = e30fps);
00100 CLinux1394Capture2(VideoMode mode, ColorMode colorMode, ImageProcessor::BayerPatternType bayerPatternType = ImageProcessor::eBayerRG, FrameRate frameRate = e30fps, int nNumberUIDs = 0, ...);
00101
00102
00103 CLinux1394Capture2(int nCameras, VideoMode mode, float fFormat7FrameRate = 30.0f, int nFormat7MinX = 0, int nFormat7MinY = 0, int nFormat7Width = -1, int nFormat7Height = -1, ColorMode colorMode = CVideoCaptureInterface::eBayerPatternToRGB24, ImageProcessor::BayerPatternType bayerPatternType = ImageProcessor::eBayerRG);
00104
00105 CLinux1394Capture2(VideoMode mode, float fFormat7FrameRate = 30.0f, int nFormat7MinX = 0, int nFormat7MinY = 0, int nFormat7Width = -1, int nFormat7Height = -1, ColorMode colorMode = CVideoCaptureInterface::eBayerPatternToRGB24, ImageProcessor::BayerPatternType bayerPatternType = ImageProcessor::eBayerRG, int nNumberUIDs = 0, ...);
00106
00107
00108
00109 ~CLinux1394Capture2();
00110
00111
00112
00113 bool OpenCamera();
00114 void CloseCamera();
00115 bool CaptureImage(CByteImage **ppImages);
00116 bool CaptureBayerPatternImage(CByteImage **ppImages);
00117
00118
00119 void SetCameraUids(std::vector<std::string> uids);
00120 void SetGain(int nValue);
00121 void SetExposure(int nValue);
00122 void SetShutter(int nValue);
00123 void SetWhiteBalance(int nU, int nV, int nCamera = -1);
00124 void SetTemperature(int nTemperature);
00125 void SetFeature(dc1394feature_t feature, std::string sName, int nValue);
00126
00127 void ListFeatures();
00128
00129 int GetWidth() { return width; }
00130 int GetHeight() { return height; }
00131 CByteImage::ImageType GetType();
00132 int GetNumberOfCameras() { return m_nCameras; }
00133
00134 dc1394camera_t* GetCameraHandle(int Index) { return m_cameras[Index]; }
00135
00136 VideoMode GetVideoMode() const {return m_mode;}
00137 FrameRate GetFrameRate() const {return m_frameRate;}
00138
00139 protected:
00140
00141 void InitFirstInstance();
00142 void ExitLastInstance();
00143 void ResetAllCameras();
00144
00145 bool OpenCamera(int nCamera);
00146 bool InitCameraMode();
00147 dc1394framerate_t GetDCFrameRateMode(FrameRate frameRate);
00148
00149
00150 void ConvertYUV411(CByteImage* pInput, CByteImage* pOutput);
00151 void YUVToRGB(int y, int u, int v, unsigned char* output);
00152
00153
00154 bool ListCameras();
00155 std::string CamUIDToString(uint64_t uid);
00156
00157
00158
00159 CByteImage *m_pTempImageHeader;
00160
00161 int m_nMode;
00162
00163 int width;
00164 int height;
00165
00166
00167 int m_nCameras;
00168
00169 const VideoMode m_mode;
00170
00171 const ColorMode m_colorMode;
00172
00173 FrameRate m_frameRate;
00174
00175 const ImageProcessor::BayerPatternType m_bayerPatternType;
00176
00177 std::string m_sCameraUID[MAX_CAMERAS];
00178 bool m_bUseUIDs;
00179
00180 int m_nOpenedCameras[MAX_CAMERAS];
00181
00182 dc1394video_mode_t m_video_mode;
00183
00184 bool m_bFormat7Mode;
00185 float m_fFormat7FrameRate;
00186 int m_nFormat7MinX;
00187 int m_nFormat7MinY;
00188 int m_nFormat7Width;
00189 int m_nFormat7Height;
00190
00191
00192
00193 static dc1394_t* m_pDC1394;
00194 static dc1394camera_t* m_cameras[MAX_CAMERAS];
00195
00196
00197 static int m_nOverallCameras;
00198 static int m_nRemainingBandwidth;
00199 static CLinux1394Capture2 *m_pCameraOpener[MAX_CAMERAS];
00200 static int m_nCameraBandwidth[MAX_CAMERAS];
00201
00202
00203 static int m_nInstances;
00204 };
00205
00206
00207
00208 #endif
asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Thu Jun 6 2019 21:46:57