Subversion Repositories seema-scanner

Rev

Rev 157 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 157 Rev 205
1
#include "CameraPointGrey.h"
1
#include "CameraPointGrey.h"
2
#include <cstring>
2
#include <cstring>
3
 
3
 
4
//#include <sys/ioctl.h>
4
//#include <sys/ioctl.h>
5
//#include <linux/usbdevice_fs.h>
5
//#include <linux/usbdevice_fs.h>
6
 
6
 
7
void PrintError(FlyCapture2::Error error){
7
void PrintError(FlyCapture2::Error error){
8
    error.PrintErrorTrace();
8
    error.PrintErrorTrace();
9
}
9
}
10
 
10
 
11
vector<CameraInfo> CameraPointGrey::getCameraList(){
11
vector<CameraInfo> CameraPointGrey::getCameraList(){
12
    
12
    
13
    FlyCapture2::Error error;
13
    FlyCapture2::Error error;
14
 
14
 
15
    FlyCapture2::BusManager busManager;
15
    FlyCapture2::BusManager busManager;
16
    unsigned int numCameras;
16
    unsigned int numCameras;
17
    error = busManager.GetNumOfCameras(&numCameras);
17
    error = busManager.GetNumOfCameras(&numCameras);
18
 
18
 
19
    vector<CameraInfo> ret;
19
    vector<CameraInfo> ret;
20
 
20
 
21
    if (error != FlyCapture2::PGRERROR_OK){
21
    if (error != FlyCapture2::PGRERROR_OK){
22
        PrintError(error);
22
        PrintError(error);
23
        return ret;
23
        return ret;
24
    }
24
    }
25
 
25
 
26
    for (unsigned int i=0; i < numCameras; i++){
26
    for (unsigned int i=0; i < numCameras; i++){
27
        FlyCapture2::PGRGuid guid;
27
        FlyCapture2::PGRGuid guid;
28
        error = busManager.GetCameraFromIndex(i, &guid);
28
        error = busManager.GetCameraFromIndex(i, &guid);
29
        if (error != FlyCapture2::PGRERROR_OK)
29
        if (error != FlyCapture2::PGRERROR_OK)
30
            PrintError(error);
30
            PrintError(error);
31
 
31
 
32
        // Connect to camera
32
        // Connect to camera
33
        FlyCapture2::Camera cam;
33
        FlyCapture2::Camera cam;
34
        error = cam.Connect(&guid);
34
        error = cam.Connect(&guid);
35
        if (error != FlyCapture2::PGRERROR_OK)
35
        if (error != FlyCapture2::PGRERROR_OK)
36
            PrintError( error );
36
            PrintError( error );
37
 
37
 
38
        // Get camera information
38
        // Get camera information
39
        FlyCapture2::CameraInfo camInfo;
39
        FlyCapture2::CameraInfo camInfo;
40
        error = cam.GetCameraInfo(&camInfo);
40
        error = cam.GetCameraInfo(&camInfo);
41
        if (error != FlyCapture2::PGRERROR_OK)
41
        if (error != FlyCapture2::PGRERROR_OK)
42
            PrintError( error );
42
            PrintError( error );
43
 
43
 
44
        CameraInfo camera;
44
        CameraInfo camera;
45
        camera.vendor = "Point Grey";
45
        camera.vendor = "Point Grey";
46
        camera.model = camInfo.modelName;
46
        camera.model = camInfo.modelName;
47
        camera.busID = camInfo.nodeNumber;
47
        camera.busID = camInfo.nodeNumber;
48
        camera.serialNumber = camInfo.serialNumber;
48
        camera.serialNumber = camInfo.serialNumber;
49
 
49
 
50
        ret.push_back(camera);
50
        ret.push_back(camera);
51
    }
51
    }
52
 
52
 
53
    return ret;
53
    return ret;
54
}
54
}
55
 
55
 
56
CameraPointGrey::CameraPointGrey(unsigned int camNum, CameraTriggerMode triggerMode) : Camera(triggerMode){
56
CameraPointGrey::CameraPointGrey(unsigned int camNum, CameraTriggerMode triggerMode) : Camera(triggerMode){
57
 
57
 
58
//    // Reset USB bus
58
//    // Reset USB bus
59
//    std::cout << "Resetting USB device %s\n";
59
//    std::cout << "Resetting USB device %s\n";
60
//    int rc = ioctl(fd, USBDEVFS_RESET, 0);
60
//    int rc = ioctl(fd, USBDEVFS_RESET, 0);
61
//    if (rc < 0)
61
//    if (rc < 0)
62
//        perror("Error in ioctl");
62
//        perror("Error in ioctl");
63
//    else
63
//    else
64
//        printf("Reset successful\n");
64
//        printf("Reset successful\n");
65
 
65
 
66
 
66
 
67
    FlyCapture2::Error error;
67
    FlyCapture2::Error error;
68
 
68
 
69
    // Connect to camera
69
    // Connect to camera
70
    FlyCapture2::BusManager busManager;
70
    FlyCapture2::BusManager busManager;
71
 
71
 
72
    FlyCapture2::PGRGuid camGuid;
72
    FlyCapture2::PGRGuid camGuid;
73
 
73
 
74
    busManager.GetCameraFromIndex(camNum, &camGuid);
74
    busManager.GetCameraFromIndex(camNum, &camGuid);
75
    error = cam.Connect(&camGuid);
75
    error = cam.Connect(&camGuid);
76
    if (error != FlyCapture2::PGRERROR_OK)
76
    if (error != FlyCapture2::PGRERROR_OK)
77
        PrintError(error);
77
        PrintError(error);
78
 
78
 
79
//    // Configure DCAM video mode and frame rate
79
//    // Configure DCAM video mode and frame rate
80
//    FlyCapture2::VideoMode videoMode = FlyCapture2::VIDEOMODE_1280x960Y8;
80
//    FlyCapture2::VideoMode videoMode = FlyCapture2::VIDEOMODE_1280x960Y8;
81
//    FlyCapture2::FrameRate frameRate = FlyCapture2::FRAMERATE_7_5;
81
//    FlyCapture2::FrameRate frameRate = FlyCapture2::FRAMERATE_7_5;
82
//    error = cam.SetVideoModeAndFrameRate(videoMode, frameRate);
82
//    error = cam.SetVideoModeAndFrameRate(videoMode, frameRate);
83
//    if (error != FlyCapture2::PGRERROR_OK)
83
//    if (error != FlyCapture2::PGRERROR_OK)
84
//        PrintError(error);
84
//        PrintError(error);
85
 
85
 
86
    // Configure Format7 mode
86
    // Configure Format7 mode
87
    FlyCapture2::Format7ImageSettings format7Settings;
87
    FlyCapture2::Format7ImageSettings format7Settings;
88
    format7Settings.mode = FlyCapture2::MODE_0;
88
    format7Settings.mode = FlyCapture2::MODE_0;
89
    format7Settings.pixelFormat = FlyCapture2::PIXEL_FORMAT_RAW8;
89
    format7Settings.pixelFormat = FlyCapture2::PIXEL_FORMAT_RAW8;
90
    format7Settings.width = 3376;
90
    format7Settings.width = 3376;
91
    format7Settings.height = 2704;
91
    format7Settings.height = 2704;
92
    format7Settings.offsetX = 0;
92
    format7Settings.offsetX = 0;
93
    format7Settings.offsetY = 0;
93
    format7Settings.offsetY = 0;
94
 
94
 
95
//    format7Settings.width = 2496;
95
//    format7Settings.width = 2496;
96
//    format7Settings.height = 1888;
96
//    format7Settings.height = 1888;
97
//    format7Settings.offsetX = (3376-2496)/2;
97
//    format7Settings.offsetX = (3376-2496)/2;
98
//    format7Settings.offsetY = (2704-1888)/2;
98
//    format7Settings.offsetY = (2704-1888)/2;
99
 
99
 
100
    // Validate and set mode
100
    // Validate and set mode
101
    FlyCapture2::Format7PacketInfo packetInfo;
101
    FlyCapture2::Format7PacketInfo packetInfo;
102
    bool valid;
102
    bool valid;
103
    error = cam.ValidateFormat7Settings(&format7Settings, &valid, &packetInfo);
103
    error = cam.ValidateFormat7Settings(&format7Settings, &valid, &packetInfo);
104
    if (error != FlyCapture2::PGRERROR_OK)
104
    if (error != FlyCapture2::PGRERROR_OK)
105
        PrintError(error);
105
        PrintError(error);
106
    // packetsize configures maximum frame rate
106
    // packetsize configures maximum frame rate
107
    error = cam.SetFormat7Configuration(&format7Settings, packetInfo.recommendedBytesPerPacket);
107
    error = cam.SetFormat7Configuration(&format7Settings, packetInfo.recommendedBytesPerPacket);
108
    if (error != FlyCapture2::PGRERROR_OK)
108
    if (error != FlyCapture2::PGRERROR_OK)
109
        PrintError(error);
109
        PrintError(error);
110
 
110
 
111
    // Configure general
111
    // Configure general
112
    FlyCapture2::FC2Config config;
112
    FlyCapture2::FC2Config config;
113
    config.numBuffers = 5;
113
    config.numBuffers = 5;
114
    config.grabTimeout = 1000; // retrieveBuffer() timeout in ms
114
    config.grabTimeout = 1000; // retrieveBuffer() timeout in ms
115
    config.grabMode = FlyCapture2::DROP_FRAMES;
115
    config.grabMode = FlyCapture2::DROP_FRAMES;
116
    config.isochBusSpeed = FlyCapture2::BUSSPEED_S_FASTEST;
116
    config.isochBusSpeed = FlyCapture2::BUSSPEED_S_FASTEST;
117
    config.highPerformanceRetrieveBuffer = true;
117
    config.highPerformanceRetrieveBuffer = true;
118
    //config.asyncBusSpeed = FlyCapture2::BUSSPEED_S_FASTEST;
118
    //config.asyncBusSpeed = FlyCapture2::BUSSPEED_S_FASTEST;
119
    error = cam.SetConfiguration(&config);
119
    error = cam.SetConfiguration(&config);
120
    if (error != FlyCapture2::PGRERROR_OK)
120
    if (error != FlyCapture2::PGRERROR_OK)
121
        PrintError(error);
121
        PrintError(error);
122
 
122
 
123
 
123
 
124
    // Get the camera information
124
    // Get the camera information
125
    FlyCapture2::CameraInfo camInfo;
125
    FlyCapture2::CameraInfo camInfo;
126
    error = cam.GetCameraInfo(&camInfo);
126
    error = cam.GetCameraInfo(&camInfo);
127
    if (error != FlyCapture2::PGRERROR_OK)
127
    if (error != FlyCapture2::PGRERROR_OK)
128
        PrintError(error);
128
        PrintError(error);
129
 
129
 
130
    std::cout << camInfo.vendorName << "  " << camInfo.modelName << "  " << camInfo.serialNumber << std::endl;
130
    std::cout << camInfo.vendorName << "  " << camInfo.modelName << "  " << camInfo.serialNumber << std::endl;
131
 
131
 
132
    // Turn off auto settings
132
    // Turn off auto settings
133
    FlyCapture2::Property property;
133
    FlyCapture2::Property property;
134
    property.type = FlyCapture2::AUTO_EXPOSURE;
134
    property.type = FlyCapture2::AUTO_EXPOSURE;
135
    property.onOff = false;
135
    property.onOff = false;
136
    error = cam.SetProperty(&property);
136
    error = cam.SetProperty(&property);
137
    if (error != FlyCapture2::PGRERROR_OK)
137
    if (error != FlyCapture2::PGRERROR_OK)
138
        PrintError(error);
138
        PrintError(error);
139
 
139
 
140
    property.type = FlyCapture2::GAMMA;
140
    property.type = FlyCapture2::GAMMA;
141
    property.onOff = true;
141
    property.onOff = true;
142
    property.absControl = true;
142
    property.absControl = true;
143
    property.absValue = 1.0;
143
    property.absValue = 1.0;
144
    error = cam.SetProperty(&property);
144
    error = cam.SetProperty(&property);
145
    if (error != FlyCapture2::PGRERROR_OK)
145
    if (error != FlyCapture2::PGRERROR_OK)
146
        PrintError(error);
146
        PrintError(error);
147
 
147
 
148
    // Set frame rate to 6
148
    // Set frame rate to 6
149
    property.type = FlyCapture2::FRAME_RATE;
149
    property.type = FlyCapture2::FRAME_RATE;
150
    property.onOff = true;
150
    property.onOff = true;
151
    property.absControl = true;
151
    property.absControl = true;
152
    property.autoManualMode = false;
152
    property.autoManualMode = false;
153
    property.absValue = 6.0;
153
    property.absValue = 6.0;
154
    error = cam.SetProperty(&property);
154
    error = cam.SetProperty(&property);
155
    if (error != FlyCapture2::PGRERROR_OK)
155
    if (error != FlyCapture2::PGRERROR_OK)
156
        PrintError(error);
156
        PrintError(error);
157
 
157
 
158
    // Set white balance to match LED projector light
158
    // Set white balance to match LED projector light
159
    property.type = FlyCapture2::WHITE_BALANCE;
159
    property.type = FlyCapture2::WHITE_BALANCE;
160
    property.onOff = true;
160
    property.onOff = true;
161
    property.absControl = false;
161
    property.absControl = false;
162
    property.autoManualMode = false;
162
    property.autoManualMode = false;
163
    property.valueA = 666; //red
163
    property.valueA = 666; //red
164
    property.valueB = 777; //blue
164
    property.valueB = 777; //blue
165
    error = cam.SetProperty(&property);
165
    error = cam.SetProperty(&property);
166
    if (error != FlyCapture2::PGRERROR_OK)
166
    if (error != FlyCapture2::PGRERROR_OK)
167
        PrintError(error);
167
        PrintError(error);
168
 
168
 
169
    // Set reasonable default settings
169
    // Set reasonable default settings
170
    CameraSettings settings;
170
    CameraSettings settings;
171
    //settings.shutter = 8.33;
171
    //settings.shutter = 8.33;
172
    settings.shutter = 66.66;
172
    settings.shutter = 66.66;
173
    settings.gain = 0.0;
173
    settings.gain = 0.0;
174
    this->setCameraSettings(settings);
174
    this->setCameraSettings(settings);
175
 
175
 
176
    return;
176
    return;
177
}
177
}
178
 
178
 
179
CameraSettings CameraPointGrey::getCameraSettings(){
179
CameraSettings CameraPointGrey::getCameraSettings(){
180
 
180
 
181
    FlyCapture2::Property property;
181
    FlyCapture2::Property property;
182
 
182
 
183
    // Get settings:
183
    // Get settings:
184
    CameraSettings settings;
184
    CameraSettings settings;
185
 
185
 
186
    property.type = FlyCapture2::SHUTTER;
186
    property.type = FlyCapture2::SHUTTER;
187
    cam.GetProperty(&property);
187
    cam.GetProperty(&property);
188
    settings.shutter = property.absValue;
188
    settings.shutter = property.absValue;
189
 
189
 
190
    property.type = FlyCapture2::GAIN;
190
    property.type = FlyCapture2::GAIN;
191
    cam.GetProperty(&property);
191
    cam.GetProperty(&property);
192
    settings.gain = property.absValue;
192
    settings.gain = property.absValue;
193
 
193
 
194
    return settings;
194
    return settings;
195
}
195
}
196
 
196
 
197
void CameraPointGrey::setCameraSettings(CameraSettings settings){
197
void CameraPointGrey::setCameraSettings(CameraSettings settings){
198
 
198
 
199
    FlyCapture2::Property property;
199
    FlyCapture2::Property property;
200
    property.onOff = true;
200
    property.onOff = true;
201
    property.absControl = true;
201
    property.absControl = true;
202
 
202
 
203
    property.type = FlyCapture2::SHUTTER;
203
    property.type = FlyCapture2::SHUTTER;
204
    property.absValue = settings.shutter;
204
    property.absValue = settings.shutter;
205
    cam.SetProperty(&property);
205
    cam.SetProperty(&property);
206
 
206
 
207
    property.type = FlyCapture2::GAIN;
207
    property.type = FlyCapture2::GAIN;
208
    property.absValue = settings.gain;
208
    property.absValue = settings.gain;
209
    cam.SetProperty(&property);
209
    cam.SetProperty(&property);
210
 
210
 
211
}
211
}
212
 
212
 
213
void CameraPointGrey::startCapture(){
213
void CameraPointGrey::startCapture(){
214
 
214
 
215
    FlyCapture2::Error error;
215
    FlyCapture2::Error error;
216
 
216
 
217
    if(triggerMode == triggerModeHardware){
217
    if(triggerMode == triggerModeHardware){
218
        // Configure for hardware trigger
218
        // Configure for hardware trigger
219
        FlyCapture2::TriggerMode triggerMode;
219
        FlyCapture2::TriggerMode triggerMode;
220
        triggerMode.onOff = true;
220
        triggerMode.onOff = true;
221
        triggerMode.polarity = 0;
221
        triggerMode.polarity = 0;
222
        triggerMode.source = 0;
222
        triggerMode.source = 0;
223
        triggerMode.mode = 14;
223
        triggerMode.mode = 14;
224
        error = cam.SetTriggerMode(&triggerMode);
224
        error = cam.SetTriggerMode(&triggerMode);
225
        if (error != FlyCapture2::PGRERROR_OK)
225
        if (error != FlyCapture2::PGRERROR_OK)
226
            PrintError(error);
226
            PrintError(error);
227
 
227
 
228
    } else if(triggerMode == triggerModeSoftware){
228
    } else if(triggerMode == triggerModeSoftware){
229
        // Configure software trigger
229
        // Configure software trigger
230
        FlyCapture2::TriggerMode triggerMode;
230
        FlyCapture2::TriggerMode triggerMode;
231
        triggerMode.onOff = true;
231
        triggerMode.onOff = true;
232
        triggerMode.polarity = 0;
232
        triggerMode.polarity = 0;
233
        triggerMode.source = 7; // software
233
        triggerMode.source = 7; // software
234
        triggerMode.mode = 0;
234
        triggerMode.mode = 0;
235
        error = cam.SetTriggerMode(&triggerMode);
235
        error = cam.SetTriggerMode(&triggerMode);
236
        if (error != FlyCapture2::PGRERROR_OK)
236
        if (error != FlyCapture2::PGRERROR_OK)
237
            PrintError(error);
237
            PrintError(error);
238
    }
238
    }
239
 
239
 
240
    // Set the trigger timeout to 1000 ms
240
    // Set the trigger timeout to 1000 ms
241
    FlyCapture2::FC2Config config;
241
    FlyCapture2::FC2Config config;
242
    config.grabTimeout = 1000;
242
    config.grabTimeout = 1000;
243
    error = cam.SetConfiguration(&config);
243
    error = cam.SetConfiguration(&config);
244
    if (error != FlyCapture2::PGRERROR_OK)
244
    if (error != FlyCapture2::PGRERROR_OK)
245
        PrintError(error);
245
        PrintError(error);
246
 
246
 
247
    error = cam.StartCapture();
247
    error = cam.StartCapture();
248
    if (error != FlyCapture2::PGRERROR_OK)
248
    if (error != FlyCapture2::PGRERROR_OK)
249
        PrintError(error);
249
        PrintError(error);
250
 
250
 
251
    capturing = true;
251
    capturing = true;
252
}
252
}
253
 
253
 
254
void CameraPointGrey::stopCapture(){
254
void CameraPointGrey::stopCapture(){
255
 
255
 
256
    FlyCapture2::Error error = cam.StopCapture();
256
    FlyCapture2::Error error = cam.StopCapture();
257
    if (error != FlyCapture2::PGRERROR_OK)
257
    if (error != FlyCapture2::PGRERROR_OK)
258
        PrintError(error);
258
        PrintError(error);
259
 
259
 
260
    capturing = false;
260
    capturing = false;
261
}
261
}
262
 
262
 
263
void CameraPointGrey::trigger(){
263
void CameraPointGrey::trigger(){
264
 
264
 
265
    FlyCapture2::Error error;
265
    FlyCapture2::Error error;
266
 
266
 
267
    // Fire software trigger
267
    // Fire software trigger
268
    // broadcasting not supported on some platforms
268
    // broadcasting not supported on some platforms
269
    error = cam.FireSoftwareTrigger(false);
269
    error = cam.FireSoftwareTrigger(false);
270
 
270
 
271
    if (error != FlyCapture2::PGRERROR_OK)
271
    if (error != FlyCapture2::PGRERROR_OK)
272
        PrintError(error);
272
        PrintError(error);
273
 
273
 
274
}
274
}
275
 
275
 
276
CameraFrame CameraPointGrey::getFrame(){
276
CameraFrame CameraPointGrey::getFrame(){
277
 
277
 
278
    FlyCapture2::Error error;
278
    FlyCapture2::Error error;
279
 
279
 
280
    // Retrieve the image
280
    // Retrieve the image
281
    FlyCapture2::Image rawImage;
281
    FlyCapture2::Image rawImage;
282
    error = cam.RetrieveBuffer(&rawImage);
282
    error = cam.RetrieveBuffer(&rawImage);
283
    if (error != FlyCapture2::PGRERROR_OK)
283
    if (error != FlyCapture2::PGRERROR_OK)
284
        PrintError(error);
284
        PrintError(error);
285
 
285
 
286
//    rawImage.SetColorProcessing(FlyCapture2::IPP);
286
//    rawImage.SetColorProcessing(FlyCapture2::IPP);
287
 
287
 
288
//    // de-Bayer
288
//    // de-Bayer
289
//    rawImage.Convert(FlyCapture2::PIXEL_FORMAT_RGB8, &currentImage);
289
//    rawImage.Convert(FlyCapture2::PIXEL_FORMAT_RGB8, &currentImage);
290
 
290
 
291
//    CameraFrame frame;
291
//    CameraFrame frame;
292
 
292
 
293
//    frame.timeStamp = currentImage.GetTimeStamp().cycleCount;
293
//    frame.timeStamp = currentImage.GetTimeStamp().cycleCount;
294
//    frame.height = currentImage.GetRows();
294
//    frame.height = currentImage.GetRows();
295
//    frame.width = currentImage.GetCols();
295
//    frame.width = currentImage.GetCols();
296
//    frame.bitDepth = 8;
296
//    frame.bitDepth = 8;
297
//    frame.channels = 3;
297
//    frame.channels = 3;
298
//    frame.memory = (unsigned short*)currentImage.GetData();
298
//    frame.memory = (unsigned short*)currentImage.GetData();
299
 
299
 
300
    CameraFrame frame;
300
    CameraFrame frame;
301
 
301
 
302
    frame.timeStamp = rawImage.GetTimeStamp().cycleCount;
302
    frame.timeStamp = rawImage.GetTimeStamp().cycleCount;
303
    frame.height = rawImage.GetRows();
303
    frame.height = rawImage.GetRows();
304
    frame.width = rawImage.GetCols();
304
    frame.width = rawImage.GetCols();
305
    frame.bitDepth = 8;
305
    frame.bitDepth = 8;
306
    frame.channels = 1;
306
    frame.channels = 1;
307
    frame.memory = rawImage.GetData();
307
    frame.memory = rawImage.GetData();
308
 
308
 
309
    return frame;
309
    return frame;
310
}
310
}
311
 
311
 
312
 
312
 
313
size_t CameraPointGrey::getFrameSizeBytes(){
313
size_t CameraPointGrey::getFrameSizeBytes(){
314
    
314
    
315
    FlyCapture2::Format7ImageSettings format7Settings;
315
    FlyCapture2::Format7ImageSettings format7Settings;
316
    cam.GetFormat7Configuration(&format7Settings, NULL, NULL);
316
    cam.GetFormat7Configuration(&format7Settings, NULL, NULL);
317
 
317
 
318
    return format7Settings.height*format7Settings.width*3*2;
318
    return format7Settings.height*format7Settings.width*3*2;
319
}
319
}
320
 
320
 
321
size_t CameraPointGrey::getFrameWidth(){
321
size_t CameraPointGrey::getFrameWidth(){
322
 
322
 
323
    FlyCapture2::Format7ImageSettings format7Settings;
323
    FlyCapture2::Format7ImageSettings format7Settings;
324
    unsigned int dummy1;
324
    unsigned int dummy1;
325
    float dummy2;
325
    float dummy2;
326
    FlyCapture2::Error error = cam.GetFormat7Configuration(&format7Settings, &dummy1, &dummy2);
326
    FlyCapture2::Error error = cam.GetFormat7Configuration(&format7Settings, &dummy1, &dummy2);
327
    if (error != FlyCapture2::PGRERROR_OK)
327
    if (error != FlyCapture2::PGRERROR_OK)
328
        PrintError(error);
328
        PrintError(error);
329
 
329
 
330
    return format7Settings.width;
330
    return format7Settings.width;
331
}
331
}
332
 
332
 
333
size_t CameraPointGrey::getFrameHeight(){
333
size_t CameraPointGrey::getFrameHeight(){
334
 
334
 
335
    FlyCapture2::Format7ImageSettings format7Settings;
335
    FlyCapture2::Format7ImageSettings format7Settings;
336
    unsigned int dummy1;
336
    unsigned int dummy1;
337
    float dummy2;
337
    float dummy2;
338
    FlyCapture2::Error error = cam.GetFormat7Configuration(&format7Settings, &dummy1, &dummy2);
338
    FlyCapture2::Error error = cam.GetFormat7Configuration(&format7Settings, &dummy1, &dummy2);
339
    if (error != FlyCapture2::PGRERROR_OK)
339
    if (error != FlyCapture2::PGRERROR_OK)
340
        PrintError(error);
340
        PrintError(error);
341
 
341
 
342
    return format7Settings.height;
342
    return format7Settings.height;
343
 
343
 
344
 
344
 
345
}
345
}
346
 
346
 
347
 
347
 
348
CameraPointGrey::~CameraPointGrey(){
348
CameraPointGrey::~CameraPointGrey(){
349
 
349
 
350
    if(capturing){
350
    if(capturing){
351
        // Stop camera transmission
351
        // Stop camera transmission
352
        stopCapture();
352
        stopCapture();
353
    }
353
    }
354
 
354
 
355
    // Gracefulle destruct the camera
355
    // Gracefulle destruct the camera
356
    cam.Disconnect();
356
    cam.Disconnect();
357
 
357
 
358
    std::cout << "Closed camera!" << std::endl << std::flush;
358
    std::cout << "Closed camera!" << std::endl << std::flush;
359
}
359
}
360
 
360
 
361
 
361
 
362
 
362
 
363
 
363