Subversion Repositories seema-scanner

Rev

Rev 18 | Rev 20 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18 Rev 19
Line 30... Line 30...
30
        FlyCapture2::Camera cam;
30
        FlyCapture2::Camera cam;
31
        error = cam.Connect(&guid);
31
        error = cam.Connect(&guid);
32
        if (error != FlyCapture2::PGRERROR_OK)
32
        if (error != FlyCapture2::PGRERROR_OK)
33
            PrintError( error );
33
            PrintError( error );
34
 
34
 
-
 
35
    //    // Configure DCAM video mode and frame rate
-
 
36
    //    FlyCapture2::VideoMode videoMode = FlyCapture2::VIDEOMODE_1280x960Y8;
-
 
37
    //    FlyCapture2::FrameRate frameRate = FlyCapture2::FRAMERATE_7_5;
-
 
38
    //    error = cam.SetVideoModeAndFrameRate(videoMode, frameRate);
-
 
39
    //    if (error != FlyCapture2::PGRERROR_OK)
-
 
40
    //        PrintError(error);
-
 
41
 
-
 
42
        // Configure Format7 mode
-
 
43
        FlyCapture2::Format7ImageSettings format7Settings;
-
 
44
        format7Settings.mode = FlyCapture2::MODE_0;
-
 
45
        format7Settings.pixelFormat = FlyCapture2::PIXEL_FORMAT_RAW8;
-
 
46
        format7Settings.width = 1296;
-
 
47
        format7Settings.height = 964;
-
 
48
        format7Settings.offsetX = 0;
-
 
49
        format7Settings.offsetY = 0;
-
 
50
 
-
 
51
        // Validate and set mode
-
 
52
        FlyCapture2::Format7PacketInfo packetInfo;
-
 
53
        bool valid;
-
 
54
        cam.ValidateFormat7Settings(&format7Settings, &valid, &packetInfo);
-
 
55
        // packetsize indirectly configures frame rate
-
 
56
        error = cam.SetFormat7Configuration(&format7Settings, packetInfo.unitBytesPerPacket*3);
-
 
57
        if (error != FlyCapture2::PGRERROR_OK)
-
 
58
            PrintError(error);
-
 
59
 
-
 
60
        // Configure general
-
 
61
        FlyCapture2::FC2Config config;
-
 
62
        config.numBuffers = 5;
-
 
63
        config.grabTimeout = 1000; // retrieveBuffer() timeout in ms
-
 
64
        config.grabMode = FlyCapture2::DROP_FRAMES;
-
 
65
        config.isochBusSpeed = FlyCapture2::BUSSPEED_S_FASTEST;
-
 
66
        config.highPerformanceRetrieveBuffer = true;
-
 
67
        //config.asyncBusSpeed = FlyCapture2::BUSSPEED_S_FASTEST;
-
 
68
        error = cam.SetConfiguration(&config);
-
 
69
        if (error != FlyCapture2::PGRERROR_OK)
-
 
70
            PrintError(error);
-
 
71
 
35
        // Get the camera information
72
        // Get camera information
36
        FlyCapture2::CameraInfo camInfo;
73
        FlyCapture2::CameraInfo camInfo;
37
        error = cam.GetCameraInfo(&camInfo);
74
        error = cam.GetCameraInfo(&camInfo);
38
        if (error != FlyCapture2::PGRERROR_OK)
75
        if (error != FlyCapture2::PGRERROR_OK)
39
            PrintError( error );
76
            PrintError( error );
40
 
77