Problem using CMU driver with PGR camera

Discussion in 'Digital Photography' started by saad.choudri@gmail.com, Jun 18, 2007.

  1. Guest

    Hi,

    I have used the CMU camera driver for the 1394 spec with Matlab before
    and have been able to use the PGR DragonFly for live image streaming.
    There was no problem then.

    I am using the same driver now with only Visual C++ (MS VS 2005) but
    am not able to get this camera working with my code. The code works
    fine with other cameras but not this one. It cant initialise this type
    of camera. The demo that comes with CMU runs the camera in its RAW
    Bayer format ( i.e. black and white with the dots). I think it may be
    a bayersensoralignment problem but havent been able to work out how to
    rectify this. Ive extracted bits from the code and pasted them
    below.:


    #include "stdafx.h"
    #include "cv.h"
    #include "highgui.h"
    #include "cxcore.h"
    #include "cvaux.h"
    #include "1394camera.h"

    #define CAM_RES_WIDTH 640
    #define CAM_RES_HEIGHT 480
    #define CAM_RES_CHANNELS 3


    int main( int argc, char** argv )
    {


    // Camera initialisation


    C1394Camera cam0;


    // cam1.RefreshCameraList();


    cam0.RefreshCameraList();
    cam0.SelectCamera(0);


    if(cam0.InitCamera() != CAM_SUCCESS)
    {
    printf("\nInitialization failed .");
    return 1;
    }
    if(cam0.SetVideoFormat(0) != CAM_SUCCESS)
    {
    printf("\nCould not set video format.");
    return 1;
    }
    if(cam0.SetVideoMode(2) != CAM_SUCCESS)
    {
    printf("\nCould not set video mode.");
    return 1;
    }
    if(cam0.SetVideoFrameRate(4) != CAM_SUCCESS)
    {
    printf("\nCould not set frame rate.");
    return 1;
    }
    if(cam0.StartImageAcquisition() != CAM_SUCCESS)
    {
    printf("\nCould not start image acquisation.");
    return 1;
    }


    cvWaitKey(1000);

    cvNamedWindow( "Live Input",1);
    HWND hWnD =reinterpret_cast<HWND>(cvGetWindowHandle( "Live
    Input" ));
    CameraControlDialog(hWnD,&cam0,TRUE);

    // declaring image pointer (OPENCV)
    IplImage *I1 =
    cvCreateImage( cvSize(CAM_RES_WIDTH,CAM_RES_HEIGHT),
    8U,CAM_RES_CHANNELS);

    //acquire image ...
    while (j==1)
    {


    if(cam0.AcquireImage() != CAM_SUCCESS)
    {
    printf("\nCould not acquire image. from cam0");
    return 1;
    }



    cam0.getRGB((unsigned char*)(I1->imageData),
    (CAM_RES_WIDTH*CAM_RES_HEIGHT*CAM_RES_CHANNELS));

    cvShowImage("Live Input", I1);
    }

    }
    --------------

    I have tried various combinations of values in the intialisation bit .
    It just fails to initialise giving the error in the printf bit above,
    i.e. first step, which is

    if(cam0.InitCamera() != CAM_SUCCESS)
    {
    printf("\nInitialization failed .");
    return 1;
    }

    Any advice on this will be helpful.


    Thank you,
    Saad Choudri
     
    , Jun 18, 2007
    #1
    1. Advertising

  2. Paul Allen Guest

    Most people here are not programmers. And of the programmers, the
    number with specific experience with Visual C++ and the CMU camera
    driver is probably quite close to zero.

    Your best shot is likely to ask the maintainers at CMU. Unfortunately,
    the code's author died in 2000 and his colleagues are maintaining his
    code as a tribute to his memory.

    Good luck.

    Paul Allen
     
    Paul Allen, Jun 20, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert11
    Replies:
    2
    Views:
    563
    ┬░Mike┬░
    Jun 10, 2004
  2. =?Utf-8?B?SmVyZW15IFdvbmcg6buD5rOT6YeP?=

    converting 32-bit driver to 64-bit driver

    =?Utf-8?B?SmVyZW15IFdvbmcg6buD5rOT6YeP?=, Aug 18, 2005, in forum: Windows 64bit
    Replies:
    9
    Views:
    6,840
    Peter Foldes
    Aug 20, 2005
  3. LDJ
    Replies:
    7
    Views:
    3,373
  4. a@b
    Replies:
    13
    Views:
    1,456
  5. Harold A Climer
    Replies:
    0
    Views:
    1,222
    Harold A Climer
    Aug 24, 2013
Loading...

Share This Page