Resultados:
- Snapshots tomados: 200
- fps entre Snapshots: 50
- Tiempo Total: 4000ms
- Tiempo Promedio: 20 ms (es decir, 50 fps)
Afortunadamente, la PixelFly presenta una opción de binning que puede reducir los tiempos empleados. El binning consiste en realizar algún procesamiento sobre un conjunto de píxeles y generar un único píxel que contiene información de los anteriores. En el común de los casos la operación consiste en promediar los valores.
Los nuevos resultados:
- Snapshots tomados: 200
- fps entre Snapshots: ?
- Tiempo Total: 2000ms
- Tiempo Promedio: 10 ms (es decir, 100 fps)
Al parecer el binning permite incluso que la cámara tome fotografías en una frecuencia más alta. Queda pendiente evaluar la capacidad de double shutter.
1: #define GAIN 1
2: #define DELAY 0 //ms
3: #define EXPOSURE_TIME 5 //ms
4: #define ROIX 2 //from 1 to 20
5: #define ROIY 2 //from 1 to 20
6: 7: int main(int argc, char* argv[]) {
8: int totalSnapshots;
9: std::cout << "Qty of snapshots to take: ";
10: std::cin >> totalSnapshots; 11: 12: int camId;
13: CAMINFO camData[8]; 14: 15: int boardNumber = 0;
16: int error;
17: if (error = SELECT_CAMERA("pixelfly", boardNumber, &camId, camData))
18: showErrorAndClose(error);19: else {
20: if (error = SETUP_CAMERA(camId, camData, 0, 0, 0, 1, ROIX, 1, ROIY, 1, 1, GAIN, DELAY, EXPOSURE_TIME))
21: showErrorAndClose(error);22: else {
23: time_t beginTime, endTime; 24: time(&beginTime); 25: 26: int snapshotNumber = 0;
27: while (! error && snapshotNumber < totalSnapshots) {
28: if (error = SNAP(camId, camData, 0))
29: showErrorAndClose(error);30: else {
31: if (error = GETIMAGE(camId, camData, 2000))
32: showErrorAndClose(error);33: else
34: // image in memory at this point
35: } 36: snapshotNumber++; 37: } 38: time(&endTime);39: std::cout << std::endl << "Tiempo Promedio por imagen: " << 1000.0 * (double)difftime(endTime, beginTime) / (float)totalSnapshots << "ms." << std::endl;
40: } 41: CLOSE_CAMERA(camId, camData); 42: }43: return 0;
44: }