Subversion Repositories seema-scanner

Rev

Rev 1 | Rev 17 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 4
Line 69... Line 69...
69
    triggerMode.mode = 0;
69
    triggerMode.mode = 0;
70
    error = cam.SetTriggerMode(&triggerMode);
70
    error = cam.SetTriggerMode(&triggerMode);
71
    if (error != FlyCapture2::PGRERROR_OK)
71
    if (error != FlyCapture2::PGRERROR_OK)
72
        PrintError(error);
72
        PrintError(error);
73
 
73
 
-
 
74
    // Configure video mode and frame rate
-
 
75
    FlyCapture2::VideoMode videoMode = FlyCapture2::VIDEOMODE_640x480Y8;
-
 
76
    FlyCapture2::FrameRate frameRate = FlyCapture2::FRAMERATE_15;
-
 
77
    cam.SetVideoModeAndFrameRate(videoMode, frameRate);
-
 
78
 
74
    // Get the camera information
79
    // Get the camera information
75
    FlyCapture2::CameraInfo camInfo;
80
    FlyCapture2::CameraInfo camInfo;
76
    error = cam.GetCameraInfo(&camInfo);
81
    error = cam.GetCameraInfo(&camInfo);
77
    if (error != FlyCapture2::PGRERROR_OK)
82
    if (error != FlyCapture2::PGRERROR_OK)
78
        PrintError(error);
83
        PrintError(error);
79
 
84
 
80
    std::cout << camInfo.vendorName << "  " << camInfo.modelName << std::endl;
85
    std::cout << camInfo.vendorName << "  " << camInfo.modelName << "  " << camInfo.serialNumber << std::endl;
81
 
86
 
82
    // Set reasonable default settings
87
    // Set reasonable default settings
83
    CameraSettings settings;
88
    CameraSettings settings;
84
    settings.shutter = 8.33;
89
    settings.shutter = 33.33;
85
    //settings.shutter = 16.66;
-
 
86
    settings.gain = 0.0;
90
    settings.gain = 0.0;
87
    this->setCameraSettings(settings);
91
    this->setCameraSettings(settings);
88
 
92
 
89
    settings = this->getCameraSettings();
93
    settings = this->getCameraSettings();
90
    std::cout << "\tShutter: " << settings.shutter << "ms" << std::endl;
94
    std::cout << "\tShutter: " << settings.shutter << "ms" << std::endl;
Line 121... Line 125...
121
    config.grabTimeout = 1000;
125
    config.grabTimeout = 1000;
122
    error = cam.SetConfiguration(&config);
126
    error = cam.SetConfiguration(&config);
123
    if (error != FlyCapture2::PGRERROR_OK)
127
    if (error != FlyCapture2::PGRERROR_OK)
124
        PrintError(error);
128
        PrintError(error);
125
 
129
 
126
    error = cam.StartCapture();
130
//    error = cam.StartCapture();
127
    if (error != FlyCapture2::PGRERROR_OK)
131
//    if (error != FlyCapture2::PGRERROR_OK)
128
        PrintError(error);
132
//        PrintError(error);
129
 
133
 
130
    capturing = true;
134
    capturing = true;
131
}
135
}
132
 
136
 
133
void CameraPointGrey::stopCapture(){
137
void CameraPointGrey::stopCapture(){
Line 163... Line 167...
163
CameraFrame CameraPointGrey::getSingleFrame(){
167
CameraFrame CameraPointGrey::getSingleFrame(){
164
 
168
 
165
    FlyCapture2::Error error;
169
    FlyCapture2::Error error;
166
 
170
 
167
    // Fire software trigger
171
    // Fire software trigger
-
 
172
    // broadcasting not supported on some platforms
168
    cam.FireSoftwareTrigger(true);
173
    cam.FireSoftwareTrigger(false);
169
 
174
 
170
    // Retrieve the image
175
    // Retrieve the image
171
    FlyCapture2::Image rawImage;
176
    FlyCapture2::Image rawImage;
172
    error = cam.RetrieveBuffer(&rawImage);
177
    error = cam.RetrieveBuffer(&rawImage);
173
    if (error != FlyCapture2::PGRERROR_OK)
178
    if (error != FlyCapture2::PGRERROR_OK)
Line 231... Line 236...
231
 
236
 
232
    return settings;
237
    return settings;
233
}
238
}
234
 
239
 
235
CameraPointGrey::~CameraPointGrey(){
240
CameraPointGrey::~CameraPointGrey(){
236
 
-
 
237
    std::cout << "Deleting Point Grey Camera 1" << std::endl << std::flush;
241
    std::cout << "Deleting Point Grey Camera 1" << std::endl << std::flush;
238
 
242
 
239
    // Stop camera transmission
243
    // Stop camera transmission
240
    cam.StopCapture();
244
   // cam.StopCapture();
241
 
245
 
242
    std::cout << "Deleting Point Grey Camera 2" << std::endl << std::flush;
246
    std::cout << "Deleting Point Grey Camera 2" << std::endl << std::flush;
243
 
247
 
244
    // Gracefulle destruct the camera
248
    // Gracefulle destruct the camera
245
    cam.Disconnect();
249
   // cam.Disconnect();
246
 
250
 
247
    std::cout << "Deleting Point Grey Camera 3" << std::endl << std::flush;
251
    std::cout << "Deleting Point Grey Camera 3" << std::endl << std::flush;
248
}
252
}
249
 
253
 
250
 
254