c++image-processingframe-grab

Frame grabbing with Matrox


I'm trying to run Matrox Image Library's example code for frame grabbing. When the application runs, all I get is a black screen for the display image.

I know my configuration is correct, since when I try Matrox Intellicam software, I'm able to grab an image, which makes it more weird. It's just something in the software I need to change that I'm not aware of.

I've found this, but it was not helpful really. Frame Capture using Matrox Commands

This is the code I have.

       /* Allocate 2 display buffers and clear them. */
       MbufAlloc2d(MilSystem,
                   (MIL_INT)(MdigInquire(MilDigitizer[0], M_SIZE_X, M_NULL)*GRAB_SCALE),
                   (MIL_INT)(MdigInquire(MilDigitizer[0], M_SIZE_Y, M_NULL)*GRAB_SCALE),
                   8L+M_UNSIGNED,
                   M_IMAGE+M_GRAB+M_PROC+M_DISP, &MilImageDisp[0]);
       MbufClear(MilImageDisp[0], 0x0);
       MbufAlloc2d(MilSystem,
                   (MIL_INT)(MdigInquire(MilDigitizer1, M_SIZE_X, M_NULL)*GRAB_SCALE),
                   (MIL_INT)(MdigInquire(MilDigitizer1, M_SIZE_Y, M_NULL)*GRAB_SCALE),
                   8L+M_UNSIGNED,
                   M_IMAGE+M_GRAB+M_PROC+M_DISP, &MilImageDisp1);
       MbufClear(MilImageDisp1, 0x80);

/* Display the buffers. */ MdispSelect(MilDisplay[0], MilImageDisp[0]); MdispSelect(MilDisplay[1], MilImageDisp[1]); /* Grab continuously on displays at the specified scale. */ MdigControl(MilDigitizer[0], M_GRAB_SCALE, GRAB_SCALE); MdigGrabContinuous(MilDigitizer[0],MilImageDisp[0]); MdigControl(MilDigitizer[1], M_GRAB_SCALE, GRAB_SCALE); MdigGrabContinuous(MilDigitizer[1],MilImageDisp[1]);

I'm quite stuck and I would appreciate any idea that suggests what might be wrong.


Solution

  • Frame grabber loses synchronization because either no default digitizer format is set or it's not the correct format for the camera.

    To solve this issue, either set the DCF in code or manually in config file.