Does IVT work with Visual Studio 2008 Express

Help
2010-06-22
2013-05-09
  • Dear Sir,
    I have installed IVT with the latest version on my system. I have also installed Visual Studio 2008 Express edition on my system. All the examples except the camera interface examples are running.  CVFWCapture:OpenCamera method is not opening the webcam. I am using Firefly MV FFMV-03MTC web camera and CS-mount lens. Does the camera interface in IVT work with this camera and lens model?

    Can you please tell me which version of the Visual Studio I should install on my system for IVT's camera interface to work propoerly. I am stuck with this problem from so many days. I will be thankful to you if you can help me in solving the problem. Thanks.

     
  • Pedram Azad
    Pedram Azad
    2010-06-22

    Hello,

    your problem is not related to the IDE/compiler you are using - I run all applications with Visual Studio 2008 Express Edition myself.

    I assume you have installed the SDK that comes with PointGrey cameras and that you can open the camera using the application FlyCap? If so, then use the camera module CDragonFlyCapture (even though you have a Firefly).

    For this add the file IVT/src/VideoCapture/DragonFlyCapture.cpp to the application project you are testing with (e.g. IVT/win32/CaptureApp). You have to add the path to the include directory of your PointGrey SDK installation in the Visual Studio Settings, and also add the path to the lib directory. The default paths are:

    C:\Program Files\Point Grey Research\PGR FlyCapture\include
    C:\Program Files\Point Grey Research\PGR FlyCapture\lib

    Also don't forget to add pgrflycapture.lib to the link dependencies of your project.
    As constructor, use: CDragonFlyCapture(1, CVideoCaptureInterface::e640x480, CVideoCaptureInterface::eBayerPatternToRGB24, ImageProcessor::eBayerRG).

    If the colors are weird (e.g. red/blue switched), try the other available combinations for the last parameter.

    Let me know, if this worked.

    Regards,
    Pedram

     
  • Dear Sir,
    Thanks a lot for your prompt reply. I have tried to do what you have mentioned in your previous mail.

    1)I have downloaded sdk for point grey camera and I am able to open the application using flycap.
    2) I have opened the CaptureApp application and added file IVT/src/VideoCapture/DragonFlyCapture.cpp to the existing application.
    3) Following paths are also added to the visual studio settings:
    C:\Program Files\Point Grey Research\FlyCapture2\include
    C:\Program Files\Point Grey Research\FlyCapture2\lib
    4) The constructor is also initialed as mentioend above.

    I am getting following nine errors during build stage itself:
    1>DragonFlyCapture.obj : error LNK2019: unresolved external symbol __imp__flycaptureBusCameraCount referenced in function "public: __thiscall CDragonFlyCapture::CDragonFlyCapture(enum CVideoCaptureInterface::VideoMode,enum CVideoCaptureInterface::ColorMode,enum ImageProcessor::BayerPatternType)" (??0CDragonFlyCapture@@QAE@W4VideoMode@CVideoCaptureInterface@@W4ColorMode@2@W4BayerPatternType@ImageProcessor@@@Z)
    1>DragonFlyCapture.obj : error LNK2019: unresolved external symbol __imp__flycaptureStartCustomImage referenced in function "public: virtual bool __thiscall CDragonFlyCapture::OpenCamera(void)" (?OpenCamera@CDragonFlyCapture@@UAE_NXZ)
    1>DragonFlyCapture.obj : error LNK2019: unresolved external symbol __imp__flycaptureInitialize referenced in function "public: virtual bool __thiscall CDragonFlyCapture::OpenCamera(void)" (?OpenCamera@CDragonFlyCapture@@UAE_NXZ)
    1>DragonFlyCapture.obj : error LNK2019: unresolved external symbol __imp__flycaptureCreateContext referenced in function "public: virtual bool __thiscall CDragonFlyCapture::OpenCamera(void)" (?OpenCamera@CDragonFlyCapture@@UAE_NXZ)
    1>DragonFlyCapture.obj : error LNK2019: unresolved external symbol __imp__flycaptureDestroyContext referenced in function "public: virtual void __thiscall CDragonFlyCapture::CloseCamera(void)" (?CloseCamera@CDragonFlyCapture@@UAEXXZ)
    1>DragonFlyCapture.obj : error LNK2019: unresolved external symbol __imp__flycaptureStop referenced in function "public: virtual void __thiscall CDragonFlyCapture::CloseCamera(void)" (?CloseCamera@CDragonFlyCapture@@UAEXXZ)
    1>DragonFlyCapture.obj : error LNK2019: unresolved external symbol __imp__flycaptureGrabImage2 referenced in function "public: virtual bool __thiscall CDragonFlyCapture::CaptureImage(class CByteImage * *)" (?CaptureImage@CDragonFlyCapture@@UAE_NPAPAVCByteImage@@@Z)
    1>DragonFlyCapture.obj : error LNK2019: unresolved external symbol __imp__flycaptureGetCameraInfo referenced in function "public: unsigned int __thiscall CDragonFlyCapture::GetSerialFromCamera(int)" (?GetSerialFromCamera@CDragonFlyCapture@@QAEIH@Z)

    I have a doubt regarding linking of library pgrflycapture.lib to the project. Can you please let me how to do it? I will be grateful to you if you can help me in this regard. Have a nice day. Thanks, Radhika

     
  • Pedram Azad
    Pedram Azad
    2010-06-28

    Hello Radhika,

    go to the project settings (right click on your project in Visual Studio, then choose "Properties"). There, chose "Linker", and then "Input" on the left side. Then add in the field "Additional dependencies" on the right side "pgrflycapture.lib".

    Pedram

     
  • Dear Sir,

    I have linked the library to the project. There are no build errors now. I am getting folowing error while running the program.
    "Unable to start program "C:\program files\Point Grey Research\ Fly Capture2\ lib\FC1\PGRFlyCapture.lib. The specified file is an unrecognized or unsupported binary format". Can you please healp me in this regard. Thanks

     
  • Sorry for bothering you so many times. I have fixed the previous error but  I am getting a new error this time " The application has failed to start because PGRFlyCapture.dll was not found. Re-installing the application may fix this problem." I am not understanding which application I should reinstall? I have re-installed the point grey skd again but I am getting the same error. Do you have any idea regarding the error? Thanks.

     
  • Pedram Azad
    Pedram Azad
    2010-06-28

    Hi,

    you have to add the path

    C:\Program Files\Point Grey Research\PGR FlyCapture\bin

    to the PATH environment variable of your Windows system (go to "Control panel", then "System", there you can add it).

    Pedram

     
  • Hi, I have added the path, but I am still getting the same error. Do I need to add anything else in environment variable or in Visual studio? Thanks

     
  • Hi Sir, The error is resolved. Thanks for all your inputs. Now, there are no errors while building and running the application. As suggested,I have used the code given below to check for camera interface. The camera is not opening. I will eb grateful to you if you could help me in this regard.  Thanks
    CDragonFlyCapture capture(1, CVideoCaptureInterface::e640x480,CVideoCaptureInterface::eBayerPatternToRGB24, ImageProcessor::eBayerGR);
    if (!capture.OpenCamera())
    {
    printf("error: could not open camera\n");
    printf("press return to quit\n");
    char szTemp;
    scanf("%c", szTemp);
    return false;
    }

     
  • Pedram Azad
    Pedram Azad
    2010-06-29

    Hi,

    try to modify the following lines in DragonFlyCapture.cpp:

    //ret = ::flycaptureStart(m_flyCaptureContext[i], FLYCAPTURE_VIDEOMODE_640x480Y8, FLYCAPTURE_FRAMERATE_30);
        if (m_colorMode == eGrayScale)
        ret = ::flycaptureStartCustomImage(m_flyCaptureContext[i], 0, 4, 4, 640, 480, 100.0, FLYCAPTURE_MONO8);
    else
        ret = ::flycaptureStartCustomImage(m_flyCaptureContext[i], 0, 4, 4, 640, 480, 100.0, FLYCAPTURE_RAW8);
    

    and change it to

    ret = ::flycaptureStart(m_flyCaptureContext[i], FLYCAPTURE_VIDEOMODE_640x480Y8, FLYCAPTURE_FRAMERATE_30);
    /*if (m_colorMode == eGrayScale)
        ret = ::flycaptureStartCustomImage(m_flyCaptureContext[i], 0, 4, 4, 640, 480, 100.0, FLYCAPTURE_MONO8);
    else
        ret = ::flycaptureStartCustomImage(m_flyCaptureContext[i], 0, 4, 4, 640, 480, 100.0, FLYCAPTURE_RAW8);*/
    

    It depends on your camera, which call will properly start the camera, e.g. if Format7 mode is supported or not. If this does not work, please send me an e-mail (you find my e-mail address on the contact page of ivt.sourceforge.net), to get this fixed faster. We can then post the final result here…

    Pedram

     
  • Hi SIr, One more thing I have noticed that camera opens with flycap before running the application. After running the application, the camera doesn't open with flycap and shows error "flycapturestart() reported invalid custom image size. The grab thread has encountered a problem and had to be terminated". Does this mean that the code mentioned in the previous message is able to detect the camera? Can you please help me in this regard? Thanks

     
  • Pedram Azad
    Pedram Azad
    2010-06-29

    As I said, please send me an e-mail, since your problem is too specific for this forum now. You seem to have problems with running camera with the PointGrey software, independently from IVT.

    Pedram

     
  • Hi Sir, It worked. Thank you very much for all your help. Have a wonderful day.