Video Sources

PTAM normally uses libCVD for video input. Alternative video inputs here.

Point Grey cameras for Win32 using FlyCapture2:

Use this videosource. Only tested on a Firefly MV.

Webcams (Directshow) for Win32, using videoInput:

Use this videosource. You also need Theodore Watson’s free videoInput library.

Using OpenCV for video input:

Arnaud Grosjean has written a wrapper to use OpenCV for video input, this is more flexible than libCVD in some instances. You can find his code and instructions on his website.

Using GStreamer for reading video files on Linux:

James Y. Wilson has written a videosource file to use GStreamer, which allows PTAM to run with pre-recorded videos. Download the gstreamer video source.

Advertisements

72 Responses to Video Sources

  1. This implementation of VideoSource allows to use OpenCV as a source for the video input
    I did so because libCVD failed getting my V4L2 device
    The instructions are joined.

    Code Here

    • georgklein says:

      Thanks, copy-pasted the link to the page above. Since OpenCV is multi-platform I assume this could work on OSX / Win32 as well, perhaps others can comment on that.

    • Aaron Wetzler says:

      Hi
      The above video source code compiles fine on windows with PTAM. Ive compiled in VS08 using both Arnauds code for OpenCV and Theodore Watsons videoInput library. With Arnauds code the only changes I had to make were byte becomes CVD::byte and i removed the #include line.

      With that said I am still getting painfully slow frame rates. I have a Lenovo, intel core 2.8ghz with 2gb ram and am running w7. my webcam is a shoddy cheapo genius look 316 and ive reduced sharpness. For the camera calibrator once a checkerboard is detected frame rate drops to 1 frame every 10 seconds. With PTAM framerate is around 10hz.

      Id love to know if there is a way to improve this.

      • georgklein says:

        Does the frame-rate get better if you switch on the map view in PTAM, or if you switch on the AR overlay? If so it might be a graphics driver issue

      • Anonymous Coward says:

        Did you ever find a solution? i see exactly the same behavior
        using the directshow videoinput – about 10fps in ptam itself,
        but cameracalibrator is impossibly slow once a checkerboard is seen.
        same behavior for ptam and ptamm

    • truyenle says:

      Hi Grosjean Arnaud,

      I’m using OpenCV2.2 to compile PTAM on ubuntu 11.04 and have a weird case as
      – On one machine, I am successful to compile and run PTAM, the flags I use in the Makefile is as
      LINKFLAGS = -L $(HOME)/local/lib -lGVars3 -lcvd -lblas -llapack -lcv -lcxcore -lhighgui $(3DSLIB)
      – On another machine which is also the same installation + setup, I can’t compile using this same flags setting, although OpenCV is the same version on both machine. The flags I used on this machine have to be
      LINKFLAGS = -L $(HOME)/local/lib -lblas -llapack -lGVars3 -lcvd -lopencv_core -lopencv_highgui $(3DSLIB)
      with this flags setting, I can pass the compile but when PTAM run, what I got is
      “Unable to get the camera”
      Further check I found that this command
      VideoCapture* cap = (VideoCapture*)mptr;
      always cause cap->isOpened() return 0.
      I event comment out everything and force mptr = new VideoCapture(0); just before the above command.
      I did check the camera and it is working ok also.
      You got any idea how to overcome this, please help to share.

      Thanks
      Truyenle

  2. JIM says:

    Good work mate.
    But where can i find the file VideoSource_Linux_OpenCV.o ????
    Can i generate it somehow?

  3. JIM says:

    Hi there.I am trying 3 days to compile PTAMM with Arnaud’s OpenCV code but nothing..
    I installed OpenCV, but during compilation i get the following errors:

    VideoSource_Linux_OpenCV.cc:31: error: ‘cv’ is not a namespace-name
    VideoSource_Linux_OpenCV.cc:31: error: expected namespace-name before ‘;’ token
    VideoSource_Linux_OpenCV.cc:36: error: ‘VideoSource’ has not been declared
    VideoSource_Linux_OpenCV.cc:36: error: ISO C++ forbids declaration of ‘VideoSource’ with no type
    VideoSource_Linux_OpenCV.cc: In function ‘int VideoSource()’:
    VideoSource_Linux_OpenCV.cc:39: error: ‘mptr’ was not declared in this scope
    VideoSource_Linux_OpenCV.cc:39: error: expected type-specifier before ‘VideoCapture’
    VideoSource_Linux_OpenCV.cc:39: error: expected ‘;’ before ‘VideoCapture’
    VideoSource_Linux_OpenCV.cc:40: error: ‘VideoCapture’ was not declared in this scope
    VideoSource_Linux_OpenCV.cc:40: error: ‘cap’ was not declared in this scope
    VideoSource_Linux_OpenCV.cc:40: error: expected primary-expression before ‘)’ token
    VideoSource_Linux_OpenCV.cc:40: error: expected ‘;’ before ‘mptr’
    VideoSource_Linux_OpenCV.cc:46: error: ‘mirSize’ was not declared in this scope
    VideoSource_Linux_OpenCV.cc: At global scope:
    VideoSource_Linux_OpenCV.cc:49: error: ‘VideoSource’ is not a class or namespace
    VideoSource_Linux_OpenCV.cc: In function ‘CVD::ImageRef Size()’:
    VideoSource_Linux_OpenCV.cc:51: error: ‘mirSize’ was not declared in this scope
    VideoSource_Linux_OpenCV.cc: At global scope:
    VideoSource_Linux_OpenCV.cc:54: error: variable or field ‘conversionNB’ declared void
    VideoSource_Linux_OpenCV.cc:54: error: ‘Mat’ was not declared in this scope
    VideoSource_Linux_OpenCV.cc:54: error: expected primary-expression before ‘&’ token
    VideoSource_Linux_OpenCV.cc:54: error: ‘imBW’ was not declared in this scope
    /home/crimson/local/include/TooN/internal/objects.h:488: warning: ‘TooN::Zeros’ defined but not used
    /home/crimson/local/include/cvd/internal/scalar_convert.h:112: warning: ‘CVD::Pixel::Internal::init_float_for_byte’ defined but not used
    /home/crimson/local/include/cvd/internal/scalar_convert.h:113: warning: ‘CVD::Pixel::Internal::init_double_for_byte’ defined but not used
    make: *** [VideoSource_Linux_OpenCV.o] Error 1

    Any ideas?I use ubuntu 9.10.

    • Georg Klein says:

      Did you follow Arnaud’s instructions exactly or did you change anything? I ask because your compile errors are strange. cv should be defined in the openCV headers and VideoSource is declared in VideoSource.h, both of which are #included.

  4. JIM says:

    Thanx anyway…

    • Hello Jim are you under Linux or Windows ?
      Im actually using Linux and didn’t tried it on Windows, but the code is simple and should work (expect the includes maybe)
      Notice you should use OpenCV 2.0 at least since my piece code uses OpenCV’s C++ new features (the fact you don’t have the namespace cv seems to tell you’re under 2.0)
      Good luck.

      • JIM says:

        Thanx Arnaud…I compiled it (finally ;-))…I run it under Linux.
        Nice work…
        It doesn’t work under PTAMM though…
        If i find a solution to this i will post.(debugging makes me sick…)

  5. JIM says:

    For the users interested in PTAMM using Arnaud’s video input file, just add the following line:

    “namespace PTAMM {” (without the quotes)

    after the includes

    and a
    “}” (without the quotes)

    at the end of the VideoSource_Linux_OpenCV.cc file.
    Works perfectly for me under Ubuntu.

    • anti says:

      I’ve installed opencv 2.0.0 and tried the namespace PTAMM{ } but it doesn’t work

      this is what I get:

      /tmp/ccGkWKa3.o: In function `PTAMM::VideoSource::VideoSource()’:
      VideoSource_Linux_OpenCV.cc:(.text+0x57): undefined reference to `cv::VideoCapture::VideoCapture(int)’
      /tmp/ccGkWKa3.o: In function `PTAMM::VideoSource::VideoSource()’:
      VideoSource_Linux_OpenCV.cc:(.text+0x181): undefined reference to `cv::VideoCapture::VideoCapture(int)’
      /tmp/ccGkWKa3.o: In function `cv::Mat::clone() const’:
      VideoSource_Linux_OpenCV.cc:(.text._ZNK2cv3Mat5cloneEv[cv::Mat::clone() const]+0x23): undefined reference to `cv::Mat::copyTo(cv::Mat&) const’
      /tmp/ccGkWKa3.o: In function `cv::Mat::release()’:
      VideoSource_Linux_OpenCV.cc:(.text._ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x3e): undefined reference to `cv::fastFree(void*)’
      collect2: ld returned 1 exit status
      make: *** [CameraCalibrator] Error 1

      I want to change because with the V4L when I am running the program, in some seconds it crash and I get this error:

      !! Failed to run system; got exception.
      Exception was:
      V4LBuffer: PutFrame on /dev/video0 failed: V4L2: VIDIOC_QBUF

      Any idea?
      Thanks

  6. anti says:

    Thanks man, that worked, no problem now

  7. Camilo Mauricio Soto Valenzuela says:

    Hi, there people i would like to know if someone of you can give me some help, im Colombian Student of System Engineering at Universidad Catolica de Colombia, im currently working on my graduation proyect it is about to build and small localization system, im trying to learn and use George Klein slam algorithms but im really a beginner in Computer Vision algorithm, in this moment im tryng to compile and run the tracker at http://www.robots.ox.ac.uk/~gk/PTAM/, i already compile gvars3, TooN, and libcvd, but when i try make command after editing make file for linux (im currently using ubuntu 10) i got a 1k errors like “xxx was not declare in this scope” i know this is related with libraries, but i have change environment variables exporting libraries like this

    CPLUS_INCLUDE_PATH=/TooN:/gvars3/gvars3:/libcvd
    export CPLUS_INCLUDE_PATH
    LIBRARY_PATH=/TooN:/gvars3/gvars3:/libcvd
    export LIBRARY_PATH
    

    so make file does not use -I and -L commands , so i would like some help from you guys please, here in my place there is not even one person who can give me some help with this, also last week i buy logitech cam, but for me it was not possible to find the same quickcam 5000, so i decided to buy logitech webcam pro 9000, also beacuse in this page http://www.ideasonboard.org/uvc/ about linux drivers says that quickcam 5000 have some bugs, so thats why i but this other one, just that im afraid quickcam have some features needed for PTAM, i really need some help here, i know you people are really busy persons, but please if is possible i will pay you, i dont care i want to learn, also im a good person you can trust me, i will let my e-mail: cmsvalenzuela@gmail.com, also if you dont have time at all, please contact with some of your students, i dont want to quit my proyect.

    ohh i forgot i got another issue related with this, im about to buy an nvidia card, README file at George page, says that i will need nvidia card, but my laptop doesnt have one, thats why im buying one, i would like to know if this is really necessary, it is very expensive too.

    any help you can give i will be really grateful and happy, thanks a lot
    kind regards
    Camilo Soto.

  8. georgklein says:

    In the Makefile, find the text called MY_CUSTOM_INCLUDE_PATH and change that to whatever path you need. Likewise with the MY_CUSTOM_LINK_PATH.

    Re nvidia card, I wouldn’t buy a new one just to run this software. First see if works with the one you have and if there are problems there’s usually workarounds.

  9. Christian Stewart says:

    Hey,

    I am unable to figure out how to get the opencv input working in Windows.

    How might I do this?

    Thanks,
    Christian Stewart

    • Christian Stewart says:

      Oh btw this is the error i get.

      VideoSource_Win32_CMU1394.obj : error LNK2001: unresolved external symbol “public: __thiscall cv::VideoCapture::VideoCapture(int)” (??0VideoCapture@cv@@QAE@H@Z)
      VideoSource_Win32_CMU1394.obj : error LNK2001: unresolved external symbol “public: void __thiscall cv::Mat::copyTo(class cv::Mat &)const ” (?copyTo@Mat@cv@@QBEXAAV12@@Z)
      VideoSource_Win32_CMU1394.obj : error LNK2001: unresolved external symbol “void __cdecl cv::fastFree(void *)” (?fastFree@cv@@YAXPAX@Z)

      Thanks,
      Christian Stewart

    • JC Antonioli says:

      Hi Christian,

      I didn’t have this error for PTAM, but i have them now for PTAMM… and i use exactly the same file for video input (using OpenCV)… I really can not understand this. Could anyone give some advice for this? I think I have included all input files (libraries and include directeroies), and I have made the same config for PTAMM and PTAM…

      • JC Antonioli says:

        Ok, I forgot properties for one of the two projects. In order not to forget anything, I advice to follow this for linking:
        1. Tools->Options->Projects and solutions -> VC++ directories and configure “include files” directories with all directories VS will look in for include files. Configure “library files” too.
        2. For each sub project (CameraCalibrator and PTAMM) do:
        – right click -> properties -> Configuration properties -> Link editor -> General and configure “Directories for additionnal libraries”
        – right click -> properties -> Configuration properties -> Link editor -> Input and configure “Additionnal dependencies” with all the *.lib files the debugguer need.

        Hope this will help some people…

      • Christian Stewart says:

        Hey JC et al,

        I have followed the steps that you have put to fix this error, however I still am getting the unresolved external symbol problems.

        Does anyone else know of a fix to this problem?

        Thanks,
        Christian

        Here are the errors:

        Error 220 error LNK1120: 16 unresolved externals C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\Release\PTAMM.exe PTAMM
        Error 206 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::~reader(void)” (??1reader@CVDimage@CVD@@QAE@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 207 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::~reader(void)” (??1reader@CVDimage@CVD@@QAE@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 208 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::~reader(void)” (??1reader@CVDimage@CVD@@QAE@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 209 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::~reader(void)” (??1reader@CVDimage@CVD@@QAE@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 210 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::~reader(void)” (??1reader@CVDimage@CVD@@QAE@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 211 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::reader(class std::basic_istream<char,struct std::char_traits > &)” (??0reader@CVDimage@CVD@@QAE@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 212 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::reader(class std::basic_istream<char,struct std::char_traits > &)” (??0reader@CVDimage@CVD@@QAE@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 213 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::reader(class std::basic_istream<char,struct std::char_traits > &)” (??0reader@CVDimage@CVD@@QAE@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 214 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::reader(class std::basic_istream<char,struct std::char_traits > &)” (??0reader@CVDimage@CVD@@QAE@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 215 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::reader::reader(class std::basic_istream<char,struct std::char_traits > &)” (??0reader@CVDimage@CVD@@QAE@AAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 216 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::writer::~writer(void)” (??1writer@CVDimage@CVD@@QAE@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 218 error LNK2001: unresolved external symbol “public: __thiscall CVD::CVDimage::writer::writer(class std::basic_ostream<char,struct std::char_traits > &,class CVD::ImageRef,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::map<class std::basic_string<char,struct std::char_traits,class std::allocator >,class CVD::Parameter,struct std::less<class std::basic_string<char,struct std::char_traits,class std::allocator > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits,class std::allocator > const ,class CVD::Parameter > > > const &)” (??0writer@CVDimage@CVD@@QAE@AAV?$basic_ostream@DU?$char_traits@D@std@@@std@@VImageRef@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@ABV?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$Parameter@X@CVD@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$Parameter@X@CVD@@@std@@@2@@4@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 161 error LNK2001: unresolved external symbol “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 162 error LNK2001: unresolved external symbol “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 163 error LNK2001: unresolved external symbol “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 164 error LNK2001: unresolved external symbol “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 165 error LNK2001: unresolved external symbol “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 171 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::datatype(void)” (?datatype@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 172 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::datatype(void)” (?datatype@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 173 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::datatype(void)” (?datatype@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 174 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::datatype(void)” (?datatype@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 175 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::datatype(void)” (?datatype@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 166 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::name(void)” (?name@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 167 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::name(void)” (?name@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 168 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::name(void)” (?name@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 169 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::name(void)” (?name@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 170 error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::CVDimage::reader::name(void)” (?name@reader@CVDimage@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 176 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgb@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 177 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgb@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 178 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgb@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 179 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgb@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 180 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgb@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 156 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgba@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 157 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgba@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 158 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgba@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 159 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgba@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 160 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAV?$Rgba@E@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 186 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_bggr *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_bggr@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 187 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_bggr *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_bggr@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 188 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_bggr *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_bggr@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 189 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_bggr *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_bggr@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 190 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_bggr *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_bggr@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 201 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_gbrg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_gbrg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 202 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_gbrg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_gbrg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 203 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_gbrg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_gbrg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 204 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_gbrg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_gbrg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 205 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_gbrg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_gbrg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 196 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_grbg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_grbg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 197 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_grbg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_grbg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 198 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_grbg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_grbg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 199 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_grbg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_grbg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 200 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_grbg *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_grbg@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 191 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_rggb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_rggb@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 192 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_rggb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_rggb@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 193 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_rggb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_rggb@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 194 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_rggb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_rggb@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 195 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(struct CVD::bayer_rggb *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAUbayer_rggb@3@@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 181 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(unsigned char *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAE@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelsGame.obj PTAMM
        Error 182 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(unsigned char *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAE@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ARDriver.obj PTAMM
        Error 183 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(unsigned char *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAE@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 184 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(unsigned char *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAE@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MGButton.obj PTAMM
        Error 185 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(unsigned char *)” (?get_raw_pixel_line@reader@CVDimage@CVD@@QAEXPAE@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\ModelBrowser.obj PTAMM
        Error 217 error LNK2001: unresolved external symbol “public: void __thiscall CVD::CVDimage::writer::write_raw_pixel_line(unsigned char const *)” (?write_raw_pixel_line@writer@CVDimage@CVD@@QAEXPBE@Z) C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\MapSerializer.obj PTAMM
        Error 219 error LNK2001: unresolved external symbol __imp__ntohs@4 C:\Users\Christian-Desktop\Desktop\PTAMM Programming\Attempt 1\PTAMM\libcvd.lib(bayer.obj) PTAMM

      • Christian Stewart says:

        A couple more details.

        PTAMM, using the OpenCV video source. CameraCalibrator works fine, ptamm does not build.

        Dependancies have been added and as I said, the cameracalibrator builds sucessfully.

        Thanks.
        Christian

  10. Camilo Mauricio Soto Valenzuela says:

    ok, now i have the next problem…. same app crash error above
    but also i got this issue…

    Q: I get a black screen (no video) but the tracker seems to work anyway
    A: Check that your video driver supports glDrawPixels with GL_LUMINANCE. If you’re running Linux you probably need to install the nvidia drivers.

    i would like to know if is possible to correct this error without buying nvidia card, i dont know how to check if my video driver supports glDrawPixels with GL_LUMINANCE

    • Georg Klein says:

      You can change the way the tracker draws its images. You need to change the code so the tracker gets the RGB image as well as the greyscale-only one, and then draw the RGB image instead of the greyscale one. You can try doing this with glDrawPixels, or you can try drawing it as a textured quad.

      PS check that the image draws OK when you turn on the AR display before you do this.

      • Camilo Mauricio Soto Valenzuela says:

        hi, George well im sorry i couldnt understand, what you had said can you give me a hand please, i thing the error is on the 4vl video source, im reading but i couldnt find any tip, well i think this because…
        1. I got correct video … not a black screen using drivers UCV
        http://www.ideasonboard.org/uvc/ but of course this is an ubuntu app, for this type of cameras. ptam continue giving me black video.
        2. …and also because i test this code in my machine and it works fine its and example of gldrawpixels, here
        http://www.cs.mun.ca/~blangdon/opengl/glDrawPixels.html

        thanks in advance

        att: Camilo

      • georgklein says:

        Yes the difference is that your test code draws a color image, whereas PTAM is trying to draw a black and white image.
        Change your test code to try drawing black and white images. If that doesn’t work, change PTAM to draw the color image instead.

        Your test code : glDrawPixels( .. … .. GL_RGB,GL_FLOAT, … );
        PTAM: glDrawPixels( … .. .. GL_LUMINANCE, GL_UNSIGNED_BYTE, …)

  11. Camilo Mauricio Soto Valenzuela says:

    My last shot was to install Opencv and to use Arnaud Grosjean video source file… with no success, camera is still giving me black video, and with this video-source PTAM is not working as well as with V4L.

    please give me some advices on this.
    thanks in advance.

  12. Hi Georg,

    Is have made a bash script and a path for PTAM(r114) to let PTAM compile and run in Ubuntu10.04LTS of Intel Linux.
    I think these may be useful (for people on Ubuntu10.04) because
    (1) You can overcome compiling errors in Libcvd and gvars3 on Ubuntu10.04.
    (2) It supports OpenCV 2.1.0 video input (based on the code written by Arnaud GROSJEAN).
    (3) You can pick up various video input by just giving camera name on calling (2nd USB camera, mjpeg from web camera like axis, and movies like P000.MOV; you don’t need gstreamer)
    (4) It has a quick hack to avoid Black screen on some graphic environment
    (5) It also has a quick hack to avoid black eyeballs (you may see them on some graphic environment)

    (It seems I failed to post multiple times, so if you see the same post many times, I am very sorry.)
    The patch and the bash script (+ some required files) are available
    here.

    In addition, I have cooked USB-bootable-Ubuntu that all includes Ubuntu10.04LTS, OpenCV2.1.0,
    compiled PTAM(r114) with patched codes, and compiled ARToolKit(ver.2.72.1).
    I need to prepare 4GB USB memory stick and patience to download 800MB+1.5GB files, but you can
    easily run PTAM by that.

  13. Pingback: Pre-cooked linux image | Parallel Tracking and Mapping (PTAM) news

  14. Dennis Stahlhut says:

    Hi, i’ve got PTAM running but i have massive problems with PTAMM. Some i solve myself but i don’t have an idea where this came from:

    System.o: In function `PTAMM::System::System()’:
    System.cc:(.text+0x3425): undefined reference to `PTAMM::VideoSource::VideoSource()’
    System.cc:(.text+0x3451): undefined reference to `PTAMM::VideoSource::Size()’
    System.cc:(.text+0x38e3): undefined reference to `PTAMM::VideoSource::Size()’
    System.cc:(.text+0x39d6): undefined reference to `PTAMM::VideoSource::Size()’
    System.cc:(.text+0x3b69): undefined reference to `PTAMM::VideoSource::Size()’
    System.cc:(.text+0x3f50): undefined reference to `PTAMM::VideoSource::Size()’
    System.o:System.cc:(.text+0x3fcf): more undefined references to `PTAMM::VideoSource::Size()’ follow
    System.o: In function `PTAMM::System::System()’:
    System.cc:(.text+0x4fd7): undefined reference to `PTAMM::VideoSource::VideoSource()’
    System.cc:(.text+0x5003): undefined reference to `PTAMM::VideoSource::Size()’
    System.cc:(.text+0x5495): undefined reference to `PTAMM::VideoSource::Size()’
    System.cc:(.text+0x55cf): undefined reference to `PTAMM::VideoSource::Size()’
    System.cc:(.text+0x57a9): undefined reference to `PTAMM::VideoSource::Size()’
    System.cc:(.text+0x5b8c): undefined reference to `PTAMM::VideoSource::Size()’
    System.o:System.cc:(.text+0x5c0b): more undefined references to `PTAMM::VideoSource::Size()’ follow
    Games.o: In function `PTAMM::LoadAGame(std::basic_string<char, std::char_traits, std::allocator >, std::basic_string<char, std::char_traits, std::allocator >)’:
    Games.cc:(.text+0x306): undefined reference to `PTAMM::ShooterGame::ShooterGame()’
    collect2: ld returned 1 exit status

    can anybody help?
    Thanks

  15. georgklein says:

    Looks like no video source is being compiled, and maybe this ShooterGame is missing too. Does your makefile try to build these two files?

    • Dennis Stahlhut says:

      Both are localised in the source-folder and the source of the video source is correctly named in the makefile (i’ve used the OpenCV one and it works fine with PTAM). I just changed the Makefile in the way i did with PTAM. (ShooterGame is located in the folder)

  16. Puneeth says:

    Hi George,

    I got PTAM working with OpenCV using Kameda’s script. I was trying to use PTAMM, I used the the OpenCV video source file from Arnaud. It complies well, except for these warnings:


    System.cc: In member function ‘void PTAMM::System::SaveFIFO()’:
    System.cc:651: warning: ignoring return value of ‘int posix_memalign(void**, size_t, size_t)’, declared with attribute warn_unused_result
    System.cc:667: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result
    MapMaker.cc: In member function ‘TooN::SE3 PTAMM::MapMaker::CalcPlaneAligner()’:
    MapMaker.cc:1230: warning: ‘v3BestMean.TooN::Vector::.TooN::Internal::VBase::VLayout::.TooN::Internal::GenericVBase<3, double, 1, TooN::Internal::VectorAlloc >::.TooN::Internal::VectorAlloc::.TooN::Internal::StaticSizedAllocator::.TooN::Internal::StackOrHeap::my_data[2]’ may be used uninitialized in this function
    MapMaker.cc:1230: warning: ‘v3BestMean.TooN::Vector::.TooN::Internal::VBase::VLayout::.TooN::Internal::GenericVBase<3, double, 1, TooN::Internal::VectorAlloc >::.TooN::Internal::VectorAlloc::.TooN::Internal::StaticSizedAllocator::.TooN::Internal::StackOrHeap::my_data[1]’ may be used uninitialized in this function
    MapMaker.cc:1230: warning: ‘v3BestMean.TooN::Vector::.TooN::Internal::VBase::VLayout::.TooN::Internal::GenericVBase<3, double, 1, TooN::Internal::VectorAlloc >::.TooN::Internal::VectorAlloc::.TooN::Internal::StaticSizedAllocator::.TooN::Internal::StackOrHeap::my_data[0]’ may be used uninitialized in this function
    MapMaker.cc:1231: warning: ‘v3BestNormal.TooN::Vector::.TooN::Internal::VBase::VLayout::.TooN::Internal::GenericVBase<3, double, 1, TooN::Internal::VectorAlloc >::.TooN::Internal::VectorAlloc::.TooN::Internal::StaticSizedAllocator::.TooN::Internal::StackOrHeap::my_data[2]’ may be used uninitialized in this function
    MapMaker.cc:1231: warning: ‘v3BestNormal.TooN::Vector::.TooN::Internal::VBase::VLayout::.TooN::Internal::GenericVBase<3, double, 1, TooN::Internal::VectorAlloc >::.TooN::Internal::VectorAlloc::.TooN::Internal::StaticSizedAllocator::.TooN::Internal::StackOrHeap::my_data[1]’ may be used uninitialized in this function
    MapMaker.cc:1231: warning: ‘v3BestNormal.TooN::Vector::.TooN::Internal::VBase::VLayout::.TooN::Internal::GenericVBase<3, double, 1, TooN::Internal::VectorAlloc >::.TooN::Internal::VectorAlloc::.TooN::Internal::StaticSizedAllocator::.TooN::Internal::StackOrHeap::my_data[0]’ may be used uninitialized in this function

    The programs starts fine but no video from cam instead get grey pactches. I added a snapshot.

    Any hints where I might be going wrong?

  17. kdjado says:

    Hello,

    I am trying to run PTAM on windows using Visual Studio 2005. I download all indicated library and I always have some linkage errors when I build the CameraCalibrator project.

    error LNK2019: unresolved external symbol _dgesvd_ referenced in function “private: void __thiscall TooN::SVD::do_compute(void)” (?do_compute@?$SVD@$0?0$0?0N@TooN@@AAEXXZ)

    error LNK2001: unresolved external symbol _dgesvd_

    error LNK2019: unresolved external symbol __imp__glewGetErrorString referenced in function “public: __thiscall GLWindow2::GLWindow2(class CVD::ImageRef,class std::basic_string<char,struct std::char_traits,class std::allocator >)” (??0GLWindow2@@QAE@VImageRef@CVD@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

    error LNK2019: unresolved external symbol __imp__glewInit referenced in function “public: __thiscall GLWindow2::GLWindow2(class CVD::ImageRef,class std::basic_string<char,struct std::char_traits,class std::allocator >)” (??0GLWindow2@@QAE@VImageRef@CVD@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

    Any idea?
    Is it possible to get a version of the project on Visual Studio with all the external libs and codes that work?

    Thanks in advance,

    Khalid.

  18. Truyenle says:

    I’m trying to get OpenCV working in window. I’m using MS VS2008.
    Using Arnaud Grosjean wrapper and follow Aaron Wetzler suggestion of changing type to CVD::type + exclude the line #include .
    So I place the modified file VideoSource_Linux_OpenCV.cc under PTAM folder.

    Everything seems ok until I compile the project. Here is the error that I have.
    error LNK2019: unresolved external symbol “public: int __thiscall videoInput::getHeight(int)” (?getHeight@videoInput@@QAEHH@Z) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj CameraCalibrator
    error LNK2019: unresolved external symbol “public: int __thiscall videoInput::getWidth(int)” (?getWidth@videoInput@@QAEHH@Z) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj CameraCalibrator
    error LNK2019: unresolved external symbol “public: bool __thiscall videoInput::setupDevice(int,int,int)” (?setupDevice@videoInput@@QAE_NHHH@Z) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj CameraCalibrator
    error LNK2019: unresolved external symbol “public: void __thiscall videoInput::setIdealFramerate(int,int)” (?setIdealFramerate@videoInput@@QAEXHH@Z) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj CameraCalibrator
    error LNK2019: unresolved external symbol “public: __thiscall videoInput::videoInput(void)” (??0videoInput@@QAE@XZ) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj CameraCalibrator
    error LNK2019: unresolved external symbol “public: bool __thiscall videoInput::getPixels(int,unsigned char *,bool,bool)” (?getPixels@videoInput@@QAE_NHPAE_N1@Z) referenced in function “public: void __thiscall VideoSource::GetAndFillFrameBWandRGB(class CVD::Image &,class CVD::Image<class CVD::Rgb > &)” (?GetAndFillFrameBWandRGB@VideoSource@@QAEXAAV?$Image@E@CVD@@AAV?$Image@V?$Rgb@E@CVD@@@3@@Z) VideoSource_Win32_LibVideoInput.obj CameraCalibrator
    error LNK2019: unresolved external symbol “public: bool __thiscall videoInput::isFrameNew(int)” (?isFrameNew@videoInput@@QAE_NH@Z) referenced in function “public: void __thiscall VideoSource::GetAndFillFrameBWandRGB(class CVD::Image &,class CVD::Image<class CVD::Rgb > &)” (?GetAndFillFrameBWandRGB@VideoSource@@QAEXAAV?$Image@E@CVD@@AAV?$Image@V?$Rgb@E@CVD@@@3@@Z) VideoSource_Win32_LibVideoInput.obj CameraCalibrator
    fatal error LNK1120: 7 unresolved externals C:\PTAM\PTAM\CameraCalibrator\Debug\CameraCalibrator.exe CameraCalibrator
    Error 9 error LNK2019: unresolved external symbol “public: int __thiscall videoInput::getHeight(int)” (?getHeight@videoInput@@QAEHH@Z) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj PTAM
    Error 10 error LNK2019: unresolved external symbol “public: int __thiscall videoInput::getWidth(int)” (?getWidth@videoInput@@QAEHH@Z) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj PTAM
    Error 11 error LNK2019: unresolved external symbol “public: bool __thiscall videoInput::setupDevice(int,int,int)” (?setupDevice@videoInput@@QAE_NHHH@Z) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj PTAM
    Error 12 error LNK2019: unresolved external symbol “public: void __thiscall videoInput::setIdealFramerate(int,int)” (?setIdealFramerate@videoInput@@QAEXHH@Z) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj PTAM
    Error 13 error LNK2019: unresolved external symbol “public: __thiscall videoInput::videoInput(void)” (??0videoInput@@QAE@XZ) referenced in function “public: __thiscall VideoSource::VideoSource(void)” (??0VideoSource@@QAE@XZ) VideoSource_Win32_LibVideoInput.obj PTAM
    Error 14 error LNK2019: unresolved external symbol “public: bool __thiscall videoInput::getPixels(int,unsigned char *,bool,bool)” (?getPixels@videoInput@@QAE_NHPAE_N1@Z) referenced in function “public: void __thiscall VideoSource::GetAndFillFrameBWandRGB(class CVD::Image &,class CVD::Image<class CVD::Rgb > &)” (?GetAndFillFrameBWandRGB@VideoSource@@QAEXAAV?$Image@E@CVD@@AAV?$Image@V?$Rgb@E@CVD@@@3@@Z) VideoSource_Win32_LibVideoInput.obj PTAM
    Error 15 error LNK2019: unresolved external symbol “public: bool __thiscall videoInput::isFrameNew(int)” (?isFrameNew@videoInput@@QAE_NH@Z) referenced in function “public: void __thiscall VideoSource::GetAndFillFrameBWandRGB(class CVD::Image &,class CVD::Image<class CVD::Rgb > &)” (?GetAndFillFrameBWandRGB@VideoSource@@QAEXAAV?$Image@E@CVD@@AAV?$Image@V?$Rgb@E@CVD@@@3@@Z) VideoSource_Win32_LibVideoInput.obj PTAM
    Error 16 fatal error LNK1120: 7 unresolved externals C:\PTAM\PTAM\PTAM\Debug\PTAM.exe PTAM

    georgklein already mentioned that we need to link these library? How can we do this? Please shed some more light.

    Sorry if my question is dump! I used to be a C/C++/C# guy for such a long time and just back for couple of years and almost forgot everything.

    Thanks

    Thanks

    • georgklein says:

      Remove VideoSource_Win32_LibVideoInput.cc from the compilation, since you’ve replaced it with another one. Then the linker errors not finding libvideoinput will go away.

  19. Truyenle says:

    Never mind, I got it work by link to OpenCV\Lib. This can be done under Project -> properties -> Linker -> input -> Additional Dependencies => past all the .lib files’ names here. Note that file name with d is for debug and file name without d is for release.

  20. Truyenle says:

    Trying to get PTAMM working on windows XP but not. I used Arnaud Grosjean’s code for the video. Here is the error when I compile
    Error 83 error LNK2019: unresolved external symbol “public: class CVD::ImageRef __thiscall PTAMM::VideoSource::Size(void)” (?Size@VideoSource@PTAMM@@QAE?AVImageRef@CVD@@XZ) referenced in function “public: __thiscall PTAMM::CameraCalibrator::CameraCalibrator(void)” (??0CameraCalibrator@PTAMM@@QAE@XZ) CameraCalibrator.obj CameraCalibrator
    Error 84 error LNK2019: unresolved external symbol “public: __thiscall PTAMM::VideoSource::VideoSource(void)” (??0VideoSource@PTAMM@@QAE@XZ) referenced in function “public: __thiscall PTAMM::CameraCalibrator::CameraCalibrator(void)” (??0CameraCalibrator@PTAMM@@QAE@XZ) CameraCalibrator.obj CameraCalibrator
    Error 85 error LNK2019: unresolved external symbol “public: void __thiscall PTAMM::VideoSource::GetAndFillFrameBWandRGB(class CVD::Image &,class CVD::Image<class CVD::Rgb > &)” (?GetAndFillFrameBWandRGB@VideoSource@PTAMM@@QAEXAAV?$Image@E@CVD@@AAV?$Image@V?$Rgb@E@CVD@@@4@@Z) referenced in function “public: void __thiscall PTAMM::CameraCalibrator::Run(void)” (?Run@CameraCalibrator@PTAMM@@QAEXXZ) CameraCalibrator.obj CameraCalibrator
    Error 86 fatal error LNK1120: 3 unresolved externals C:\PTAM\PTAMM\CameraCalibrator\Debug\CameraCalibrator.exe CameraCalibrator
    Error 92 error C3861: ‘swap’: identifier not found c:\ptam\include\toon\symeigen.h 185 PTAMM
    Error 93 error C3861: ‘swap’: identifier not found c:\ptam\include\toon\symeigen.h 187 PTAMM
    Error 94 error C3861: ‘swap’: identifier not found c:\ptam\include\toon\symeigen.h 189 PTAMM

    Any one face this issue, please help?

    Thanks
    Truyen

  21. Truyen says:

    I get it work finally by using libcvd-20090520 not libcvd-20100511.zip. And I have to add all the files under pm_src to the project.

    PTAMM is working now under window xp however I have another problem when I try to place models on the window. Here is the error message
    “Failed to load icon image ARData/Overlays/model_browser.png: Image input: Unsuppported image type.”

    Although I try all the steps recommended to support .png under the installation manual here http://www.robots.ox.ac.uk/~bob/software/ptamm/manual.pdf.

    Any idea?

    Thanks

    • georgklein says:

      It really looks like the version of libCVD you installed doesn’t support PNGs / isn’t seeing your libpng installation. You could work around this by e.g. converting the pngs to jpegs or something else which libCVD supports. I don’t think you necessarily even have to change the file extension.

  22. SagarJ says:

    Hello Guys,

    Just started working on this amazing stuff. I got it working on KAmeda’s precooked Linux which works great but has some problem with the OpenGL and hence is very slow.
    So I compiled this on my Ubuntu 10.10 and that too went smoothly.

    But when I tried calibrating the camera using CalibrateCalibrator, the camera starts working and the video streams, but as soon as I grab image for calibration, the code crashes with segmentation fault.

    Does anyone know why this is happening. I would really appreciate if you could help me out of this.. this is how it looked
    Welcome to CameraCalibrator
    ————————————–
    Parallel tracking and mapping for Small AR workspaces
    Copyright (C) Isis Innovation Limited 2008

    | You may try these options at command line (by Y.Kameda, 2010/10)
    | -coloron … If you unfortunately see black image, try this
    | 0 … Select 1st USB camera
    | 1 … Select 2nd USB camera (and 2 for 3rd, …)
    | http://192.168.1.183/mjpg/video.mjpg … network streaming

    KMD: parsing command line options …
    Parsing calibrator_settings.cfg ….
    VideoSource_Linux: Opening video source…
    > … got video source.
    Segmentation fault

    Thanks a lot,

    Cheers,
    Sagar

    • georgklein says:

      Can you run this in the debugger and provide a stack trace?

      • Jacob Bowen says:

        Hi,

        I believe that I’m experiencing the same problem as SagarJ.
        I get the following stack trace from gdb.

        $ gdb CameraCalibrator
        GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2

        (gdb) run
        Starting program:
        ~/PTAM/CameraCalibrator
        [Thread debugging using libthread_db enabled]
        Welcome to CameraCalibrator
        ————————————–
        Parallel tracking and mapping for Small AR workspaces
        Copyright (C) Isis Innovation Limited 2008

        Parsing calibrator_settings.cfg ….
        [New Thread 0x43efb70 (LWP 3693)]
        VideoSource_Linux: Opening video source…
        … got video source.
        >
        Program received signal SIGSEGV, Segmentation fault.
        0x0805c2d9 in conversionRGB (frame=…, imRGB=…) at VideoSource_Linux_OpenCV.cc:71
        71 imRGB[i][j].red = frame_p(i,j)[2];
        (gdb) bt
        #0 0x0805c2d9 in conversionRGB (frame=…, imRGB=…) at VideoSource_Linux_OpenCV.cc:71
        #1 0x0805c603 in VideoSource::GetAndFillFrameBWandRGB (this=0xbffff0f0, imBW=…, imRGB=…) at VideoSource_Linux_OpenCV.cc:86
        #2 0x08073c47 in CameraCalibrator::Run() ()
        #3 0x08076f2b in main ()

        Let me know if any further information would be helpful.

        Thanks,
        Jake

      • Jacob Bowen says:

        Assuming that SagarJ and I were experiencing exactly the same problem, it turns out to be an issue with video frame dimensions. The input video frame dimensions are hard coded in VideoSource_Linux_OpenCV.cc as 640×480 in the form of two macros (OPENCV_VIDEO_W and OPENCV_VIDEO_H). I removed the macros and changed the mirSize initialization line to

        mirSize = ImageRef((int)cap->get(CV_CAP_PROP_FRAME_WIDTH), (int)cap->get(CV_CAP_PROP_FRAME_HEIGHT));

        and I changed the conversionNB and conversionRGB functions to iterate over the retrieved dimensions by passing mirSize to each function and replacing OPENCV_VIDEO_W and OPENCV_VIDEO_H with mirSize.x and mirSize.y, respectively, in the for loops.

        I hope this helps someone!

        – Jake

  23. horizongir says:

    Finally got PTAM to compile and run on windows 7 x64 using Visual Studio C++ 2010 Express. Works great and the performance so far is flawless. Thanks guys, it’s absolutely awesome!

    PTAMM still doesn’t work because of conflicts between C-runtime versions of compiled libraries. Have to recompile everything to make it work I guess, but for now it can wait.

    As the CMU drivers were problematic, I wrote myself a new video source based on the NUI group CLEye driver for the Playstation Eye camera. You can learn more about it here: http://codelaboratories.com/kb/CL-Eye-Platform-Documentation/

    Here’s the source (for Win32) in case anyone is interested:
    http://www.box.net/shared/o4xp3z2y5lfonyd2hsdb

    Cheers,
    Gonçalo

    • robozyt says:

      Hey Goncalo,

      Would you mind sharing your visual studio 2010 express project? I’m kind of struggling to get it working, so a working solution would be the perfect starting point to take a closer look at PTAM!

      Thanks in advance,
      David

  24. oftensa says:

    Hi
    I am a student working on PTAM ,and now I am studying with you code, but there is something questions make me

    confused.In the function “void HomographyInit::RefineHomographyWithInliers()” which is used for refining the

    homography.
    1) the code “Vector v2Error = mvHomographyInliers[i].m2PixelProjectionJac * (v2Second_real – v2Second);”

    why do you describe the error using this expression
    2) and the code “vmJacobians.push_back(mvHomographyInliers

    [i].m2PixelProjectionJac * m29Jacobian);” why the the “m2PixelProjectionJac * m29Jacobian” and what’s the Physical

    Interpretation of “m2PixelProjectionJac”?
    Best regards!

  25. truyenle says:

    Hello sir,

    I’m using OpenCV in my PTAM, is there a way that we can make it full screen instead of 640×480. I modified this values in VideoSource_Linux_OpenCV.cc, it didn’t work.

    #define OPENCV_VIDEO_W 800
    #define OPENCV_VIDEO_H 600

    Any idea how to make it fullscreen, please help to share.

    Thank you
    Truyenle

  26. Sameer says:

    I am trying to run PTAM on Windows 7 x64 using VS2008, I have a Lenovo machine and trying to use the inbuilt webcam as video source.
    I am using VideoSource_Win32_LibVideoInput.cc as my video source , I am successfully able to build the PTAM project but when .exe runs nothing happens,cameracalibator.exe or PTAM.exe just sit on the screen, a black dos prompt opens, no text is written on it and no video window opens.
    Can someone please guide me what am I doing wrong here

  27. Lars says:

    Trying to run PTAM with a Point Grey Chameleon on Linux — has anyone already adapted the videosource file for the point grey to linux?

    • Lars says:

      Got as far a that the FlyCapture2.h is being included, but still get loads of undefined reference to errors, basically for each that is being used, i.e.. ‘FlyCapture2::Image::Image()’, ‘FlyCapture2::Camera::Connect(FlyCapture2::PGRGuid*)’, etc.
      Any ideas?
      Thanks!

      • georgklein says:

        Looks like you’re including the headers, but still need to link the library. See if you’re passing a -L parameter which points to the library directory and a -l parameter which points to the lib.a

      • Lars says:

        Thanks, it’s working fine now!
        We are now trying to stabilise quadrocopters with PTAM…

  28. Kay says:

    Would you also be able to share the videosource for Logitech C910?
    I saw on the OSX guide that, the you were able to get C910 to work on mac.
    I am trying to use C910 on linux 11.10, and my videosource keeps crashing.

  29. mikael says:

    Hi
    Tried to use a Flycapture chameleon camera , standard source gets buggy, this one works for me. Small changes but the conversions here are likely easier to extend to other pointgrey cameras, hope it helps someone.

    #include “VideoSource.h”
    #include
    #include
    #include

    using namespace std;
    using namespace CVD;
    using namespace GVars3;
    using namespace FlyCapture2;

    static void PrintErrorAndExit( Error error )
    {
    error.PrintErrorTrace();
    cout<<"Camera crash "< 0);

    error = busMgr.GetCameraFromIndex(0, &guid);
    if (error != PGRERROR_OK) PrintErrorAndExit(error);

    error = cam.Connect(&guid);
    if (error != PGRERROR_OK) PrintErrorAndExit(error);

    CameraInfo camInfo;
    error = cam.GetCameraInfo(&camInfo);
    if (error != PGRERROR_OK) PrintErrorAndExit(error);

    printf(
    “\n*** CAMERA INFORMATION ***\n”
    “Serial number – %u\n”
    “Camera model – %s\n”
    “Camera vendor – %s\n”
    “Sensor – %s\n”
    “Resolution – %s\n”
    “Firmware version – %s\n”
    “Firmware build time – %s\n\n”,
    camInfo.serialNumber,
    camInfo.modelName,
    camInfo.vendorName,
    camInfo.sensorInfo,
    camInfo.sensorResolution,
    camInfo.firmwareVersion,
    camInfo.firmwareBuildTime );

    // Start capturing images at 1280x960xY8
    // You probably need to change this stuff for your camera
    mirSize=ImageRef(1280,960);
    error = cam.SetVideoModeAndFrameRate(VIDEOMODE_1280x960Y8, FRAMERATE_15); // read at this to get rgb…
    if (error != PGRERROR_OK) PrintErrorAndExit(error);

    error = cam.StartCapture();
    if (error != PGRERROR_OK) PrintErrorAndExit(error);
    };

    void VideoSource::GetAndFillFrameBWandRGB(CVD::Image &imBW, CVD::Image<CVD::Rgb > &imRGB)
    {
    imRGB.resize(mirSize);
    imBW.resize(mirSize);
    FlyCapture2::Image imCap;
    cam.RetrieveBuffer(&imCap);
    FlyCapture2::Image cRGB;

    error = imCap.Convert( FlyCapture2::PIXEL_FORMAT_RGB8, &cRGB ); if (error != FlyCapture2::PGRERROR_OK) { error.PrintErrorTrace(); exit(0); }

    CVD::Rgb* data=(CVD::Rgb*)cRGB.GetData();
    CVD::BasicImage<CVD::Rgb > b=CVD::BasicImage<CVD::Rgb >(data,mirSize);
    imRGB.copy_from(b);
    copy(imRGB, imBW);
    }

    ImageRef VideoSource::Size()
    {
    return mirSize;
    }

  30. Bill says:

    Is there anyone interested in updating this library for the three main desktop platforms? This library is so powerful it deserves to be updated and made easier to get running! I’ll absolutely help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s