Troubleshooting / FAQ

Some common problems encountered running PTAM.

General Issues

Q: Frame-rate is low, is this normal?
A: No. A low frame-rate is normal for the camera calibrator (around 1 Hz) but PTAM should easily run at 30 Hz. Check that the video input supports 30Hz at the color depth used, and check OpenGL drivers (especially on Linux.) If you’re not getting 30Hz from your video source the system will not be robust.

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.

Q: Can I have the source code to the iPhone version?
A: No, sorry. The iphone version can only be licensed commercially and is not available for free.

Q: Can I have the source code with the edges?
A: That will be made available as soon as I’ve had a chance to tidy it up.

Q: Tracking isn’t as robust as in your videos, why not?
A: The 2007 videos of PTAM are not exceptional and not particularly cherry-picked, and are completely representative of the performance you should get from the system. If you’re getting unstable tracking this is usually easily fixable. The three most common culprits are 1. Bad camera calibration; 2. Lens used is not wide-angle enough; 3. You’re trying to start the system by rotating the camera, instead of translating it. Keep in mind that monocular SLAM systems are a bit fiddly and take some getting used to. You can’t just wave the camera around in any random way, you have to watch what’s happening as you move around.

Q: How do I check if my calibration is bad?
A: A quick sanity check is to look at the third and fourth digits of Camera.Parameters. These represent the camera center in the image and both numbers should be around 0.5, i.e. the camera center is near the center of the image. Also while calibrating the pixel aspect ratio should probably be around 1.0.

Q: I get crashes on Windows
A: Try commenting out the MoveBadPointsToTrash() call in MapMaker.cc.

Q: I get dropped frames and jerky performance on Windows
A: For some reason PTAM runs very badly in the MSDEV debugger environment, even with a release build. Select “Run without debugger” instead.

Compilation Issues
Q: I get the compile error
SmallBlurryImage.cc:131: error: ‘transform’ is not a member of ‘CVD’
A: You didn’t install TooN before libCVD. Re- ./configure and re-build libCVD.

Q: I get the compile error
GLWindow2.cc:117: error: cannot convert ‘CVD::ImageRef’ to ‘GLdouble’ for argument ‘1’ to‘void glOrtho(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble)’
A: You didn’t install TooN before libCVD. Re- ./configure and re-build libCVD.

Q: I get the link error
(some file).cc:(.text+0x65a): undefined reference to `dgesvd_'
A: Make sure BLAS and LAPACK are installed on your system.

Q: I’m getting all sorts of strange linker errors on Windows
A: Make sure that PTAM and libCVD and GVars all use the same run-time library (static vs. dll, debug vs. release); Make sure they all have the same setting for whole-program optimization on or off.

———-

Feel free to post queries in the comments below. Please don’t just copy-paste ten pages of error messages from your compiler! Trim your comments to the pertinent bits. If you get 100 errors which look almost the same just trim it to one or two.

376 Responses to Troubleshooting / FAQ

  1. Dear George,

    Sir,I just want to say that this is a great effort on your part to start a blog on PTAM because this is one of the most robust and amazing systems available in the area of natural feature tracking and its a huge favour to the computer vision research community as well.

    What I would like to ask is that I am sure (like me) there are a lot of ppl using this system and newbies like me might have some questions regarding the system .

    Would it be possible to answer some selected qns for the benefit of us?Probaly a Q & A section to the site may be most beneficial for ppl like me who are just starting their way into computer vision.

    Once again Sir,I congratulate you for PTAMM,winning ISMAR and ur new job @ microsoft!

    Lookinf forward to hearing from you and wishing you all the very best,

    Kindest Regards
    Rahul

  2. Hagen says:

    Hi George,
    I tried as you suggest to compile PTAM on Snow Leopard in 32 bit.
    I compiled therefore libcvd with ./configure CXXFLAGS=-m32 LDFLAGS=-m32.
    works well. The console says now that it finds Qucktime.
    Tried to do the same with gvars but the configure seemed not to change the build process.
    However I tried to set -m32 then also in the makefile of PTAM. It compiles fine.
    While linking it strangly says: libcvd and gvars are not of required architecture. And I get tons of undefined symbols.
    Whats wrong here?

    • georgklein says:

      Can you check what happens when you write `file libcvd-0.8.dylib’? Does it say i386 or x86-64 binary?

      • Hagen says:

        though i configured to libcvd compile with -m32 it still says x86-64.
        But tomorrow Ill try to go with the opencv-video source from grosjean. looks very promising to me.

        thx very much

      • Hello hagen, some code disappeared due to the restriction of character like “<", you can find here the implementation for OpenCV, actually I still have a segfault using it, tell me if it also occurs for you. Thx

        Code here

  3. Hi George,
    I’m very interested in your work and tried to compile PTAM on linux.
    Firstly I did a basic compilation using the V4L video source. Unfortunatlely CVD was unable to find my camera (which I already used with OpenCV and V4L !!??)
    So I decided to write my own implementation of VideoSource.h to grab the frame with OpenCV 2.1 and turn it into an CVD Image

    Here is my implementation :

    // Copyright 2008 Isis Innovation Limited
    #include "VideoSource.h"
    #include
    #include
    #include
    #include
    #include
    #include
    #include

    using namespace CVD;
    using namespace std;
    using namespace GVars3;
    using namespace cv;

    VideoSource::VideoSource()
    {
    cout << " VideoSource_Linux: Opening video source..." <isOpened()){
    cerr << "Unable to get the camera" << endl;
    exit(-1);
    }
    cout << " ... got video source." << endl;
    mirSize = ImageRef(640,480);
    };

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

    void conversionNB(Mat &frame, Image &imBW){
    Mat_& frame_p = (Mat_&)frame;
    for (int i = 0; i < 480; i++){
    for (int j = 0; j < 640; j++){
    imBW[i][j] = (frame_p(i,j)[0] + frame_p(i,j)[1] + frame_p(i,j)[2]) / 3;
    }
    }

    }

    void conversionRGB(Mat &frame, Image<Rgb > &imRGB){
    Mat_& frame_p = (Mat_&)frame;
    for (int i = 0; i < 480; i++){
    for (int j = 0; j < 640; j++){
    imRGB[i][j].red = frame_p(i,j)[0];
    imRGB[i][j].green = frame_p(i,j)[1];
    imRGB[i][j].blue = frame_p(i,j)[2];
    }
    }
    }

    void VideoSource::GetAndFillFrameBWandRGB(Image &imBW, Image<Rgb > &imRGB)
    {
    Mat frame;
    VideoCapture* cap = (VideoCapture*)mptr;
    *cap >> frame;
    conversionNB(frame, imBW);
    conversionRGB(frame, imRGB);
    frame.release();
    }

    —————————————–
    This implementation actually works, I see an image when running the calibration. nevertheless when I try to grab a frame for calibration purpose, I get a SegFault.
    Could you please help me finding what’s wrong ?

    Regards.

    • georgklein says:

      Probably a different bug in the Calibrator. Try checking if PTAM works with the video input code. If PTAM complains about no calibration, just try a dummy camera.cfg which says Camera.Parameters=[1 1.333 0.5 0.5 0]

      • I tried to create the dummy camera cfg, and another segmentation fault occur after stereo init (2nd spacebar push).

      • Hi!
        I found where the problem could be.
        It seems to be a problem in dynamic linking, between TooN and OpenCV,
        In TooN/SVD.h line 159, there is a call to:
        dgesvd_( &JOBVT, &JOBU, &m, &n, a, &lda, s, uorvt,
        &ldvt, uorvt, &ldu, wk, &LWORK, &INFO);
        which seems to call a routine from OpenCV instead TooN.

        Here is the stacktrace for this error :
        0x000000000042162e in HomographyInit::HomographyFromMatches () at /usr/local/include/TooN/SVD.h:159
        0x00007f9d4128cfae in dgesvd_ () from /usr/lib/liblapack.so.3gf
        0x00007f9d42a41fb0 in dlange_ () from /usr/lib/libcxcore.so.2.0

        I really don’t know how to solve this. Any idea ? Thanx.

      • georgklein says:

        What order do you specify libraries to the linker? Check that -llapack -lblas come before -lopencv.

      • Actually, the lapack lib is linked to CVS and not directly to PTAM.
        In the PTAM Makefile, I put the libs in this order :

        LINKFLAGS = -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd -lcv -lcxcore -lhighgui

      • georgklein says:

        Perhaps try linking BLAS/LAPACK explicitly early on in the linker line.

      • Thx, it works !
        Would you like me to write a little howto about using OpenCV ?

      • georgklein says:

        I’ll make a new page for video input stuff, I could post it there. Perhaps you could put the instructions in comments at the top of you code, along with whatever attribution you want? Probably something other than (c) Isis Innovation

    • I’ll make a comment in the new section. For the attribution, I really don’t know. My contribution is too small to put a copyright…

      • georgklein says:

        Just put your name in there. If you don’t mind I’ll copy-paste your stuff from the comment to the page itself. In hindsight should probably have made this a bulletin board rather than a blog..

      • No problem for me, you can delete all the topic on this page, it seems to be useless now.

      • gottfriedg says:

        Regarding the OpenCV-LAPACK problem, I think it might be related to OpenCV bundling a copy of lapack which results in different behaviour depending on the order of linking. I had a similar problem some time ago and wrote a patch for OpenCV to use system lapack if installed, this solved the problem (i didn’t try playing around with the linking order though…)

        The patch also seems to work against OpenCV-2.1.0:

    • Reena says:

      Hello Sir
      I would like to know about the header files you included in the above code because I too am trying with another web cam and when I tried your code I got a lot of opengl error . Could I also get a clear instructions on how you did it. This the error i got till now:

      >C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\gl/gl.h(1152): error C2144: syntax error : ‘void’ should be preceded by ‘;’
      1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\gl/gl.h(1152): error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
      1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\gl/gl.h(1152): error C2146: syntax error : missing ‘;’ before identifier ‘glAccum’
      1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\gl/gl.h(1152): error C2182: ‘APIENTRY’ : illegal use of type ‘void’
      1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\gl/gl.h(1152): error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
      1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\gl/gl.h(1153): error C2144: syntax error : ‘void’ should be preceded by ‘;’
      1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\gl/gl.h(1153): error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
      1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\gl/gl.h(1153): error C2086: ‘int WINGDIAPI’ : redefinition

      So would like to know about the header files you included.and if possible on how to sove this problem and instructions on how you changed the code. I am using OpenCV 2.4.4 in VS2010 in Windows7

  4. David Kim says:

    I successfully compiled the PTAM code on wondows (and it seems working. yey!);
    but there’s some framedrop issues.
    I am using Point Grey’s FLEA2-FL2-08S2M camera;
    and it is supposed to be fast as 30fps with 1032×776 resolution.
    But, the framerate that I get is lower than 15 fps with 640×480 resolution.
    I am not sure if this is caused because of the CMU 1394 driver, or the Windows.
    If there’s any known causes of this framedrop phenomenon, please share me some wisdom. 🙂

  5. Remi Fusade says:

    Hello Georg.

    First, thank you for PTAM, this blog and for your involvement.
    I use PTAM on Windows 7 and VS 2008, it works perfectly! Even if I changed a few things (like color display and saving/loading map from PTAMM source code).
    By the way, I contacted you by e-mail for the color display, and now it works perfectly at 30 fps, thank you again ^^.

    Now I would like your advice on one thing: I am currently trying to use PTAM on a robot (just a moving camera).
    I want to use odometry measures to help PTAM. Our robot won’t move vertically, and will also move a little slower, and in a more stable way, than a hand-held camera. So I probably have some modifications to make on the current probabilistic model.
    I already looked at the motion model of the tracker, but I don’t think there are probabilities here.

    Maybe have you an idea on that issue ?
    Where is all the PTAM stuff which could use odometry to become stronger ?

    Here are some extra informations, don’t hesitate to ask me if you have questions:
    We can access informations on x and y translation (on the ground-plane), an alpha for rotation around vertical axis, plus the pitch and yaw of our camera (no roll).
    We don’t have any probabilistic model for the measure errors, but we probably can create one.
    We already made something to rescale PTAM and the real world, so our odometric measures are consistent with PTAM frame.

    Thank you for your help.

    Best regards.
    Rémi.

    PS: Sorry for my poor English, I’m a French student.

    • georgklein says:

      Adding odometry to the estimation may not be trivial, since there is a calibration step where you need to find the transform between your vision sensor and the robot. But if you can find this you can then include the information as a prior or measurement in the pose update equations. If you want to rely on odometry to take you past regions of low feature density, that would need much more extensive modification of the code.

      • Remi Fusade says:

        Sorry, I may have made a mistake with reply buttons.
        My answer is bellow.

        Note: when I spoke about “smaller” volume of probability, I just meant volume with a smaller variance (ie: with values more concentrated around center)

    • Truyenle says:

      Hi Remi Fusade,

      I’m interesting in how to setup PTAM working on windows 7 with MS VS 2008. Can you just show the steps how you get this?

      Thank you so much.

  6. Remi Fusade says:

    I already did the calibration step, now my issues are more on the probabilistic model.

    I suppose that, in PTAM, you consider a sort of sphere of probability to guess the next position of camera. But with my robot this sphere would be more like an ovoid (because the probable position of the camera would be on the move axis, given by odometry), and I also expect this new probability volume to be a lot smaller than the first one.
    I don’t know if my vision of things is correct, nor if my explanations are clear.
    I had a quick look to this part of the code but I don’t really understand how it works, so if you have some hints about the probabilistic model you use. I guess there are things in Tracker::CalcPoseUpdate.

    Following the camera even when tracking is lost is another thing, for now I’m not looking at that.

    Thank you for your help.

    • georgklein says:

      I’ll assume that maybe you’re familiar with Kalman filters and put it in context to that. In a Kalman filter you’d do a single linearised update step per frame. In PTAM, the update per frame is iterative, I think it actually re-linearises and updates a few times (10 maybe?) per frame. This is less because of linearisation than because of the use of robust M-Estimators, which must be iterated to converge. Much like in a Kalman filter, each iteration has a prior; given a Jacobian matrix J, instead of inverting J^T * J, we instead invert J^T * J + P, where P is the 6×6 prior matrix (usually the identity). This is like giving each iteration a measurement which says `the camera update in this iteration is zero.’

      If you have some prior information from odometry, you need to put that in as a measurement. Remember that PTAM calculates pose updates as changes from the current pose. Your information is probably of the form `the camera position is here’ rather than `the motion update in this iteration is zero’, so you’ll have to do some converting and add the constraint on both sides of the least squares equation.

      • Remi Fusade says:

        Thank you for your answer, I think I see what you mean.
        Fortunately, my information are movements and not position updates. I just have to convert them as movements of camera, instead of movements of robot.
        As soon as I can test it with the prototype, I’ll tell you if the results are good.

  7. Greg Rogala says:

    Hi George!
    Thank you for your marvellous software!
    I’ve compiled R. Castle PTAMM on linux with little help from Robert. Now I will try to compile yours. I would like to use it for my new multimedia project. What I need is to extract camera data and feed it into Blender 3D software to manipulate virtual world with real world camera movement. As far as I know the easiest way connecting external data to Blender is with OSC protocol. Can you help me? I’m just artist, not programmer…

    • georgklein says:

      Since PTAMM = (Base PTAM + some extra functionality “M” ), it should be easy to compile PTAM if you’ve already compiled PTAMM. In fact there’s no reason to do so, at the moment there’s nothing in PTAM which is not also in PTAMM. I can’t help you with the connection to blender though I’m afraid.

      • Greg Rogala says:

        So I’m on my own…
        can you tell me in which module I can find camera roll pitch yaw data?

      • georgklein says:

        Tracker.GetCurrentPose() returns an SE3 object which encodes the camera pose (essentially it’s a 4×4 matrix). You can calculate roll/pitch/yaw from the SO3 (top-left 3×3 rotation matrix) component thereof.

  8. Greg Rogala says:

    Thanks Georg
    Will try my “programming” skills…

  9. Didier Muanza says:

    Hi Georg,
    I’m trying to compile a windows version of PTAM. I read that Remi Fusade did do it perfectly. Well can anybody help me ? Is anybody ahs a sln which compile correctly on windows xp? Do i need windows 7?

    Cheers

    • georgklein says:

      I don’t think it needs anything Windows-7 specific, no. As long as you can get programmatic video input from whatever camera you have (e.g. via libvideoinput or firewire or something) you should be fine.

  10. Piratecorp says:

    Bonjour,

    J’ai un problème avec PTAMM. La compilation se passe bien mais il refuse de s’ouvrir et j’ai le message suivant:

    piratecorp@piratecorp-fix:~/Bureau/PTAM$ '/home/piratecorp/Bureau/PTAM/CameraCalibrator'
    Welcome to CameraCalibrator
    --------------------------------------
    Parallel tracking and mapping for Small AR workspaces
    Copyright (C) Isis Innovation Limited 2008

    Parsing calibrator_settings.cfg ....
    VideoSource_Linux: Opening video source...
    >
    !! Failed to run CameraCalibrator; got exception.
    Exception was:
    DVBuffer3: No cameras found.

    J’ai pourtant activé le module dv1394 et raw1394, ma caméra est bien branché, mais rien y fait.

    Pouvez-vous m’aider s’il vous plaît?

    Merci beaucoup par avance.

    • georgklein says:

      Get the software “coriander”. Can you use your camera with that? What camera is it?

      • Piratecorp says:

        coriander ne trouve pas la caméra. Pourtant elle est bien branché ( marche avec Kino, ) Ma caméra est une DSR PD170

      • Georg Klein says:

        Looks like that is a DV camera – for live video capture with dc1394 you need a DCAM camera instead, they are different standards.

  11. Piratecorp says:

    ah d’accord. Dommage. Et il n’est pas possible de modifier le protocole pris en charge pour passer en raw1394?

    • Georg Klein says:

      I don’t know. If you can get code from anywhere which captures the live video and converts it into a flat image, then you can integrate that into the code very easily. I don’t have / know of any such code though.

  12. Piratecorp says:

    Ok. Merci beaucoup pour toutes ces informations, cela m’a beaucoup aidé.

  13. Remi Fusade says:

    Hi Georg

    I have another question:
    I just try to modify the frame and scale of PTAM map, so I use the functions ApplyGlobalTransformationToMap and ApplyGlobalScaleToMap, these functions are in your PTAM source code but are not used.
    They seem to add some more instabilities to the tracking. Just after the transformation, the tracking stay completely lost for a second. And sometime (not always), the tracking have difficulties to stay “good”, even in areas with a lot of points and even a long time after the transformation.
    Did you test these functions and are they supposed to work perfectly ?
    Can I do these transformations during the tracking without risks ? (maybe I have to prevent tracking from using the map while it is being transformed)

    Thank you for your help.

    • georgklein says:

      Those functions are called right at the start by MapMaker when the map is created. That call would be in the Tracking thread and before the tracker gets the map, hence it is not an issue normally.

      If you’re calling it from the mapping thread while the tracker is running, then yes the tracker can have a hiccup. To avoid this, you’d have to synchronize to adjust this only between tracker frames. But in any case the tracker should lock on again after failure and it should all work again. If the tracker keeps failing afterwards, then this is maybe a bug.

      In any case, it should ideally not be necessary to do this. An alternative approach is to apply whatever transformation you need to your own coordinate frame externally to the SLAM system.

      • Remi Fusade says:

        Thank you for your answer.

        Your last suggestion may be a good idea, but I work really close to the Map and applying a new transformation before each computation might slow things a little.
        However, I’ll test this option. It appears to be a good way to avoid any instability.
        (But if this bug comes from my code, and I’m sure it does, I should correct it before anything else)

        Anyway, thank you again.

        Best regards.
        Rémi.

  14. Dhruv Adhia says:

    I think “checking for glDrawPixels in -lGL… no” during libcvd configuration is creating a problem.

    [15:46:22][druffzy@Dhruv-3:PTAM]$ sudo make

    g++ -g -O3 -o PTAM main.o VideoSource_OSX.o GLWindow2.o GLWindowMenu.o System.o ATANCamera.o KeyFrame.o MapPoint.o Map.o SmallBlurryImage.o ShiTomasi.o MapMaker.o Bundle.o PatchFinder.o HomographyInit.o Relocaliser.o MiniPatch.o MapViewer.o ARDriver.o EyeGame.o Tracker.o -arch i386 -framework OpenGL -framework VecLib -L/MY_CUSTOM_LINK_PATH/ -lGVars3 -lcvd
    ld: warning: directory ‘/MY_CUSTOM_LINK_PATH/’ following -L not found
    Undefined symbols:
    “CVD::GLWindow::size() const”, referenced from:
    GLWindow2::SetupWindowOrtho() in GLWindow2.o

    GLWindow2::DrawMenus() in GLWindow2.o
    GLWindow2::DrawMenus() in GLWindow2.o
    GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
    GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
    GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
    GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
    GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
    GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
    GLWindow2::SetupViewport() in GLWindow2.o
    GLWindow2::SetupViewport() in GLWindow2.o
    GLWindow2::SetupVideoRasterPosAndZoom() in GLWindow2.o
    GLWindow2::SetupVideoRasterPosAndZoom() in GLWindow2.o
    “CVD::GLWindow::init(CVD::ImageRef const&, int, std::basic_string<char, std::char_traits, std::allocator > const&)”, referenced from:
    GLWindow2::GLWindow2(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
    “CVD::glSetFont(std::basic_string<char, std::char_traits, std::allocator > const&)”, referenced from:
    GLWindow2::GLWindow2(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
    “CVD::GLWindow::handle_events(CVD::GLWindow::EventHandler&)”, referenced from:
    GLWindow2::HandlePendingEvents() in GLWindow2.o
    “CVD::GLWindow::swap_buffers()”, referenced from:
    System::Run() in System.o
    “CVD::GLWindow::~GLWindow()”, referenced from:
    GLWindow2::~GLWindow2()in main.o

    GLWindow2::GLWindow2(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
    GLWindow2::~GLWindow2()in GLWindow2.o
    GLWindow2::~GLWindow2()in GLWindow2.o
    System::System()in System.o
    “CVD::glDrawText(std::basic_string<char, std::char_traits, std::allocator > const&, CVD::TEXT_STYLE, double, double)”, referenced from:
    GLWindow2::PrintString(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o

    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make: *** [PTAM] Error 1

    Any thoughts on how to remove that error?

  15. Lee says:

    I am trying to compile PTAM. I had downloaded the required libraries, but i a list of syntax errors. Below are some of the errors:

    Error 334 error C2143: syntax error : missing ‘)’ before ‘<' c:\users\alex\desktop\ptam\mapviewer.cc 125 PTAM

    Error 336 error C2761: 'void MapViewer::DrawMap(TooN::SE3)' : member function redeclaration not allowed c:\users\alex\desktop\ptam\mapviewer.cc 125 PTAM

    Error 338 error C2143: syntax error : missing ';' before '{' c:\users\alex\desktop\ptam\mapviewer.cc 126 PTAM

    Is it really syntax error or i missed something else?

    • georgklein says:

      That’s bizarre. Can you post the relevant lines from the source code here? Are there any earlier errors? What are the first errors that show up?
      Did the libraries compile OK?

  16. Lee says:

    I solved the problem. It was because i didnt use the right version TooN, LibCVD and Gvar3 library.

  17. AJ says:

    Hello,

    I managed to compile PTAM on Windows Vista using Visual Studio 2005 Professional and run it succesfully. Tracking and mapping works fine. However when I click the “Draw AR On” button, the 3D eyeballs won’t show. It only shows the white grid fading out but no 3D eyeballs augmented on the scene. Occasionally it will only show the shadow of the 3D eyeballs, but most of the time no 3D eyeballs augmentation at all.

    Some info that might be useful:
    My laptop is using a Mobile Intel 965 integrated graphic. Initially, i got crash running PTAM during “ARDriver: Creating FBO… “. Inspecting the code, the comment says: “Needs nvidia drivers >= 97.46”. But, I read a post which suggested to update my Intel graphic to latest version. I did that and PTAM works … minus the 3D eyeballs AR. Could it be because PTAM needs NVidia graphic card?

    If it also matters, I’m using VideoSource_Win32_LibVideoInput.cc, videoInput.lib, and videoInput.h so I can use my webcam. During compiling, apparently it needs “atlthunk.lib”, but then I put “atlthunk.lib” in the list of lib to ignore and PTAM still compiles and run minus the 3D eyeballs AR.

    So, any idea on what could be causing the 3d eyeballs not showing?

    • georgklein says:

      It shows the video frame fine however? That would mean that all the FBO stuff is working fine . . . the eyeball drawing code is really trivial by comparison, it does nothing fancy. I really would expect that to work on any graphics card, just drawing the video frame is a much bigger lift. No ideas really.

  18. Axiom says:

    Hi Georg,

    Getting a strange compiler error,
    MapMaker.cc:1134: error: no matching function for call to ‘normalize(TooN::Vector<3, …

    Not sure what's causing it. Commented out the offending line just to test and seems to work, but if you could shed some light on why it's happening?

    Best and thank you for your support.

    • georgklein says:

      Likely to be a TooN version thing – the normalize(X) call in TooN/helpers.h was causing problems at some points. If you can’t get it to work just replace that line with
      m3Rot[0] /= sqrt(m3Rot[0] * m3Rot[0]);

  19. Leo says:

    Hi Georg,

    I try to compile the PTAM on Snow Leopard. However, I didn’t success. I stop when I compile the libcvd. It shows me that it didn’t find X and lGL.

    checking for X… no
    checking for glDrawPixels in -lGL… no
    checking GL/glu.h usability… yes
    checking GL/glu.h presence… yes
    checking for GL/glu.h… yes
    checking for gluGetString in -lGLU… no
    checking for tr1::shared_ptr… yes
    checking for TooN… yes
    checking Old TooN… no

    Do you know the solution for this?
    Thanks very much.

    • georgklein says:

      Maybe a failure of libcvd’s configure script to check for dependencies correctly on your system. You can usually find clues in the config.log and pinpoint where the relevant compilations failed. At some point someone on OSX found it necessary to remove the linking of -lXext (or something like that) from the check for OpenGL.

      • Leo says:

        Thanks, I check the config.log, but I really have no idea about it. The failure shows as :

        configure:7707: checking for X
        configure:7822: g++ -E -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -INONE/include -I/sw/include -I/usr/X11R6/include conftest.cpp
        configure:7828: $? = 0
        configure:7877: g++ -o conftest -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -INONE/include -I/sw/include -I/usr/X11R6/include -arch i386 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 conftest.cpp -lX11 -L/sw/lib -framework Carbon -framework QuickTime >&5
        ld: library not found for -lX11
        collect2: ld returned 1 exit status
        configure:7883: $? = 1
        configure: failed program was:
        | /* confdefs.h. */
        | #define PACKAGE_NAME “CVD”
        | #define PACKAGE_TARNAME “cvd”
        | #define PACKAGE_VERSION “0.7”
        | #define PACKAGE_STRING “CVD 0.7”
        | #define PACKAGE_BUGREPORT “”
        | #define STDC_HEADERS 1
        | #define CVD_MAJOR_VERSION 0
        | #define CVD_MINOR_VERSION 7
        | #define HAVE_SYS_TYPES_H 1
        | #define HAVE_SYS_STAT_H 1
        | #define HAVE_STDLIB_H 1
        | #define HAVE_STRING_H 1
        | #define HAVE_MEMORY_H 1
        | #define HAVE_STRINGS_H 1
        | #define HAVE_INTTYPES_H 1
        | #define HAVE_STDINT_H 1
        | #define HAVE_UNISTD_H 1
        | #define CVD_ARCH_LITTLE_ENDIAN 1
        | #define CVD_HAVE_MMX 1
        | #define CVD_HAVE_MMXEXT 1
        | #define CVD_HAVE_SSE 1
        | #define CVD_HAVE_SSE2 1
        | #define CVD_HAVE_SSE3 1
        | #define SIZEOF_VOIDP 4
        | #define CVD_HAVE_INLINE_ASM 1
        | #define CVD_HAVE_QTBUFFER 1
        | /* end confdefs.h. */
        | #include
        | int
        | main ()
        | {
        | XrmInitialize ()
        | ;
        | return 0;
        | }
        configure:7931: result: no

        configure:7959: checking for glDrawPixels in -lGL
        configure:7994: g++ -o conftest -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -INONE -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -INONE/include -I/sw/include -I/usr/X11R6/include -arch i386 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 conftest.cpp -lGL -L/sw/lib -framework Carbon -framework QuickTime -LNONE -lX11 -lXext -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib >&5
        ld: warning: directory ‘NONE’ following -L not found
        ld: library not found for -lGL
        collect2: ld returned 1 exit status
        configure:8000: $? = 1
        configure: failed program was:
        | /* confdefs.h. */
        | #define PACKAGE_NAME “CVD”
        | #define PACKAGE_TARNAME “cvd”
        | #define PACKAGE_VERSION “0.7”
        | #define PACKAGE_STRING “CVD 0.7”
        | #define PACKAGE_BUGREPORT “”
        | #define STDC_HEADERS 1
        | #define CVD_MAJOR_VERSION 0
        | #define CVD_MINOR_VERSION 7
        | #define HAVE_SYS_TYPES_H 1
        | #define HAVE_SYS_STAT_H 1
        | #define HAVE_STDLIB_H 1
        | #define HAVE_STRING_H 1
        | #define HAVE_MEMORY_H 1
        | #define HAVE_STRINGS_H 1
        | #define HAVE_INTTYPES_H 1
        | #define HAVE_STDINT_H 1
        | #define HAVE_UNISTD_H 1
        | #define CVD_ARCH_LITTLE_ENDIAN 1
        | #define CVD_HAVE_MMX 1
        | #define CVD_HAVE_MMXEXT 1
        | #define CVD_HAVE_SSE 1
        | #define CVD_HAVE_SSE2 1
        | #define CVD_HAVE_SSE3 1
        | #define SIZEOF_VOIDP 4
        | #define CVD_HAVE_INLINE_ASM 1
        | #define CVD_HAVE_QTBUFFER 1
        | /* end confdefs.h. */
        |
        | /* Override any GCC internal prototype to avoid an error.
        | Use char because int might match the return type of a GCC
        | builtin and then its argument prototype would still apply. */
        | #ifdef __cplusplus
        | extern “C”
        | #endif
        | char glDrawPixels ();
        | int
        | main ()
        | {
        | return glDrawPixels ();
        | ;
        | return 0;
        | }
        configure:8018: result: no

        I am just a starter using the mac os. However, this is relate to my final project. I’m a Msc student in UCL. I really need help. Can you please have a look about it and tell me what’s wrong with it if it’s possible. Thanks very much.

      • georgklein says:

        Looks like it’s not finding X11. Did you install X11? Not sure it’s installed by default on OSX.

      • Leo says:

        Yes, I did have X11 installed. It’s surprising that the newest version of the libcvd can find the X11 and lGL, however, the newest libcvd can not be use for PTAM for some reason, because my friend tried the newest libcvd on Leopard before, the PTAM will always complain about it.

      • Georg Klein says:

        What does PTAM complain about with the newest CVD?

      • Leo says:

        Hi again,

        I try the newest version of libcvd on Leopard, and I compile it in 32 bit mode. It can find the X and lGL also the QuickTime.
        checking Carbon and QuickTime framework… yes
        checking for clock_getres in -lrt… no

        ——————————-
        Checking for optional libraries
        ——————————-
        checking for X… libraries /usr/X11/lib, headers
        checking for glDrawPixels in -lGL… yes
        checking GL/glu.h usability… yes
        checking GL/glu.h presence… yes
        checking for GL/glu.h… yes
        checking for gluGetString in -lGLU… yes
        checking for tr1::shared_ptr… yes
        checking for TooN… yes

        However, when I compile the PTAM, it still shows me error:
        ld: warning: in /usr/local/lib/libcvd.dylib, file was built for i386 which is not the architecture being linked (x86_64)
        Undefined symbols:
        “CVD::QT::RawQT::frame_rate()”, referenced from:
        CVD::QTBuffer::frame_rate() in VideoSource_OSX.o
        “CVD::GLWindow::size() const”, referenced from:
        GLWindow2::SetupWindowOrtho() in GLWindow2.o
        GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        GLWindow2::DrawCaption(std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        GLWindow2::DrawMenus() in GLWindow2.o
        GLWindow2::DrawMenus() in GLWindow2.o
        GLWindow2::SetupViewport() in GLWindow2.o
        GLWindow2::SetupViewport() in GLWindow2.o
        GLWindow2::SetupVideoRasterPosAndZoom() in GLWindow2.o
        GLWindow2::SetupVideoRasterPosAndZoom() in GLWindow2.o
        “CVD::Thread::start(CVD::Runnable*)”, referenced from:
        MapMaker::MapMaker(Map&, ATANCamera const&)in MapMaker.o
        “CVD::QT::RawQT::put_frame(unsigned char*)”, referenced from:
        CVD::QTBuffer::put_frame(CVD::VideoFrame*)in VideoSource_OSX.o
        “CVD::halfSample(CVD::BasicImage const&, CVD::BasicImage&)”, referenced from:
        KeyFrame::MakeKeyFrame_Lite(CVD::BasicImage&)in KeyFrame.o
        SmallBlurryImage::MakeFromKF(KeyFrame&, double)in SmallBlurryImage.o
        “CVD::QT::RawQT::frame_pending()”, referenced from:
        CVD::QTBuffer::frame_pending() in VideoSource_OSX.o
        “CVD::Thread::shouldStop() const”, referenced from:
        MapMaker::run() in MapMaker.o
        MapMaker::run() in MapMaker.o
        “CVD::QT::RawQT::RawQT(CVD::ImageRef const&, unsigned int, unsigned int, bool, bool)”, referenced from:
        VideoSource::VideoSource()in VideoSource_OSX.o
        “CVD::fast_corner_detect_10(CVD::BasicImage const&, std::vector<CVD::ImageRef, std::allocator >&, int)”, referenced from:
        KeyFrame::MakeKeyFrame_Lite(CVD::BasicImage&)in KeyFrame.o
        KeyFrame::MakeKeyFrame_Lite(CVD::BasicImage&)in KeyFrame.o
        KeyFrame::MakeKeyFrame_Lite(CVD::BasicImage&)in KeyFrame.o
        KeyFrame::MakeKeyFrame_Lite(CVD::BasicImage&)in KeyFrame.o
        “CVD::QT::RawQT::get_frame_format_string()”, referenced from:
        VideoSource::GetAndFillFrameBWandRGB(CVD::Image&, CVD::Image<CVD::Rgb >&)in VideoSource_OSX.o
        VideoSource::GetAndFillFrameBWandRGB(CVD::Image&, CVD::Image<CVD::Rgb >&)in VideoSource_OSX.o
        VideoSource::GetAndFillFrameBWandRGB(CVD::Image&, CVD::Image<CVD::Rgb >&)in VideoSource_OSX.o
        “typeinfo for CVD::Thread”, referenced from:
        typeinfo for MapMakerin MapMaker.o
        “CVD::Thread::Thread()”, referenced from:
        MapMaker::MapMaker(Map&, ATANCamera const&)in MapMaker.o
        “CVD::Thread::~Thread()”, referenced from:
        MapMaker::~MapMaker()in MapMaker.o
        MapMaker::~MapMaker()in MapMaker.o
        MapMaker::~MapMaker()in MapMaker.o
        MapMaker::~MapMaker()in MapMaker.o
        MapMaker::MapMaker(Map&, ATANCamera const&)in MapMaker.o
        “void CVD::convert_image<CVD::yuv422, CVD::Rgb >(CVD::BasicImage const&, CVD::BasicImage<CVD::Rgb >&)”, referenced from:
        VideoSource::GetAndFillFrameBWandRGB(CVD::Image&, CVD::Image<CVD::Rgb >&)in VideoSource_OSX.o
        “CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)”, referenced from:
        SmallBlurryImage::MakeFromKF(KeyFrame&, double)in SmallBlurryImage.o
        “CVD::Thread::stop()”, referenced from:
        MapMaker::~MapMaker()in MapMaker.o
        MapMaker::~MapMaker()in MapMaker.o
        “CVD::cvd_timer::get_time()”, referenced from:
        CVD::QTBuffer::get_frame() in VideoSource_OSX.o
        MapMaker::AddPointEpipolar(KeyFrame&, KeyFrame&, int, int)in MapMaker.o
        MapMaker::InitFromStereo(KeyFrame&, KeyFrame&, std::vector<std::pair, std::allocator<std::pair > >&, TooN::SE3&)in MapMaker.o
        “CVD::glSetFont(std::basic_string<char, std::char_traits, std::allocator > const&)”, referenced from:
        GLWindow2::GLWindow2(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        “void CVD::convert_image(CVD::BasicImage const&, CVD::BasicImage&)”, referenced from:
        VideoSource::GetAndFillFrameBWandRGB(CVD::Image&, CVD::Image<CVD::Rgb >&)in VideoSource_OSX.o
        “CVD::GLWindow::init(CVD::ImageRef const&, int, std::basic_string<char, std::char_traits, std::allocator > const&, std::basic_string<char, std::char_traits, std::allocator > const&)”, referenced from:
        GLWindow2::GLWindow2(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        “CVD::GLWindow::handle_events(CVD::GLWindow::EventHandler&)”, referenced from:
        GLWindow2::HandlePendingEvents() in GLWindow2.o
        “CVD::GLWindow::swap_buffers()”, referenced from:
        System::Run() in System.o
        “CVD::Thread::join()”, referenced from:
        MapMaker::~MapMaker()in MapMaker.o
        MapMaker::~MapMaker()in MapMaker.o
        “void CVD::convert_image(CVD::BasicImage const&, CVD::BasicImage&)”, referenced from:
        VideoSource::GetAndFillFrameBWandRGB(CVD::Image&, CVD::Image<CVD::Rgb >&)in VideoSource_OSX.o
        “CVD::fast_nonmax(CVD::BasicImage const&, std::vector<CVD::ImageRef, std::allocator > const&, int, std::vector<CVD::ImageRef, std::allocator >&)”, referenced from:
        KeyFrame::MakeKeyFrame_Rest() in KeyFrame.o
        “CVD::Internal::aligned_alloc(unsigned long, unsigned long)”, referenced from:
        System::System()in System.o
        System::System()in System.o
        CVD::Image::resize(CVD::ImageRef const&)in KeyFrame.o
        SmallBlurryImage::MakeJacs() in SmallBlurryImage.o
        SmallBlurryImage::MakeFromKF(KeyFrame&, double)in SmallBlurryImage.o
        CVD::Image::Image(CVD::ImageRef const&)in SmallBlurryImage.o
        MapMaker::AddPointEpipolar(KeyFrame&, KeyFrame&, int, int)in MapMaker.o
        PatchFinder::MakeSubPixTemplate() in PatchFinder.o
        PatchFinder::PatchFinder(int)in PatchFinder.o
        MiniPatch::SampleFromImage(CVD::ImageRef, CVD::BasicImage&)in MiniPatch.o
        EyeGame::MakeShadowTex() in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        Tracker::RenderGrid() in Tracker.o
        “typeinfo for CVD::QT::RawQT”, referenced from:
        typeinfo for CVD::QTBufferin VideoSource_OSX.o
        “CVD::QT::RawQT::~RawQT()”, referenced from:
        CVD::QTBuffer::~QTBuffer()in VideoSource_OSX.o
        CVD::QTBuffer::~QTBuffer()in VideoSource_OSX.o
        “CVD::Thread::sleep(unsigned int)”, referenced from:
        MapMaker::run() in MapMaker.o
        “CVD::Internal::aligned_free(void*)”, referenced from:
        System::~System()in main.o
        System::~System()in main.o
        System::~System()in main.o
        CVD::Image<CVD::Rgb >::remove()in System.o
        CVD::Image::remove()in System.o
        CVD::Image::remove()in KeyFrame.o
        CVD::Image::remove()in SmallBlurryImage.o
        CVD::Image<TooN::Vector >::remove()in SmallBlurryImage.o
        CVD::Image::remove()in SmallBlurryImage.o
        CVD::Image<TooN::Vector >::remove()in MapMaker.o
        CVD::Image::~Image()in MapMaker.o
        PatchFinder::~PatchFinder()in MapMaker.o
        CVD::Image<std::pair >::remove()in PatchFinder.o
        CVD::Image::remove()in MiniPatch.o
        EyeGame::MakeShadowTex() in EyeGame.o
        EyeGame::MakeShadowTex() in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        Tracker::TrackFrame(CVD::Image&, bool)in Tracker.o
        Tracker::TrackFrame(CVD::Image&, bool)in Tracker.o
        CVD::Image<TooN::Vector >::~Image()in Tracker.o
        CVD::Image::~Image()in Tracker.o
        “void CVD::convert_image<CVD::vuy422, CVD::Rgb >(CVD::BasicImage const&, CVD::BasicImage<CVD::Rgb >&)”, referenced from:
        VideoSource::GetAndFillFrameBWandRGB(CVD::Image&, CVD::Image<CVD::Rgb >&)in VideoSource_OSX.o
        “CVD::timer”, referenced from:
        CVD::QTBuffer::get_frame() in VideoSource_OSX.o
        MapMaker::AddPointEpipolar(KeyFrame&, KeyFrame&, int, int)in MapMaker.o
        MapMaker::InitFromStereo(KeyFrame&, KeyFrame&, std::vector<std::pair, std::allocator<std::pair > >&, TooN::SE3&)in MapMaker.o
        “CVD::add_multiple_of_sum(float const*, float const*, float const&, float*, unsigned long)”, referenced from:
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        void CVD::convolveGaussian(CVD::BasicImage const&, CVD::BasicImage&, double, double)in EyeGame.o
        “CVD::QT::RawQT::get_frame()”, referenced from:
        CVD::QTBuffer::get_frame() in VideoSource_OSX.o
        “CVD::GLWindow::~GLWindow()”, referenced from:
        GLWindow2::~GLWindow2()in main.o
        GLWindow2::GLWindow2(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        GLWindow2::~GLWindow2()in GLWindow2.o
        GLWindow2::~GLWindow2()in GLWindow2.o
        System::System()in System.o
        “CVD::QT::RawQT::get_size() const”, referenced from:
        CVD::QTBuffer::get_frame() in VideoSource_OSX.o
        CVD::QTBuffer::size() in VideoSource_OSX.o
        “CVD::glDrawText(std::basic_string<char, std::char_traits, std::allocator > const&, CVD::TEXT_STYLE, double, double)”, referenced from:
        GLWindow2::PrintString(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >)in GLWindow2.o
        ld: symbol(s) not found
        collect2: ld returned 1 exit status
        make: *** [PTAM] Error 1

        Seems that it still not find the openGL, right?
        Many thanks for your help.

      • georgklein says:

        Yeah, looks like CVD hasn’t found GL, and also the QTBuffer isn’t being compiled in. Again for the GL stuff check the config.log of libcvd.

  20. WinKILLER says:

    Hi! Sorry, but I have noob question:
    After compiling all libraries and binaries, running ./CameraCalibrator writes:

    Welcome to CameraCalibrator
    ————————————–
    Parallel tracking and mapping for Small AR workspaces
    Copyright (C) Isis Innovation Limited 2008

    Parsing calibrator_settings.cfg ….
    VideoSource_Linux: Opening video source…
    ? GV3::Register: string VideoSource.V4LDevice undefined. Defaults to “/dev/video0”
    ? GV3::Register: CVD::ImageRef VideoSource.Resolution undefined. Defaults to [640 480]
    ? GV3::Register: int VideoSource.Framerate undefined. Defaults to 30

    !! Failed to run CameraCalibrator; got exception.
    Exception was:
    V4LBuffer: “V4L2: Requested format not supported” ioctl failed on /dev/video0: Invalid argument
    >
    ———————————————————-
    For more information:
    lsmod | grep videodev
    videodev 34361 1 gspca_main
    v4l1_compat 13251 1 videodev
    and
    lsusb | grep cam
    Bus 005 Device 005: ID 0ac8:303b Z-Star Microelectronics Corp. ZC0303 Webcam
    and
    v4l-conf
    v4l-conf: using X11 display :0.0
    dga: version 2.0
    mode: 1280×800, depth=24, bpp=32, bpl=28, base=unknown
    /dev/video0 [v4l2]: no overlay support

    So, question is it’s camera problem, or my curved hands? And what can I do in such case?
    PS Sorry for my bad english …

    • georgklein says:

      If you look in the videoinput_linux_v4l (or similar) file you’ll see that it requests a certain color format, which your camera might not produce. Change the color format in the source code to something that your camera does support.

  21. SungKwan Hwang says:

    I have sucessfully compliled PTAM and it is working near 30 fram/sec on windows XP
    but when I compile PTAMM I get below error.
    programfiles/Microsoft visual studio8/VC/lib/libpng-bcc: Fatal error LNK1136 :invalid or corrup file
    does anybody have any ideas?

    tal error LNK

    • Yangjin says:

      I am trying to build the ptam followed the PTAMM manual, but I encounter a similar problem :
      1> D: \ ptam install \ ptamlib \ jpeg-bcc.lib: fatal error LNK1136: invalid or corrupt file
      Could you tell me how did you solve this kind of problem?

      Thank you

  22. Camilo Mauricio Soto Valenzuela says:

    Hi George im currently calibrating camera but got some issues with video source, i got following mistakes on camera calibrator log

    # ./CameraCalibrator
    Welcome to CameraCalibrator
    --------------------------------------
    Parallel tracking and mapping for Small AR workspaces
    Copyright (C) Isis Innovation Limited 2008
    Parsing calibrator_settings.cfg ....
    VideoSource_Linux: Opening video source...
    ? GV3::Register: string VideoSource.V4LDevice undefined. Defaults to "/dev/video1"
    ? GV3::Register: CVD::ImageRef VideoSource.Resolution undefined. Defaults to [640 480]
    ? GV3::Register: int VideoSource.Framerate undefined. Defaults to 30
    > ... got video source.
    Camera calib is [ 0.356439 1.12913 0.506476 2.7276 0.0281136 ]
    Saving camera calib to camera.cfg...
    .. saved.

    Also after near 2 minutes, app crash… i dont know why… and RMS error gives me 3.xxx or 2.xxxx in average best result i got was 1.5xxxxx

    thanks in advance

  23. Camilo Mauricio Soto Valenzuela says:

    And error i got when app crash is

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

    i dont know how to configure the linux video source correctly.

  24. Camilo Mauricio Soto Valenzuela says:

    ok, well after some minutes playing with camera calibrator, i realize that it was just about aiming camera in different directions looking at the grid…

    i got following results,

     Welcome to CameraCalibrator 
      -------------------------------------- 
      Parallel tracking and mapping for Small AR workspaces
      Copyright (C) Isis Innovation Limited 2008 
    
      Parsing calibrator_settings.cfg ....
      VideoSource_Linux: Opening video source...
    ? GV3::Register: string VideoSource.V4LDevice undefined. Defaults to "/dev/video1"
    ? GV3::Register: CVD::ImageRef VideoSource.Resolution undefined. Defaults to [640 480]
    ? GV3::Register: int VideoSource.Framerate undefined. Defaults to 30
    >   ... got video source.
      Camera calib is [ 0.571865 0.758475 0.451879 0.51923 -0.0292355 ]
      Saving camera calib to camera.cfg...
      .. saved.
    //with rms error about 0.4xxxx
    

    and now my question is i guess on video source file i can change parameters of frame rate and resolution, but still there i question… how can i know if my logitech web cam 9000 is wide lens?

    • W.Mingliang says:

      Hi Camilo:
      I am using the webcam Logicool for PTAM, but when I try to do camera-calibration, it can’t detect most of the grids in chessboard, and the result is wrong, the result is like this: “Current RMS pixel error is 1.#QNAN” and “Current camera params are 1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN”…. What’s this problem is?
      Best regards.
      Wang Mingliang

      • georgklein says:

        Not sure I’ve seen this happen before. Best bet is to turn on floating point exceptions on your processor and run the debugger to see where this comes from.

  25. Camilo Mauricio Soto Valenzuela says:

    Ok, now my results running PTAM tracker are….

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

    any advice i would appreciate it
    PS: sorry if im on a rush posting, im just too excited with PTAM.
    thanks!!

  26. SungKwan Hwang says:

    LNK2001
    Which library did I leave out?
    The error meaasage looks like below
    1>—— Build started: Project: PTAMM, Configuration: Release Win32 ——
    1>Linking…
    1>LINK : warning LNK4075: ignoring ‘/INCREMENTAL’ due to ‘/OPT:ICF’ specification
    1>libcvd.lib(win32.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
    1>LINK : warning LNK4075: ignoring ‘/INCREMENTAL’ due to ‘/LTCG’ specification
    1>ModelsGame.obj : error LNK2001: unresolved external symbol “public: void __thiscall CVD::PNG::png_reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@png_reader@PNG@CVD@@QAEXPAV?$Rgba@E@3@@Z)
    1>ARDriver.obj : error LNK2001: unresolved external symbol “public: void __thiscall CVD::PNG::png_reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@png_reader@PNG@CVD@@QAEXPAV?$Rgba@E@3@@Z)

    (bobcastle — cut out the hundreds of lines of unneeded debug output for a cleaner comment )

    1>Release\PTAMM.exe : fatal error LNK1120: 31 unresolved externals
    1>Build log was saved at “file://c:\PTAMM\Release\BuildLog.htm”
    1>PTAMM – 128 error(s), 2 warning(s)
    ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

    • bobcastle says:

      It appears that you have built libCVD without PNG support. Unlike PTAM, PTAMM requires PNG support from libCVD.
      From your error log it appears that you are building on widows. Please read through the example install in the manual carefully as this tells you how to enable PNG support in libCVD under Windows (bottom of page 21, and top of page 22). A config file needs to be modified and a file added to the project. Hope this helps.

  27. Sergio Ramirez says:

    Hi!!
    I’m trying to run PTAM but I have the following error:

    ./PTAM
    ./PTAM: error while loading shared libraries: libGVars3.so: cannot open shared object file: No such file or directory

    Can you give me, please, any suggestions to correct this?

  28. Camilo Mauricio Soto Valenzuela says:

    Hi George, well first i try to do what you had said, on my example for gldrawpixels, it happens exactly what you had said after i change parameters the color went to Black and white, then i try hard to change way of getting images, first i change some headers to receive on method GetAndFillFrameBWandRGB, then i change some parameter on MakeFromImage method, and i continue doing this until catching up compiling errors until i arrive to isCorner Method and there it was impossible for me to correct errors, beacuse in this piece of code

    inline bool IsCorner(Image<byte> &im, ImageRef ir, int nGate)
    {
      int nSum = 0;
      static byte abPixels[16];
      for(int i=0; i<16; i++){
          abPixels[i] = im[ir + fast_pixel_ring[i]];
    //here compilation error gives me ..... -> it is not possible to index a rbg image, as i change everything to rgb image.
          nSum += abPixels[i];
         };

    so until that point were, my efforts tryng to do what you said about change black & white to rbg, then i decided to borrow my friend laptop, problem with his laptop on first instance was that it has n-vidia card but slow processor, and its amd, anyway i did some effort and now its working on his laptop, but it is really difficult to work in it as if we move camera a little fast app is down, so i decided to buy a cool machine … well after begging to my father to buy it for my proyect…. configuration of machine its: 4 g ddr3, icore7 930, n-vidia gforce 9800gt 1g ddr3, ubuntu 10.04 X86-64, so now after running ptam it works great and now my new questions after this are:

    1. we are trying to improve control of camera changing video source file but i cant find a good place to learn to use uvc camera controls, beacause we cant get a better camera resolution i dont know why i change parameters in here
    ImageRef irSize = GV3::get("VideoSource.Resolution", ImageRef(1280,1024));
    but we dont get a change on image it continue the same. it always happens the same even if i change frame rate
    to 50 it continue the same video output.
    i believe we can improve video output i think its great cam we get below 0.3 error after calibrating it.
    here is specifications:
    http://www.logitech.com/en-us/webcam-communications/webcams/devices/6333
    can you give me some suggestions for controling my V4L2 cam device, i also sent a message to linux-uvc development list but no one answer. and i cant find a good manual of that either.
    2. i have studied code of Gvars3 for videosource file i realized that here gvars just work for instance of diferent
    types of data, but i was not able to correct this warning about

    GV3::Register: CVD::ImageRef VideoSource.Resolution undefined. Defaults to [800 600]

    i think its beacuse i have to use a file where i store resolution, but no idea how to.

    3. Do you have or know someone who has a good manual or reference for cvd and gvars, i have search a lot on the web but with no success and cvd tutorial its so poor.

    well George, i think this is it for the moment, thanks a lot for your time and attention.

    Camilo

    • Camilo Mauricio Soto Valenzuela says:

      also i got this… opengl start window really small, so when i maximize it i loose resolution completely and tracking becomes like poor, when window is small tracker just run extreme and cool, any ideas?? and George some help with a little manual for gvars, cvd, toon (i mean how do you people learn to use so great this libraries i don’t find a good place to read about them) its so poor on web site about reference for libraries. or maybe if im searching in the incorrect sites please give me some light.

      thanks in advance!!

      Camilo

    • georgklein says:

      Re changing the code to draw RGB: You only want to draw in RGB. The tracker wants to track a black-and-white image. So in System.cc,
      change the call
      mpTracker->TrackFrame(mimFrameBW, !bDrawAR && !bDrawMap);

      To also pass the color image to the tracker, which you then use for drawing only.

      1. You won’t get much tracking improvement with the higher res and it will run more slowly, and a lot of parameters are tuned for 640×480. There’s really not much point going above 640×480.

      2. Put
      VideoSource.Resolution = [ 640 480]
      in the settings.cfg file if you want.

      3. I think some of those libraries have a “make docs” or “make doc” command which generates some html documentation via doxygen. But mostly the heavy users of those libraries are the same people who wrote them, so there was not much need for documentation.

  29. kevino says:

    George,
    Love your work, it’s terrifically useful, and I hope eventually I’ll be able to add some value. Not sure this is the proper place to ask this, but if you could give me a clue as to how to project a 3D point in PTAM (such as a feature, or model coordinates in ModelsGame) to screen coordinates, I’d be much obliged. I’ve tried gluproject, with the modelview and projection matrices pulled from GL environment, but I don’t get useful coordinates.
    Here’s an example
    Model view matrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
    projection matrix 0.003125 0 0 0 0 -0.00416667 0 0 0 0 -1 0 -0.998828 0.998438 0 1
    viewport 0 0 640 480
    3D coords 0.200385 -0.0244113 0.459716
    actual Click coords 484 258
    gluproject coords: 0.575389,479.649,0.270142
    Thanks,
    Kevin

    • georgklein says:

      in sort of pseudo-code: (Also by [] I actually meant the less-than / greater than brackets but they disappear from my posts here)

      Vector[3] world_coords = makeVector( .. , .. ,.. ); // Whatever coords you want tin the global coordinate frame
      Vector[3] camera_frame_coords = Tracker.GetCurrentPose() * world_coords;
      Vector[3] z_equals_one_plane_coords = project(camera_frame_coords);
      Vector[2] pixel_coords = Camera.project(z_equals_one_plane_coords);

      or more briefly,
      pixel_coords = Camera.project(project(Tracker.GetCurrentPose() * world_coords) );

      This assumes that Camera is currently set up for the resolution you’re interested in.

  30. kevino says:

    Georg, thanks for the projection pointers. very helpful.
    We’ve got things humming smoothly on linux but we’re having a bear of a time on windows.

    The main remaining problem seems to be with proper building of libcvd. We (myself and another engineer spent two days on this problem) followed the direction, edited config.h, etc. and we get the undefineds mentioned above.
    Building with the pre-packaged release, when I dump the symbols, all the PNG methods definitely aren’t there.
    Today, I pulled the CVS code recommended in the manual, and the PNG reader routines are there in the symbols but i get all sorts of other undefineds (146 of them):
    e.g.
    2>ModelsGame.obj : error LNK2001: unresolved external symbol “public: void __thiscall CVD::FITS::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@FITS@CVD@@QAEXPAV?$Rgba@E@3@@Z)
    2>ARDriver.obj : error LNK2001: unresolved external symbol “public: void __thiscall CVD::FITS::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@FITS@CVD@@QAEXPAV?$Rgba@E@3@@Z)
    2>MapSerializer.obj : error LNK2001: unresolved external symbol “public: void __thiscall CVD::FITS::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@FITS@CVD@@QAEXPAV?$Rgba@E@3@@Z)
    2>MGButton.obj : error LNK2001: unresolved external symbol “public: void __thiscall CVD::FITS::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@FITS@CVD@@QAEXPAV?$Rgba@E@3@@Z)
    2>ModelBrowser.obj : error LNK2001: unresolved external symbol “public: void __thiscall CVD::FITS::reader::get_raw_pixel_line(class CVD::Rgba *)” (?get_raw_pixel_line@reader@FITS@CVD@@QAEXPAV?$Rgba@E@3@@Z)
    2>ModelsGame.obj : error LNK2001: unresolved external symbol “public: class CVD::ImageRef __thiscall CVD::FITS::reader::size(void)” (?size@reader@FITS@CVD@@QAE?AVImageRef@3@XZ)
    2>ARDriver.obj : error LNK2001: unresolved external symbol “public: class
    2>ModelsGame.obj : error LNK2001: unresolved external symbol “public: class std::basic_string<char,struct std::char_traits,class std::allocator > __thiscall CVD::TEXT::reader::name(void)” (?name@reader@TEXT@CVD@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)

    Can anyone give me a clue? I’ve started over from scratch several times, reading the page 21 steps over and over….

    btw, Visual Studio 2005, both on XP and windows 7

    • Georg Klein says:

      Remove references to FITS loading / saving in the CVD image load/save code… there’s one reference for reading and one for writing.

      • Tom says:

        Hi,

        I am also facing similar problem with unresolved external symbol errors, for 23 external symbols. This is only for the Camera Calibrator.

        libcvd.lib(glwindow.obj) : error LNK2001: unresolved external symbol __imp__MoveWindow@24

        Please suggest.

  31. Kyung Kim says:

    Hello Georg,
    First of all, I think PTAM is a wonderful platform 🙂 It is working really well and Robust.

    In fact, I am planning to implement PTAM with color/Depth Inputs instead of regular 2D camera. (by using PrimeSense camera or others)

    I believe there should be some sort of advantages.
    like that I might automatically generate solid scene models which can interact with virtual objects; I could skip the stereo initialization process; and it might be more robust since it already has 3D information of the feature points.
    In the other hands, there should be some disadvantages on processing time.

    My question is that what do you think about this idea ?
    do you think there are any other advantages in such system ?

    Thank you,

    • georgklein says:

      This should work very well, and would make the system way more robust – for example you’d be able to rotate on the spot, which is currently not possible; or track in rooms with blank walls (as long as a corner is visible).

  32. TimmSnow says:

    Hello Georg,

    I’m trying to use PTAM as visual odometry system on a humanoid robot (Aldebaran’s Nao). The camera is pointing about 45 degrees downwards so it can see a good portion of the floor ahead. The first idea was to use the knotholes in the wooden floor as features. Since they have no corners, that didn’t work. Features were detected very very rarely and quickly vanished under illumination changes while moving. When walking around in a more cluttered environment it works as long as the initial features can be seen. The problem is that the software often doesn’t measure new map points if the robot turns, even if there are (to my opinion) optical corners in the image. Nevertheless sometimes PTAM detects new features and adds them – always a whole bunch of features. Can this problem be only due to the rotate-in-place problem? Because the robot always translates some cm while shifting his weight. Often I can’t even get the software to add features by strafing. Do you have any suggestions on movement parameters or movement patterns, that could help in more often adding new map points?
    Thanks,
    Timm

    • georgklein says:

      I suggest you make some modifications.

      1. Not finding corners – you can replace FAST with something like Shi-Tomasi or Harris, and replace the hard minimum-cornerniness-threshold with some area-adaptive thesholding scheme, see e.g. the quad-tree approach in recent Mei & Sibley papers. This does a better job of picking out the faint corners which the blind threshold of the current implementation skips. You then have to modify the tracker so that it searches for patches at every pixel location within a circle, rather than only around FAST corners. This is easy to do. What’s harder is getting the epipolar search to work not-only-on-fast-corners too; some form of partially-initialized-point-tracking can help here, as described in my ISMAR2009 iphone paper or the recent paper by Hauke Strasdat, both of which replace PTAM’s line-based search.

      2. The above makes the system run slower for an equivalent number of points. Simple fix: just get rid of the highest-resolution level (typically 640×480) of the image pyramid, it provides little benefit anyway.

      3. Maintaining track / adding features on pure rotation: This is a fundamental problem for MonoSLAM, because if you turn a corner while not translating, you lose the scale of the world. PTAM makes no attempt at solving it and in fact explicitly avoids it coming up, by not adding features on rotation. The structure of your problem (robot head probably a predictable height above the ground the whole time, some form of odometry) could help a lot. You’d probably want to use the partially-initialized point approach as a bridge to add features with unknown depth while you’re rotating. This will almost certainly be the hardest part to add to PTAM however. Ultimately, the way to properly support a robot rotating in place is to use a stereo camera, or one of these new-fangled depth sensing cams.

      • georgklein says:

        Another approach if you want to see improvements with less effort: Turn down the FAST threshold, and then override the method by which the system decides when to add keyframes. Assign it to a button in the GUI instead, and experiment with increasing the keyframe density. This should produce quicker feature addition and might make the system useable for you without much further modification.

  33. Sam Paech says:

    Hi Georg,

    I’m having trouble compiling LibCVD with PNG support. When I add png.cc to the solution it no longer compiles, and throws a bunch of errors (97 of them). All related to png.cc. Any ideas?

    Thanks

    Some of the errors:

    Error 1 error C2065: ‘png_structp’ : undeclared identifier pnm_src\png.cc 18 1 libcvd
    Error 2 error C2146: syntax error : missing ‘)’ before identifier ‘png_ptr’ pnm_src\png.cc 18 1 libcvd
    Error 3 error C2182: ‘error_fn’ : illegal use of type ‘void’ pnm_src\png.cc 18 1 libcvd
    Error 4 error C2059: syntax error : ‘)’ pnm_src\png.cc 18 1 libcvd
    Error 5 error C2143: syntax error : missing ‘;’ before ‘{‘ pnm_src\png.cc 19 1 libcvd
    Error 6 error C2447: ‘{‘ : missing function header (old-style formal list?) pnm_src\png.cc 19 1 libcvd
    Error 7 error C2065: ‘png_structp’ : undeclared identifier pnm_src\png.cc 23 1 libcvd
    Error 8 error C2065: ‘png_const_charp’ : undeclared identifier pnm_src\png.cc 23 1 libcvd

    • georgklein says:

      Have you got a working install of libpng-devel? It’s a bit tricky to get this up under windows if that’s what you’re using. This is why we ship PTAM without needing PNG support.

      • Sam Paech says:

        Thanks for the help Georg. I had neglected to copy libpng’s png.h to my include folder. LibCVD is compiling now, as is PTAM.

        The next problem I’m facing is with compiling PTAMM. This is on windows, by the way. I’m getting some linker errors, such as:

        Error 4 error LNK2001: unresolved external symbol “public: __thiscall CVD::JPEG::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 &)” (??0writer@JPEG@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@@Z) MapSerializer.obj PTAMM

        – and –

        Error 12 error LNK2001: unresolved external symbol __imp__lib3ds_file_open F:\Programming\Roomba\roomba vision\ptamm\PTAMM\Build\Win32\Model3ds.obj PTAMM

        As far as I can tell, I’ve compiled lib3ds correctly and copied the appropriate files to the “lib” and “include” folders, as well as copying the lib3ds dll to the release folder.

        I can paste the full error list if that helps (there are 11 errors).

  34. Kevin Osborn says:

    I’ve been trying out different cameras, and I’ve been getting a lot of crashes in CameraCalibrator. I looked at the release notes for PTAM and there was a fix for crashes. I diffed the files and copied over CalibImage.cc and CalibCornerPatch.cc from PTAM, edited for the namespace, and voila! no crashes. I don’t know if I’ve wiped any PTAMM specific fixes or enhancements, as I don’t really understand the code.

    Also, as and enhancement request, it would be nice if CameraCalibrator read the gvars settings for video source like PTAMM does. I’m working on a new laptop with a built in camera, and have to edit the source to use /dev/video1. It would be more convenient to have it read the settings file.

    • georgklein says:

      Yes, PTAM had some calibrator bugfixes a while ago, maybe they’ve not made it into the PTAMM version yet. Thanks for the heads up.
      As for the settings, calibrator reads the file calibrator_settings.cfg instead of settings.cfg. If you want it to use the same settings, you can symlink it to settings.cfg or add the line “exec settings.cfg” to it.

  35. bong82 says:

    I compiled PTAMM, but followed message occured..
    What’s the problem and how can I fix it..??
    I compiled libCVD according to the manual(p.21~22).
    There is similar question above, but difference is PNG in above question and CVDimage in my case.
    Help me~

    1>LINK : warning LNK4075: ignoring ‘/INCREMENTAL’ due to ‘/OPT:ICF’ specification
    1>libcvd.lib(win32.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
    1>LINK : warning LNK4075: ignoring ‘/INCREMENTAL’ due to ‘/LTCG’ specification
    1>ModelsGame.obj : 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)

    • CACO says:

      Same problem here. Any solution.
      65 link2001 error with the libcvd library.
      error LNK2001…. public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line(…
      error LNK2001…. CVD::CVDimage::reader::size(…
      error LNK2001…. public: void __thiscall CVD::CVDimage::reader::get_raw_pixel_line
      error LNK2001… public: __thiscall CVD::CVDimage::reader::~reader(…

      All defined, i think, into the png.h¿?

    • Lazydev says:

      Exactly the same problem with the one I have…

      Can anyone help?

      • CACO says:

        Is courious too that PTAM that use more or less the same libraries compile and link without problem but PTAMM can´t link.

      • Agostino says:

        I have the same problem:

        1>ModelsGame.obj : error LNK2001: simbolo esterno “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) non risolto
        1>ARDriver.obj : error LNK2001: simbolo esterno “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) non risolto
        1>MapSerializer.obj : error LNK2001: simbolo esterno “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) non risolto
        1>MGButton.obj : error LNK2001: simbolo esterno “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) non risolto
        1>ModelBrowser.obj : error LNK2001: simbolo esterno “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) non risolto
        1>ModelsGame.obj : error LNK2001: simbolo esterno “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) non risolto
        1>ARDriver.obj : error LNK2001: simbolo esterno “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) non risolto
        1>MapSerializer.obj : error LNK2001: simbolo esterno “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) non risolto
        1>MGButton.obj : error LNK2001: simbolo esterno “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) non risolto
        1>ModelBrowser.obj : error LNK2001: simbolo esterno “public: class CVD::ImageRef __thiscall CVD::CVDimage::reader::size(void)” (?size@reader@CVDimage@CVD@@QAE?AVImageRef@3@XZ) non risolto
        1>ModelsGame.obj : error LNK2001: simbolo esterno “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) non risolto
        1>ARDriver.obj : error LNK2001: simbolo esterno “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) non risolto

        [Edit: redundant error messages trimmed by Georg]

    • Christopher says:

      Any solution to this?

      • Agostino says:

        Ok it’s the same problem of FIT, so i deleted references to CVDImage loading / saving in image_io.h and now it works.

      • Agostino says:

        I deletet references to CVDImage and now ptamm compiles, but i can see feature recognition only at first frames and so i can’t create a good map. Any solution to this?

      • thomasR says:

        Which ref in image_io.h should remove?

      • tristan says:

        I’m just fix this problem. It is simple. The CVDImage class source file(cvdimage.cxx) is missed in the default build setting of libCVD. it is located in pnm_src directory. Add that and remake libCVD.(this is very similar step ch 15.3 in manual) And open the PTAMM project. Previous link error will be disappeared but new one is occurring(__imp_ ntohs). It is easy. Just add “Ws2_32.lib” in project.

      • tristan says:

        And don’t use different version libCVD. Current version’s backward compatibility is very bad. libcvd-20100511.zip for PTAM & PTAMM

  36. Bill Necka says:

    I’ve been using several different web cameras to get PTAM up and running to no avail. Is there a comprehensive list of cameras that work? Alternatively, are their any *new* cameras that will also work. Seems a waste to have to use seek out and use old tech for such a modern program. I’ve been testing out the usb version on kameda-lab. I’ve got ptam working up until the error, ‘

    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…
    HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
    Unable to stop the stream.: Bad file descriptor
    … got video source.
    Segmentation fault

    I’ve switched between 1 and 0. Any ideas? Suggestions? Cameras?

    • Bill Necka says:

      The configuration of my system is: AMD 64 X2 Dual Core, 2GB RAM, Geforce 7600 GS w/ 256 MB, running Ubuntu 10.10

    • georgklein says:

      If you can get your camera working with any app under Linux, you should be able to make it work with PTAM, even with the vanilla libCVD video inputs (*). You may have to twiddle the color space settings in the video input. Do you know what color format your camera produces? (Whatever it is it looks like OpenCV is not happy with it..)

      (*) unless it only delivers JPEG – I don’t think libCVD handles this

      • Bill Necka says:

        I’m using a Logitech QuickCam Pro 4000 with a resolution of 640×480. Perhaps there’s a conflict between V4L2 and OpenCV . . . or are the two mutually exclusive? Plus, I’m not entirely sure how to mess with the color space settings in the input as there’s no program that goes with this webcam. It looks like the camera calibrator sees the camera but doesn’t know what to do with the incoming video signal.

      • georgklein says:

        Hmm .. would suggest you try the v4l input which comes with vanilla PTAM, which uses libCVD rather than the OpenCV stuff. Play with the resolution / framerate / colourspace until you find something that works..

        You could also try to run whatever video conferencing program your distro ships with, to see if that recognizes your camera.

  37. Bill Necka says:

    2 questions:

    1) Been playing with PTAMM this morning and ran into the following error while attempting to load ./CameraCalibrator and ./PTAMM:

    “./CameraCalibrator: error while loading shared libraries: lib3ds-2.so.0: cannot open shared object file: No such file or directory”

    Any ideas? Fixes? The pdf was pretty thorough and fairly simple to install. Kudos.

    2) Listed in the PTAMM pdf were several libraries that were needed on linux, namely: blas, lapack, libgfortran, ncurses, libreadline, and so on. Are these libraries I can download with a basic ‘apt-get’ command or do I need to surf the web again for these elusive libraries? Direct links maybe?

    I suppose a 3rd question would be: is the error I’m getting related to the listed pdf libraries?

    • georgklein says:

      1. That looks like you’re missing lib3ds, a library for loading 3DS files (3D studio models, I think Bob uses those in PTAMM).

      2. Those are all fairly standard libraries, which should be installable with apt-get, yes. Don’t know about your distro but on fedora it would have been `yum install blas-devel’ etc. Try running `apt-cache search blas’; if one of the options is for a devel package, you want that one as well as the runtime.

      • Truyenle says:

        having the libraries and having the file lib3ds-2.so.0 under $(HOME)/local/lib/ but still see the error?

  38. enddl22 says:

    I’m trying to run PTAMM1.3 on Macbook pro6,2.

    Although successfully compiled, PTAMM and Cameracali… complained that “BUS ERROR”.

    With the help of vargrind, I could figure out _X11TransWritev may have a bug and residues in /usr/X11/lib/libX11.6.dylib.

    Is there anyone who can debug with me?

    Thanks in advance.

    enddl22

    • Ken says:

      I experienced the same issue after I recompiled my libcvd library to add png support. I replaced the libcvd files in my /usr/local/lib directory with the version that I backed up just before the rebuild and the “Bus Error” went away. Might be something with one of the new dependencies that were compiled.

      I’m still trying to figure out the source of the issue and will post here if I make progress.

      Ken

      • Ken says:

        Hi enddl22,

        Here’s what worked for me. I edited the makefile to move the “-L/opt/local/lib” to the end of the “LOADLIBES=” line in two places in the makefile. There was an issue where make was prioritizing the libraries in the /opt/local/lib over the libraries in /MacOSX…/lib.

        PTAM and PTAMM are both up and running fine… 🙂

        Hope this helps.

        Ken

      • enddl22 says:

        Awesome!
        The problem was in the libcvd makefile.

        As Ken said, libcvd referenced the wrong library which doesn’t have _X11TransWritev.

        After moving “-L/opt/local/lib” to the end of LOADLIBES, it works.

        Your work may need to put on the installation guide for other people.

        If one has “Bus error” while running PTAM on the macbook, try modify “Makefile” on the libcvd with the Ken’s tip.

        Cheers.

      • ciro says:

        I have the same “bus error” problem with PTAMM and I try to recompile the libcvd, but give me the same error
        Must I recompile all code to run?

      • ciro says:

        I change libcvd’s makefile in this way ( in the two places) :

        LOADLIBES = -ltiff -ljpeg -lpng -lpng -lGLU -lGL -ldc1394 -L/sw/lib -framework Carbon -framework QuickTime -L/usr/X11/lib -lX11 -lXext -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -framework Accelerate -pthread -L/opt/local/lib

        but I get this error on png when I make:

        Undefined symbols:
        “_png_set_longjmp_fn”, referenced from:
        CVD::PNG::png_writer::png_writer(std::basic_ostream<char, std::char_traits >&, CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator > const&, std::map<std::basic_string<char, std::char_traits, std::allocator >, CVD::Parameter, std::less<std::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::basic_string<char, std::char_traits, std::allocator > const, CVD::Parameter > > > const&)in png.o
        CVD::PNG::png_reader::~png_reader()in png.o
        CVD::PNG::png_reader::png_reader(std::basic_istream<char, std::char_traits >&)in png.o
        void CVD::PNG::png_reader::read_pixels(unsigned short*)in png.o
        void CVD::PNG::png_reader::read_pixels<CVD::Rgba >(CVD::Rgba*)in png.o
        void CVD::PNG::png_reader::read_pixels(unsigned char*)in png.o
        void CVD::PNG::png_reader::read_pixels(bool*)in png.o
        void CVD::PNG::png_writer::write_line(unsigned short const*)in png.o
        void CVD::PNG::png_writer::write_line(unsigned char const*)in png.o
        void CVD::PNG::png_writer::write_line(CVD::Rgb8 const*)in png.o
        void CVD::PNG::png_writer::write_line(bool const*)in png.o
        void CVD::PNG::png_writer::write_line<CVD::Rgb >(CVD::Rgb const*)in png.o
        void CVD::PNG::png_reader::read_pixels<CVD::Rgb >(CVD::Rgb*)in png.o
        void CVD::PNG::png_writer::write_line<CVD::Rgba >(CVD::Rgba const*)in png.o
        void CVD::PNG::png_writer::write_line<CVD::Rgba >(CVD::Rgba const*)in png.o
        void CVD::PNG::png_reader::read_pixels<CVD::Rgba >(CVD::Rgba*)in png.o
        void CVD::PNG::png_writer::write_line<CVD::Rgb >(CVD::Rgb const*)in png.o
        void CVD::PNG::png_reader::read_pixels<CVD::Rgb >(CVD::Rgb*)in png.o
        ld: symbol(s) not found
        collect2: ld returned 1 exit status
        make: *** [libcvd.dylib] Error 1
        make: *** Waiting for unfinished jobs….
        Undefined symbols:
        “_png_set_longjmp_fn”, referenced from:
        CVD::PNG::png_writer::png_writer(std::basic_ostream<char, std::char_traits >&, CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator > const&, __gnu_debug_def::map<std::basic_string<char, std::char_traits, std::allocator >, CVD::Parameter, std::less<std::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::basic_string<char, std::char_traits, std::allocator > const, CVD::Parameter > > > const&)in png.o
        CVD::PNG::png_writer::png_writer(std::basic_ostream<char, std::char_traits >&, CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator > const&, __gnu_debug_def::map<std::basic_string<char, std::char_traits, std::allocator >, CVD::Parameter, std::less<std::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::basic_string<char, std::char_traits, std::allocator > const, CVD::Parameter > > > const&)in png.o
        CVD::PNG::png_reader::~png_reader()in png.o
        CVD::PNG::png_reader::~png_reader()in png.o
        CVD::PNG::png_reader::png_reader(std::basic_istream<char, std::char_traits >&)in png.o
        CVD::PNG::png_reader::png_reader(std::basic_istream<char, std::char_traits >&)in png.o
        void CVD::PNG::png_writer::write_line(unsigned short const*)in png.o
        void CVD::PNG::png_writer::write_line(unsigned char const*)in png.o
        void CVD::PNG::png_writer::write_line(CVD::Rgb8 const*)in png.o
        void CVD::PNG::png_writer::write_line(bool const*)in png.o
        void CVD::PNG::png_writer::write_line<CVD::Rgba >(CVD::Rgba const*)in png.o
        void CVD::PNG::png_writer::write_line<CVD::Rgb >(CVD::Rgb const*)in png.o
        void CVD::PNG::png_writer::write_line<CVD::Rgba >(CVD::Rgba const*)in png.o
        void CVD::PNG::png_writer::write_line<CVD::Rgb >(CVD::Rgb const*)in png.o
        void CVD::PNG::png_reader::read_pixels<CVD::Rgba >(CVD::Rgba*)in png.o
        void CVD::PNG::png_reader::read_pixels<CVD::Rgb >(CVD::Rgb*)in png.o
        void CVD::PNG::png_reader::read_pixels(unsigned short*)in png.o
        void CVD::PNG::png_reader::read_pixels<CVD::Rgba >(CVD::Rgba*)in png.o
        void CVD::PNG::png_reader::read_pixels<CVD::Rgb >(CVD::Rgb*)in png.o
        void CVD::PNG::png_reader::read_pixels(unsigned char*)in png.o
        void CVD::PNG::png_reader::read_pixels(bool*)in png.o
        ld: symbol(s) not found
        collect2: ld returned 1 exit status
        make: *** [libcvd_debug.dylib] Error 1

  39. Steven Bellens says:

    I’ve succesfully compiled PTAM and it’s dependencies on a Fedora 14 x86_64 system. However when starting the CameraCalibrator it always segfaults:

    (gdb) run
    Starting program: /home/u0063509/Downloads/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 0x7ffff3bb9700 (LWP 22159)]
    VideoSource_Linux: Opening video source…
    > … got video source.

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff7ad6c3c in CVD::GLWindow::init (this=0x7fffffffd138, size=…, bpp=, title=”Camera Calibrator”, disp=fid, fixed->fid, ‘ ‘, ‘ ‘, &black, &black);
    (gdb) bt
    #0 0x00007ffff7ad6c3c in CVD::GLWindow::init (this=0x7fffffffd138, size=…, bpp=, title=”Camera Calibrator”, disp=<valu
    at cvd_src/glwindow.cc:110
    #1 0x0000000000408297 in GLWindow2::GLWindow2(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >) ()
    #2 0x0000000000431fd4 in CameraCalibrator::CameraCalibrator() ()
    #3 0x0000000000432fde in main ()

    Did anyone see this problem before? I’m working with the Nvidia drivers.
    Any suggestions on how to solve it?

    Steven

  40. ilke.muhtaroglu says:

    Hi Georg,

    You and Arnaud was discussing about segmentation fault when 2nd time space bar is pushed.
    At the forum with your answer Arnaud solved the issue, but it was not clear for me what to do to solve the compilation issue of

    “Check that -llapack -lblas come before -lopencv”

    “Perhaps try linking BLAS/LAPACK explicitly early on in the linker line.”

    here what do you mean, at which file we should do this at compilation of TooN, at compilation of PTAM…

    can you give a detailed answer to this problem.

    ilke

    • georgklein says:

      Some people use OpenCV because they can’t get their video input to work with libCVD alone. I don’t really recommend this, libCVD should work for most people, but it sometimes take a few minutes to modify the code to suit the individual’s system / video source.

      OpenCV includes its own BLAS and LAPACK. These are two libraries used for linear algebra. PTAM uses these as well and hence links to them. The OpenCV ones interfere with this and this can cause a crash.

      The solution is to tell the linker to prefer the system BLAS / LAPACK by putting those earlier in the linker parameter list than OpenCV.

      If the above makes no sense, you have to understand that the build is a two-stage process: First .cc files are compiled to .o files; then the .o files are linked together with libraries to build the executable. Read up on the GCC compiler and Makefiles if necessary.

  41. Christof says:

    Hi Georg,

    thank you for developing this nice software. My master’s thesis is based on PTAM and I extended it to work with a stereo camera. Here, I encountered a small bug in the initialization phase, namely in the “InitFromStereo” function. If you triangulate the initial tracked correspondences, you set up the patch stuff for the new 3D point like this:

    MapPoint *p = new MapPoint();

    // Patch source stuff:
    p->pPatchSourceKF = pkFirst;
    p->nSourceLevel = 0;
    p->v3Normal_NC = makeVector( 0,0,-1);
    p->irCenter = vTrailMatches[i].first;
    p->v3Center_NC = unproject(Camera.UnProject(p->irCenter));
    p->v3OneDownFromCenter_NC = unproject(Camera.UnProject(p->irCenter + ImageRef(0,1)));
    p->v3OneRightFromCenter_NC = unproject(Camera.UnProject(p->irCenter + ImageRef(1,0)));
    normalize(p->v3Center_NC);
    normalize(p->v3OneDownFromCenter_NC);
    normalize(p->v3OneRightFromCenter_NC);
    p->RefreshPixelVectors();

    I think, the problem here is the last line of code. Up to this point, the map point has no valid 3D position assigned, however the “RefreshPixelVectors()” requires a valid 3D position. So, I think this function has to be called AFTER assigning the triangulated 3D position. Is this a correct solution?

    Christof

    • georgklein says:

      Yes you are right, this is a bug. I think the reason it has gone un-noticed until now is that usually the stereo init goes on to call ApplyGlobalTransformationToMap() or ApplyGlobalScaleToMap(), both of which re-refresh all the pixel vectors, so the incorrect ones are never used? If you were to remove both of those calls, there would be problems (presumably this is the case with you).

      Thanks
      Georg

      • Christof says:

        Yes, you are right. I’ve commented out the ApplyGlobalTransformationToMap() function and therefore all map points that are created by the tracking correspondences are deleted by the map maker respectively are not found by tracker.

        Thank you for the explanation.

        Christof

      • Christof says:

        Yes, I’ve commented out the ApplyGlobalTransformationToMap() function and therefore all map points that are created by the tracking correspondences are deleted by the map maker respectively are not found by tracker.

        Thank you for the explanation.

        Christof

  42. W.Mingliang says:

    Hey, Georg:
    I am a graduate student in Japan, I am trying to use img_save(mMap.vpKeyFrames[i]->aLevels[0].im, ost1.str()); (Originally //)
    in the function of MapMaker::GUICommandHandler(string sCommand, string sParams), but it causes problems, and I really don’t know how to handle that, could you help we find the problem.
    Best regards.
    W. Mingliang

    • georgklein says:

      Getting image saving to work requires that image load/save are correctly set up in libCVD. This is tricky on some platforms, requiring a bunch of image load/save libraries (especially on windows, it’s tricky to get libPNG to work right.) That’s why it’s commented out (//) by default..

      • W.Mingliang says:

        It’s run under windows, so is there any other possible operations to make image saving done..
        Thank you.
        W. Mingliang

      • georgklein says:

        I’m sure there are – in fact there are some win32 API calls you can make. Or just save the raw pixels to disk and convert it later, is probably easiest, if you can’t get libCVD working.

  43. MarkE says:

    Hi George ,
    I’ve recently run into a problem building PTAMM on Ubuntu 10.04. I originally compiled all of the libraries from source then built PTAMM with the provided makefile without too much trouble. Sometime early last week I started getting this error:
    g++ -o PTAMM main.o GLWindow2.o GLWindowMenu.o VideoSource_Linux_DV.o System.o ATANCamera.o KeyFrame.o MapPoint.o Map.o SmallBlurryImage.o ShiTomasi.o HomographyInit.o MapMaker.o Bundle.o PatchFinder.o Relocaliser.o MiniPatch.o MapViewer.o ARDriver.o EyeGame.o Tracker.o tinyxml.o tinyxmlerror.o tinyxmlparser.o MapLockManager.o MD5.o MD5Wrapper.o MapSerializer.o Games.o Utils.o ShooterGame.o ShooterGameTarget.o ModelsGame.o ModelBrowser.o ModelControls.o MGButton.o Model3ds.o ModelsGameData.o -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd -l3ds
    Model3ds.o: In function `PTAMM::Model3DS::_GenerateDisplayList(Lib3dsFile*, bool)’:
    Model3ds.cc:(.text+0x510): undefined reference to `lib3ds_mesh_calculate_vertex_normals’
    Model3ds.o: In function `PTAMM::Model3DS::_Load()’:
    Model3ds.cc:(.text+0x12b0): undefined reference to `lib3ds_file_open’
    collect2: ld returned 1 exit status
    make: *** [PTAMM] Error 1

    And here’s the command used to compile Model3ds.o in case it is of any use:
    g++ Model3ds.cc -o Model3ds.o -c -I MY_CUSTOM_INCLUDE_PATH -D_LINUX -D_REENTRANT -Wall -O3 -march=nocona -msse3 -fno-strict-aliasing -DENABLE_MODELS_GAME

    Both lib3ds_mesh_calculate_vertex_normals and lib3ds_file_open are defined in /usr/local/include/lib3ds.h, so I’m not really sure what the issue is. Have you come across this before or do you have any suggestions as to how to solve it?

    Thanks.
    M

    • georgklein says:

      This is a linker error, not a compile error, although the -l3ds should link that properly for you. Not sure what the problem is here. Try running nm on the lib3ds to see if the missing symbols are in there

    • Kevin Osborn says:

      One of my engineers suddenly started getting this error after a system software update, and we still haven’t located the cause, however, adding /usr/local/lib/lib3ds.so explicitly to the command line solves the problem.
      (add it to LINKFLAGS in the makefile)

      If anyone figures out what update causes this, I’d like to remove the cause (and not just treat the symptom.)

    • James Coates says:

      Make sure you’re running the correct version of Lib3DS (2.0 RC1 I believe), the old version can cause this error.

  44. W.Mingliang says:

    Hi, George:
    I saved 3D feature points information v3PosK = pKF->se3CfromW * point.v3WorldPos, but the depth value seems to be wrong (irrelavant to reality) when I try to estimate the depth map of Key frames. I am using a web camera, is this to do with the camera calibration?
    When I calibrate the camera, I always got “Current RMS pixel error is 1.#QNAN” and “Current camera params are 1.#QNAN 1.#QNAN 1.#QNAN 1.#QNAN”…. What’s this problem is?
    Thank you for your time.
    Wang Mingliang

  45. ilke.muhtaroglu says:

    Hi George,

    For segmentation fault error you told at this forum :

    “Perhaps try linking BLAS/LAPACK explicitly early on in the linker line.”

    and the answer to your post was it worked.

    Can you please explictly tell at which library’s make file / at which compilation unit we should do this and with which compilation parameter?

    thanks
    ilke

  46. Puneeth says:

    Hi Georg,

    I am feeding PTAM with a 320×240 video stream through Opencv interface. However when I run CalibrateCamera program I get seg fault after a few frames (infact few min)
    CVD::image_interpolate::operator[] (this=0xbffc6878, im=…) at /usr/local/include/cvd/image_interpolate.h:186

    Is a problem of using 320×240 size or the video source ? I checked all the places where 640×480 is used and replaced with 320×240. I still get seg fault.

  47. kdjado says:

    Hello,

    I have these linkage errors for building PTAM on with Visual Studio 2005:

    GLWindow2.obj : 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)

    GLWindow2.obj : 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)

    ..\Build\Win32\Debug\CameraCalibrator.exe : fatal error LNK1120: 2 unresolved externals

    I think that this is done by glew. I verify the link in the project properties and it seem no problem.

    Have you any idea?

    Thanks again,

    Khalid.

  48. W.Mingliang says:

    Hi, Georg:
    I want to apply PTAM with outdoor environment, but the feature points are always not stable and 3d information is not quite right, do you have some tips in operating PTAM with outdoor?
    Best regards.
    Wang Mingliang

    • georgklein says:

      For outdoors with busy textures such as grass and leaves, PTAM’s reliance on FAST corner repeatability is a problem. To start, I would change the tracker behaviour so that patches are searched exhaustively in a circular window around the prior projection, rather than only looking near FAST responses. Feature initialization can similarly be improved (see our 2009 paper for PTAM on iPhone) but that is more difficult to implement.

  49. Srinidhi SIMHA says:

    Hi Georg,
    Fantastic piece of work. I have compiled PTAMM on ubuntu 10.10 successfully (of course managed to overcome the hurdles). I am getting black & white video even with [coloron] option in cameracalibrator. The UI is not working for me (mouse click – no button is enabled). I wonder has this got to do with my linux platform? Let me know your thoughts on this. Thanks in advance.

    Sri

    • bobcastle says:

      Hi Sri,

      – Firstly have you tried compiling PTAM and running the Camera Calibrator that comes with that? The code should be identical, so I would expect the same output.
      – Secondly, what camera are you using?
      – Thirdly, what is this coloron option?

      I have built and run on Ubuntu 9.04, so 10.10 should be fine.

  50. JC Antonioli says:

    Hello George,

    First of all: congratulations for your great work!

    I am a newly research engineer working on a project which needs to find solutions to geolocate precisely a system in a hard environnement (in which gps doesnt work for example): I am following the way of using PTAM (one of possible solution) right now, in order to see wether it is a good idea to use it for the final solution or not. So I am trying to get it work with the equipments we already have.

    After some days trying to compile PTAM (and others libraries) on Windows 7 64bits, it seems to be working now (except warnings…): it only “seems” because I am trying to use the “Guppy” camera from “Allied Vision Technology”, using the 1394 firewire technology, but 0 camera is found when i start your program. I am not a professional in vision, but could you give me a trick for that? I have tried to use the “1394 camera demo” program, but the camera is not seen too. I can have good videos (640×480 with 60 fps) with a program provided by the company (ActiveCam Viewer : http://www.alliedvisiontec.com/emea/products/software/windows/avt-active-firepackage.html). I have seen “Video Sources” on your blog, but I am on a 64bit version, so I am not sure to be on the right way to follow.

    Many thanks for any piece of advice you could give!

    JC.

    ps: I am french, sorry for my english…

    • georgklein says:

      Looks to me like they ship an SDK for accessing the camera. I suggest you use this AVT SDK to build your own VideoInput.cpp file which works for that camera. Depending on the camera, you may have to do your own bayer->Y and bayer->RGB conversion…. maybe the AVT SDK does this for you, otherwise there’s de-bayering functions included with libCVD.

      Sorry, but I can’t help further with this – there’s so many different cameras and OSs that we can’t really support video input code. It’s up to each user to gain programmatic access to the camera pixels, and the VideoInput.h interface is super-simple to make this easy. Bonne chance!

      • JC Antonioli says:

        Many thanks for this advice: it is already very great, and I was not asking any more. I thought this is what I should do, but I was just not sure of it. I will try this as soon as possible and get you feedback (maybe in many weeks… when I will have time for this).

        Cheers!

      • JC Antonioli says:

        Hi Georgklein,

        I have not succeeded to use the guppy camera yet, but I have not worked a lot for this. An example code is given, but this is in .NET, which I don’t know very well, so I gave up… I think this is possible, but my aim is not to make this specifiec camera work, so I have tried to use others cameras, and I have succeeded in it following the Arnaud Grosjean’s way.

        So, for those who absolutely want to use the Guppy (or Guppy PRO) camera, download the “Active Fire Package”, and install it. To install the driver, there is “AFP Driver Installer” in this package, use it: this should work. If it doesn’t, go to the device manager, and reinstall manually the driver in the “IEEE 1394 controler” category: use the driver you will find in the folders created with the installation of the AVT Fire Package. After this, you should see the image with AVT ActiveCam Viewer (all those programs are installed with the package). Then, to get camera image, there is an example code in .NET: search in the folders created by the installation, you should find some VS projects files. I can’t help further, but I hope this will help some guys.

        Cheers!

    • Jakob says:

      Hi JC Antonioli,

      i’m trying to do the same thing, setting up PTAM under windows 7 – could you give me some hints on how to do it or maybe even send me the working project?
      that would be great!

      cheers,
      jakob

      • JC Antonioli says:

        Hi Jakob,

        I am on PTAM again (after 2 months of break ^^) I finally got it worked with win7 64bit with VS2008, with the included webcam of the laptop and a Logitech QuickCam Chat (driver installed manually) + OpenCV with the very great help of Arnaud Grosjean and his example code (I had to copy quite the same code, excepts for includes because I am not on Linux system).

        @ Jakob: the best should be to ask me for advice when you are blocked: enventually, I can answer you for specific questions if necessary. But I have succeded to get it work by debugguing, and with the help of google for errors I didn’t know. I think anyone can do it, even if you are far from being a specialist in programming (it’s my case). It may take some hours of work. Sending you directly the compiled program may be impossible, as its weight is around 100Mo… But please, don’t hesitate to ask questions, I will be happy to answer.

        Now that PTAM works perfectly, I am going to try get PTAMM work now.

        @ Arnaud Grosjean: the default resolution of my Logitech Quickcam Chat is 320×240. I know i can use 640×480 with this camera, but with your code, it seems impossible to change resolution. I have tried something like :


        VideoCapture camera(0);
        camera.set(CV_CAP_PROP_FRAME_WIDTH, 640);
        camera.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
        Mat frame;
        camera >> frame;

        But this doesn’t work (even with OpenCV 2.2), I still have 320×240 input video. Then, I have tried:


        CvCapture * camera = cvCreateCameraCapture(0);
        cvSetCaptureProperty(camera, CV_CAP_PROP_FRAME_WIDTH, 640);
        cvSetCaptureProperty(camera, CV_CAP_PROP_FRAME_HEIGHT, 480);
        Mat frame;
        frame = cvQueryFrame(camera);

        … which works perfectly on a simple project, but I have errors when I use it…

        Cheers,

        JC

  51. sri says:

    Hi Bob,
    Thanks for the information. Its working fine now.. Mine is an inbuilt laptop dell 1555 studio camera. I tried with a USB camera(intex IT-305WC) but in vain. I have to look into it, any ideas???
    Now i am looking to customize some of the features available out of my own interest.

    Regards,
    Sri

  52. Nahom says:

    Hello,
    I am trying to compile PTAM on visual c++ 2008. I followed the example steps on the manual and everything seemed ok, but when I tried to run cameraCalibrator ,I get this error
    Parsing calibortor_settings.cfg….
    ! GUI_impl::Loadfile: Failed to load script file “calibrator_settings.cfg”
    CMU 1394 driver camera interface
    The camera am using is a Logitech quick cam pro 4000.
    Is there any libraries or steps I missed?
    Thanks
    Nahom

    • georgklein says:

      Move the calibrator_settings.cfg to whatever path the program runs in.

      • Truyen says:

        In addition to georgklein’s suggestion, you might need to change the video source since Logitech Pro 4000 is not a fire-i camera and you can’t use CMU 1394 driver.

        You should visit https://ewokrampage.wordpress.com/video-sources/ to get OpenCV and the source code for this. There is only linux code there, you need to modify a bit as
        * change all instance of type -> CVD::type
        * Remove the line #include
        Place this file under PTAMM (running) folder.
        Goodluck

  53. luis galup says:

    i would like to use my own calibration algorithm.

    what exactly am i solving for? its not simply focal length, but focal length divided by size of pixel, is that correct, (in appropriate units, of course?)

    thanks, and sorry for the newbie question.

    • georgklein says:

      2 parameters focal, 2 parameters image center, in units of image width / height respectively. So yes if you have a 640×480 image and you want the equivalent focal length / center in pixels, multiply params[0] & params[2] by 640, params[1] & params[3] by 480.

      Last parameters is radial distortion according to the Devernay / Faugeras paper (see the ATANCamera.h file for the reference)

  54. Nahom says:

    Hello,
    I am trying to compile PTAM in windows visual studio 2008. I followed the example steps on the manual and everything seemed ok, but when I tried to run cameraCalibrator I get this error
    Parsing calibortor_settings.cfg….
    ! GUI_impl::Loadfile: Failed to load script file “calibrator_settings.cfg”
    CMU 1394 driver camera interface
    The camera am using is a Logitech quick cam pro 4000.
    Is there any libraries or steps I missed?
    Thanks
    Nahom

  55. Truyen says:

    Hi all,

    Now I did try PTAMM with Snow Leopard after dissatisfy with the performance in windows.

    I did follow the instruction on manual for my Snow Leopard 10.6.

    I can run the CameraCalibrator well and get the RMS error down to 0.15. That’s really good.

    However, the camera.cfg doesn’t created after I click save. Although the message is saying that it is save to camera.cfg.
    At the top of this calibration I also see a “Failed to load script file “calibrator_settings.cfg”.

    I just by pass that step and then grap the camera.parameters and create the file camera.cfg manually in the PTAMM folder.

    Then I run PTAMM, the message I have is as:

    tle-macbook:~ tle$ /Users/tle/Src/PTAMM/PTAMM ; exit;
    Welcome to PTAMM
    —————-
    Parallel tracking and multiple mapping
    Copyright (C) Isis Innovation Limited 2009

    Parsing settings.cfg ….
    ! GUI_impl::Loadfile: Failed to load script file “settings.cfg”.
    VideoSource_OSX: Creating QTBuffer….
    IMPORTANT
    This will open a quicktime settings planel.
    You should use this settings dialog to turn the camera’s
    sharpness to a minimum, or at least so small that no sharpening
    artefacts appear! In-camera sharpening will seriously degrade the
    performance of both the camera calibrator and the tracking system.
    > .. created QTBuffer of size [640 480]
    ? GV3::Register: TooN::Vector Camera.Parameters undefined. Defaults to 0.5 0.75 0.5 0.5 0.1

    ! Camera.Parameters is not set, need to run the CameraCalibrator tool
    and/or put the Camera.Parameters= line into the appropriate .cfg file.

    logout

    [Process completed]

    So It seems that it is failed to load the script file settings.cfg?

    Any idea how to overcome this?

    Thank you
    Truyenle

    • georgklein says:

      PTAM reads files from the current working directory. You’ll see that it put the camera.cfg in your home folder.
      Try cd /Users/tle/Src/PTAMM first.

      • It happens the same error, I do not understand how to fix it. I do not understand what do you mean the line “cd / Users / tle / Src / PTAMM”.

        Could you explain better, how to make the program read the file PTAMM camera.cfg

  56. Truyen says:

    Hi Goergklein,

    Thank for your response.

    Under /Users/tle/Src/PTAMM there is only one camera.cfg file manually created by me. If I delete this one and do the calibration again. There is no file created.

    At the beginning of the calibration, it said “Failed to load script file “calibrator_settings.cfg”. Although, at the end of the calibration it said the camera parameters is saved to camera.cfg. I can’t see the camera.cfg files.

    So is the message “Failed to load script file “calibrator_settings.cfg” does give us a hint to fix?

    Thank
    Truyen

  57. Truyen says:

    Oh, Just now I got your idea. I should cd to Users/tle/Src/PTAMM and then run the CameraCalibrator or PTAMM.

    but when I am in /Users/tle/Src/PTAMM I run either CameraCalibrator or PTAMM it said that
    “-bash: CameraCalibrator: command not found”

    ??? I did change the file so that it is executable as
    chmod +x CameraCalibrator

    Still the same?

    Any idea?
    Truyen

  58. Truyen says:

    Something weird here.
    I am in /Users/tle/Src/PTAMM/ but if I just type PTAMM it will said “-bash: CameraCalibrator: command not found”

    I have to type in /Users/tle/Src/PTAMM/PTAMM then it is ok.

    Any idea?
    Truyen

    • ThomasR says:

      Hello,

      I compile PTAMM with a lot of linker error.

      ModelsGame.obj : error LNK2001: Nicht aufgelöstes externes 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)”.
      1>ARDriver.obj : error LNK2001: Nicht aufgelöstes externes 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)”.
      1>MapSerializer.obj : error LNK2001: Nicht aufgelöstes externes 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)”.
      1>MGButton.obj : error LNK2001: Nicht aufgelöstes externes 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)”.
      1>ModelBrowser.obj : error LNK2001: Nicht aufgelöstes externes 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)”.

      and so on.

      What is the problem with the CVDimage::reader?

      I read here, to solve this problem, i need to deleted same references in image_io.h. But which oneß

      My system: Vs2010/Win7
      Info:
      I compile PTAM and all libs with no problems.

      • tristan says:

        I’m just fix this problem. It is simple. The CVDImage class source file(cvdimage.cxx) is missed in the default build setting of libCVD. it is located in pnm_src directory. Add that and remake libCVD.(this is very similar step ch 15.3 in manual) And open the PTAMM project. Another prev link error will be disappeared but new one is occure(__imp_ ntohs). It is easy. Just add “Ws2_32.lib” in project.

  59. Thomas says:

    I get some error at linking the ptamm source on windows.
    It seems there are a problem with the cvdimage::reader.

    In a comment above was describe that the removing of a reference in the image_io.h solve this problem.

    I try some from the FITS but nothing work.

    Which references should be remove?

    • georgklein says:

      Remove anything which references the cvdimage filetype in the loader and saver.

      • Thomas says:

        Thank you for the quick response.
        The answer was not very accurate but I have found the right source code.

        The following lines of code in the file image_io.h (libcvd), I commented out:

        line 254: else if (c == 'C ')
        line 255: CVD:: Internal:: read image (im, i);

        and

        line 314: case ImageType:: CVD: Internal:: write image (im, o, p) break;

        i hope this helps others.

      • Thomas says:

        corrections of the code:
        line 254: else if (c == ‘C ‘)
        line 255: CVD:: Internal:: read image (im, i);
        and
        line 314: case ImageType:: CVD: Internal:: write image (im, o, p) break;

  60. raequin says:

    Hi, just started working with PTAM, used the pre-cooked linux image and it seems to be running okay. I have not gotten past the CameraCalibrator because my USB camera won’t be recognized. The built-in webcam comes up, but that is the only camera I can get PTAM to take notice of. If I try “./CameraCalibrator 1” the following message is returned.

    “HIGHGUI ERROR: V4L: index 1 is not correct!
    Unable to get the camera 1”

    There are only two cameras on my system, the webcam and the USB camera. The latter is a Point Grey Chameleon. I have installed the FlyCapture SDK software so that the Point Grey camera works on my system — I can use FlyCapture to capture images, etc. However this USB camera appears to not be detected by PTAM. Any help would be greatly appreciated.

    By the way, for your interest, the intended application of PTAM here is uncalibrated visual servoing of a robot. Thanks.

    • georgklein says:

      Point Grey cameras (even USB ones) can sometimes be driven using libDC1394v2, if your version of the library supports it.
      Otherwise your best bet is to make a videoinput which uses FlyCapture directly. If you look at the video inputs page, there’s one which uses the Win32 FlyCapture2 SDK, you can probably adapt that to Linux.

      • raequin says:

        Thanks for the reply. Unfortunately do not know how to “driv[e] using libDC1394v2” or adapt the Win32 code to Linux. Is either of these a quick adjustment that you could give me pointers on? Otherwise I will have to talk to someone around here with more computer savvy than I. Again, thanks.

      • georgklein says:

        You will need to write the code to do video input, or find someone to do it for you. This is not usually difficult: the interface which PTAM uses is very simple, and you probably have example code with your camera which demonstrates how to access the device.

  61. Truyenle says:

    Hi,

    Is there a way to implement virtual navigation in PTAMM. I mean i have virtual buttons like next + previous on top of the real world to go through steps. Would be cool if user can just touch these virtual buttons to navigate through steps.

    Thanks

    • Georg Klein says:

      PTAM / PTAMM is primarily a camera tracking system. As a side effect of its operation, it generates a point cloud and takes a few snaps of the (static) world. Anything beyond that (tracking users’ hands etc) is up to you!

      • Truyenle says:

        Thank Georg,

        But it seems that tracking users’ finger or hand is not that good. Not so many points or event no point is tracked.
        Thanks

  62. raequin says:

    I’ve successfully installed and run the “reference implementation of PTAM,” but would like to know if there is more information about what this implementation does (or can do), or guides for how to adapt PTAM to different applications. Thank you!

  63. Christian Stewart says:

    Hey!

    Ive followed the example install line for line carefully for Windows. I’m on Windows 7, and plan to switch out the video source for OpenCV, if this helps.

    When building LibCVD I get a TON of fatal errors. I’ve pastebin’d my build log file here:

    http://pastebin.com/nsN5uyKx

    If you could please help me it would be great 🙂 I’m really looking forward to getting this working.

    Christian

  64. Christian Stewart says:

    Hi,

    Now I’m having another problem… I think the PTAM website is down. I am at the step when I compile PTAM itself, but since I cannot find it online :/

    Christian

  65. Christian Stewart says:

    Okay, now I found it somewhere on my computer. Is TooN supposed to have a numerics.h header file? I cannot find it in the TooN include files and PTAM is getting build errors because it cannot include it (not found).

    Thanks
    Christian

  66. superylc says:

    Hello,

    I compile PTAM on ubuntu 10.10 and meet following error seem related to namespace CVD. Much appreciate if any one could help!

    System.o: In function `System::Run()’:
    System.cc:(.text+0x27f4): undefined reference to `CVD::GLWindow::swap_buffers()’

    VideoSource_Linux_DV.o: In function `VideoSource::VideoSource()’:
    VideoSource_Linux_DV.cc:(.text+0x247): undefined reference to `CVD::DV3::RawDVBuffer3::RawDVBuffer3(CVD::DV3::DV3ColourSpace, unsigned int, CVD::ImageRef, float, CVD::ImageRef)’
    VideoSource_Linux_DV.o: In function `VideoSource::VideoSource()’:
    VideoSource_Linux_DV.cc:(.text+0x403): undefined reference to `CVD::DV3::RawDVBuffer3::RawDVBuffer3(CVD::DV3::DV3ColourSpace, unsigned int, CVD::ImageRef, float, CVD::ImageRef)’

    GLWindow2.cc:(.text+0x13b1): undefined reference to `CVD::GLWindow::size() const’
    GLWindow2.cc:(.text+0x1450): undefined reference to `CVD::GLWindow::size() const’
    GLWindow2.cc:(.text+0x14dd): undefined reference to `CVD::GLWindow::size() const’

  67. W.Mingliang says:

    Hi, Georg:
    I don’t know the meaning of the color for each feature point. There are red, green, blue and yellow ones.
    So please could you let me know.
    Best~
    WANG Mingliang

    • georgklein says:

      The colors correspond to what level of the image pyramid the point is measured in. If you have a VGA-sized input, red dots are measured in the 640×480 image, yellow in 320×240, green in 160×120, blue in 80×60.

  68. Ivan says:

    Why me when installing lidcvd throwing in the terminal error
    /local/include/TooN/se3.h:403: error: no matching function for call to ‘sqrt(const double&)’ and similar bug me and jumps on line 423

  69. Ivan says:

    in command make-j3

    ?? /root/local/include/TooN/se3.h:403: error: no matching function for call to ‘sqrt(const double&)’
    make: *** [progs/se3_exp.o]

    const Vector w = mu.template slice();
    const Precision theta_sq = w*w;
    const Precision theta = std::sqrt(theta_sq); // line 403 + std::
    Precision A, B;

    template
    inline Vector SE3::ln(const SE3& se3) {
    Vector rot = se3.get_rotation().ln();
    const Precision theta = std::sqrt(rot*rot); // line 432 + std::

  70. Ivan says:

    I gave and extract from the terminal

    const Precision theta = using std::sqrt(theta_sq); // line 403 + using std::
    const Precision theta = using std::sqrt(rot*rot); // line 432 + using std::

    root@ivang:/home/ivan/Src/libcvd# make -j3
    g++ -O3 -march=native -I. -I. -I/root/local/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c progs/se3_exp.cxx -o progs/se3_exp.o
    g++ -O3 -march=native -I. -I. -I/root/local/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c progs/se3_ln.cxx -o progs/se3_ln.o
    g++ -O3 -march=native -I. -I. -I/root/local/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c progs/se3_pre_mul.cxx -o progs/se3_pre_mul.o
    In file included from ./cvd/se3.h:25,
    from progs/se3_exp.cxx:22:
    /root/local/include/TooN/se3.h: In static member function ‘static TooN::SE3 TooN::SE3::exp(const TooN::Vector&) [with int S = 6, P = double, A = TooN::Internal::VBase, Precision = double]’:
    progs/se3_exp.cxx:34: instantiated from here
    /root/local/include/TooN/se3.h:403: error: no matching function for call to ‘sqrt(const double&)’
    In file included from ./cvd/se3.h:25,
    from progs/se3_pre_mul.cxx:23:
    /root/local/include/TooN/se3.h: In static member function ‘static TooN::SE3 TooN::SE3::exp(const TooN::Vector&) [with int S = 6, P = double, A = TooN::Internal::VBase, Precision = double]’:
    progs/se3_pre_mul.cxx:50: instantiated from here
    /root/local/include/TooN/se3.h:403: error: no matching function for call to ‘sqrt(const double&)’
    /root/local/include/TooN/se3.h: In static member function ‘static TooN::Vector TooN::SE3::ln(const TooN::SE3&) [with Precision = double]’:
    /root/local/include/TooN/se3.h:84: instantiated from ‘TooN::Vector TooN::SE3::ln() const [with Precision = double]’
    progs/se3_pre_mul.cxx:61: instantiated from here
    /root/local/include/TooN/se3.h:432: error: no matching function for call to ‘sqrt(double)’
    In file included from ./cvd/se3.h:25,
    from progs/se3_ln.cxx:22:
    /root/local/include/TooN/se3.h: In static member function ‘static TooN::Vector TooN::SE3::ln(const TooN::SE3&) [with Precision = double]’:
    /root/local/include/TooN/se3.h:84: instantiated from ‘TooN::Vector TooN::SE3::ln() const [with Precision = double]’
    progs/se3_ln.cxx:32: instantiated from here
    /root/local/include/TooN/se3.h:432: error: no matching function for call to ‘sqrt(double)’
    make: *** [progs/se3_ln.o] Error 1
    make: *** Waiting for unfinished tasks….
    make: *** [progs/se3_pre_mul.o] Error 1
    make: *** [progs/se3_exp.o] Error 1

  71. Adam Clixby says:

    Hi Georg,
    You say that the iOS version of your PTAM implementation if available for commercial licensing. Could you please provide further information?

    Thanks,
    Adam

    • georgklein says:

      Isis Innovation (which is the University of Oxford’s tech transfer agency) handles the licensing of MiniPTAM – however it may currently already be under exclusive license. If you e-mail me I can provide suitable contact details for Isis.

  72. Dave says:

    Is there anyway this technology could use an input from a HD film camera using professional grade video capture cards? Would in theory, a decent computer be able to sustain a high enough frame rate of a video at 1920×1080?

    • georgklein says:

      I don’t know how you’d get live video capture from such a device, but if you can, sure PTAM can use it. Don’t try using the full 1920×1080 image though – shrink it down to something much smaller before feeding it to PTAM. (You won’t lose accuracy noticeably.) PTAM is tuned for 640×480, any size around that should be OK, but the image dimensions have to be multiples of 16.

  73. Eric says:

    Dear Mr. Goergklein,

    I am a Chinese student in Ph.D. course, working on PTAM.I want to use PTAM on
    a mobile robot for localization and map building by intergrating other sensor
    such as a LRF.I have some troubles, and tangled with them for a long time.I
    am wondering if you would like to review these problems and give me some advices.

    (1)when the stereo initialization is done,the value of baseline doesn’t
    match with the actual distance which the camera moved.
    eg.when I translate the camera about 0.05m,in the souce of MapMaker.cc
    the value of ‘dTransMagn ‘is about 0.03.I think it is a prior value
    gathered from camera motion model,but how can I get the real?

    (2)Similar to the question(1),how can I get the real coodinate of feature
    points and camera poses.I try to change the scale of transformation matrix,
    which is like “->se3CfromW.get_translation()*dTransMagn”,but I still cann’t
    get it.

    I did the calibration of camera,the parameter is,
    “Camera.Parameters=0.681844 0.907543 0.496279 0.550505 0.797204”

    I know it might not be polite to let you answer a stranger’s questions.
    But PTAM is so advanced that nobody around me can help me with this. I really need your help.
    I am looking forward to hearing from you soon. Thank you very much.

    Best regards!

    • georgklein says:

      Monocular systems are fundamentally unable to compute an accurate scale of the world. It will set an arbitrary scale which you can then transform to correspond to a world scale.

      (2). For camera pose, try se3CfromW.get_inverse().get_translation(), this is the camera center in world coords.

      Your camera parameters seem fine, this looks a very wide-angle lens, which is good.

    • James says:

      Also the feature points in world coords could be found at

      mpViewingMap->vpPoints[i]->v3WorldPos

  74. Lena says:

    I would like to ask for help in installing to PTAMM. When you compile gvars3 me writes an error. Thank you for your help.

    lena@lena-A6Je:~/gvars3$ make install
    mkdir -p //home/lena/local/lib
    cp libGVars3.a libGVars3_headless.a libGVars3_debug_headless.a libGVars3_debug.a
    //home/lena/local/lib
    cp: can not stat() `libGVars3_debug_headless.a’: Directory or file does not exist
    cp: can not stat() ` libGVars3_debug.a’: Directory or file does not exist
    make: *** [install-static] Error 1
    lena@lena-A6Je:~/gvars3$

    • georgklein says:

      Does not seem like a serious problem if the debug version of the libs are linking. If necessary just copy the release versions manually to /home/lena/local/lib, and the headers to /home/lena/local/include/GVars3

  75. Richard says:

    Hi Georg,

    I managed to get it working on a cam (320×240 pixels, 15fps) . I reduce the number of level in the pyramid to 3. I was able to calibrate it once (Camera.Parameters=[ 0.646536 0.875323 0.492232 0.498406 0 ]) but later calibrator started to crash in between with seg fault.
    PTAM kind of works, but tracking is fails very often. I am not from computer vision background. Also nobody around me could advice me on these things.

    1) Are the calibration numbers good?
    2) I incereased the number of features it detects in level 0 (fast_corner_detect_10 function call) to 15. Is that right? I found that in some keyframes only 1 or 2 points detected and added.
    3) How could I make tracking more roboust? (Could you indicate in specific section of code)

    Any addition input is welcome.

    Thank you

  76. Ivan says:

    Hi George
    After make PTAMM I tried to run. / CameraCalibrator or PTAMM and writes me an error.

    root@ivang:~/Src/PTAMM# ./CameraCalibrator
    ./CameraCalibrator: error while loading shared libraries: libcvd.so: cannot open shared object file: No such file or directory

  77. ohad ronen says:

    Hi Georg,

    I’ve read a few papers of yours (including some part of your thesis) and was very impressed, especially from “parallel tracking and mapping for small AR workspaces”. The results are amazing!

    I’m interested in implementing on Matlab the main idea of pose estimation as described in this paper , but i couldn’t quite understand section 5.4 “pose update”. I didn’t realise the algorithm – what is the explicit form of the Tukey biweight objective function (there are a few versions of it in the literature), and how do I weight my samples? It’s only described in a very high level in your paper.

    I’ve also tried to find another paper of yours that describes the same algorithm of pose update, but with no success.

    Can you please refer me to a more detailed reference, or alternately explain the process of pose update?

    Best regards!

    Ohad

  78. Ivan says:

    Forgive me for constantly nag but after two weeks I reached a stage

    ivan@ivang:~/Src/PTAMM$ ./CameraCalibrator
    Welcome to CameraCalibrator
    ————————————–
    Parallel tracking and mapping for Small AR workspaces
    Copyright (C) Isis Innovation Limited 2008

    Parsing calibrator_settings.cfg ….
    VideoSource_Linux: Opening video source…
    >
    !! Failed to run CameraCalibrator; got exception.
    Exception was:
    DVBuffer3: No cameras found.

    ivan@ivang:~/Src/PTAMM$

    I using usb webcam logitech Pro Webcam C910 ?

    • JC Antonioli says:

      Hi Ivan,

      I have used a Logitech QuickCam Chat to get PTAM works (and it works well now).
      1. Can you get image with another tool from your camera?
      2. If yes, you can get image from camera thanks to OpenCV. I advice you to learn how to compile OpenCV, and then how to use it to get image from Cameras.
      3. Once you have done this, I advice you to look at Arnaud Grosjean example file given in “Video Source” category.

      I hope this will help you.

      Cheers!

  79. Petar Ducic says:

    Dear George,
    i’m pretty new in PTAM technology and implementations, so I just wondered how difficult it would be exporting your implementations to Android platform? Thanks in advance!

    • georgklein says:

      There’s already a project to do this port somewhere on the internet, try doing a search on youtube for this.
      How difficult? Depends on the individual – some folks pick up the code and get running in a day, others struggle to get their compilers / linkers to work. Impossible to generalize.

    • JC Antonioli says:

      Hi again Georg,

      I have seen you have already tried to make it work on iPhone… I would be very interested in following that way using a fisheye for iPhone like http://www.pixeet.com/fisheye-lens and merging data from accelerometers/gyrometers with those from PTAM. I have never used an iPhone, but I really think it may be possible… could you give some advice(s) please? Would it be possible to get the code you used to make PTAM work on iPhone?

      Many thanks again! Your work is really impressive!

  80. JC Antonioli says:

    Hi again Georgklein!

    I have another (I hope it’s the last one) error while compiling PTAMM (I am in realease mode, am I right?):

    \TooN/SymEigen.h(186) : error C3861: 'swap' : identifier not found

    Any issue known for this? (google doesn’t help a lot…)

    Cheers!
    JC

    • JC Antonioli says:

      I am sorry for this stupid previous post: the solution is given in the manual (which I have not read for a while…). What must be done is just adding #include at the top of the “SymEigen.h” file and replace all occurancies of swap by std::swap in this same file.

      Cheers!

    • JC Antonioli says:

      Here is another issue if you have a kind of LNK2005 error… for each sub-project (Calibrator and PTAM(M)):
      -> right click -> properties -> Configuration properties -> Linker editor -> Command Line -> add this, without the quotes : “/FORCE:MULTIPLE”

      Enjoy!

      • Shahzor Ahmad says:

        Hey JC,

        I’ve been at compiling PTAM on Window 7 for days now, going through the many hurdles that arise in compiling the many dependencies for PTAM. At the end, PTAM compiled fine thanks to the nice user manual for PTAMM (with a few warnings here and there). But when it came to the linking, I used to get around 55 similar link errors (all link 2005 errors), and at the end there was a warning saying “defaultlib ‘MSVCRTD’ conflicts with use of other libs; use /NODEFAULTLIB:library”. Needless to say, using /NODEFAULTLIB also doesn’t help!

        After a lot of googling, I got here (http://brianhoffmann.de/journal/thesis/2011-05-19/compiling-ptam-win32/), which pointed me to your post. This really does help, although I don’t really understand what this new command line to the linker actually does, or why I get errors without it. Now, instead of the link errors, I’m getting warnings that complain about missing .pdb files. Any how, PTAM’s running, so the situations seems to be fine for now 🙂

        Thanks,
        Shahzor Ahmad.

  81. Vincent says:

    Dear George,
    After compiled the PTAM (Windows VS2008), I run the CameraCalibrator. There is only a black screen without video. But After I Commented the lines with SVD(calibimage.cc and cameracalibrator.cc), then it video comes our. Is there some solution with this issue? I tried all the version of TooN, it is not solved.

    Best regards!
    Vincent

  82. Pingback: Compiling PTAM (Win32) | Journal: Masterstudium

  83. Truyenle says:

    Any of you has tried the Vuzix Wrap 920 glass (http://www.vuzix.com/consumer/products_wrap920.html) with PTAMM. I did a try and didn’t give a good result.

    Any idea how to improve it would be awesome.
    Thanks

  84. Truyen says:

    I have PTAMM setup and run ok on Mac os x 10.6.

    I then want to add my game as the instruction, but first I need to get PTAMM as a project under NetBean 6.9.

    I have NetBean installed (C/C++ Plugin) and work great with other project also.

    I then Create New Project -> C/C++ -> C/C++ Project with Existing Sources => Browse to PTAMM folder under /Users/tl/Src/PTAMM

    The project is created with the configuration as the makefile, So I got the project inside NetBeans. I do a Clean and Build with the result is
    “BUILD SUCCESSFUL (total time: …)”

    But the problem is when I run it (Run -> Run Project (PTAMM)), I got:

    “dyld: Library not loaded: libGVars3-0.6.dylib
    Referenced from: /Users/tle/Src/PTAMM/PTAMM
    Reason: no suitable image found. Did find:
    /usr/local/lib/libGVars3-0.6.dylib: mach-o, but wrong architecture
    /Applications/NetBeans/NetBeans 6.9.app/Contents/Resources/NetBeans/ide/bin/nativeexecution/dorun.sh: line 33: 5945 Trace/BPT trap sh “${SHFILE}”
    Press [Enter] to close the terminal …

    And under Output I got
    “Process is started in an external terminal …

    RUN FAILED (exit value 133, total time: 469ms)”

    Any help please. Thank you so much.

  85. tkeemon says:

    Hi Georg-

    I think that I have come across a bug in the PTAMM code and I’m not exactly sure how to go about fixing it. Whenever I load a map from the Serialize menu, I run into one of two problems:
    -key frames are added to the current map at a very fast rate (without adding any additional map points)
    -key frames are rarely if ever added to the current map

    I can work around this problem through the following procedure:
    -load map000000 through the Serialize menu
    -create a new map
    -initialize the new map
    -switch back to the map000000

    I traced the problem to the variable mdWiggleScaleDepthNormalized in MapMaker.cc. It looks like this variable is only given a value in the function MapMaker::InitFromStereo(), which is never called when loading a serialized map. The uninitialized variable is then having an arbitrary effect on the return value of MapMaker::NeedNewKeyFrame().

    My problem is that I don’t understand the purpose of mdWiggleScaleDepthNormalized. Should it be a global variable inside of the MapMaker class that is given a new value every time a new map is created (like it is now) or should each individual map retain its own copy?

    Any guidance you could give would be great.

    Thanks

    -TJ

  86. Zwart says:

    Hi,
    I’am trying to use PTAMM on windows XP and I’m using the DirectShow video capture file.
    It compile fine, but it seems to have a little problem when I run it.
    In fact, the map isn’t update at any time. When I move my camera around, there is no new points appearing on the map.
    I tried to look after the code a little and it seems (not sure about it, just have a fast look) that the thread of the map is always locked so in the Run method of the MapMaker, I can’t reach the AddKeyFrameFromTopOfQueue function.
    I don’t know if this is because of windows or something else but if you add an idea or any clue it would be great.

    Thanks

    Zwart

  87. Truyenle says:

    Got question, Why PTAMM doesn’t perform that well on Window? I really want to improve this but don’t know how to start? Any clue would be very much appreciated.

    Thanks
    Truyen

  88. Truyen says:

    Thank georgklein, seems that it’s not that easy to do after trying to research on this for a while.

    I have another question, PTAMM is auto switch between the maps which is good. However, I do need to switch manually, how do I do this? I mean which code segment control this?

    Thanks
    Truyen

  89. Will says:

    * Please disregard previous message

    Hi, Georg,
    First of all, congrats for the library. Unfortunately I’m still not able to compile it. At first, the compiler was complaining about the videodev.h header:

    | In file included from VideoSource_Linux_OpenCV.cc:20:0:
    | /usr/local/include/cvd/Linux/v4lbuffer.h:32:29: fatal error: linux/videodev.h: No such file or directory

    It seems that support for v4l1 was dropped for the latest linux kernels (including the one in Natty), so there are issues with libcvd, even the most up to date version. The quick hack to fix this would be installing libv4l-dev (obviously) and changing the header from
    | #include videodev.h
    to
    | #include libv4l1-videodev.h
    With angled braces around it. However I can’t use, otherwise the text inside it disappears.

    This fix the header problem, but now there is another issue:

    | In file included from VideoSource_Linux_OpenCV.cc:20:0:
    | /usr/local/include/cvd/Linux/v4lbuffer.h:83:40: error: ‘V4L2_PIX_FMT_GREY’ was not declared in this | scope
    | /usr/local/include/cvd/Linux/v4lbuffer.h:102:40: error: ‘V4L2_PIX_FMT_YUYV’ was not declared in
    | this scope
    | /usr/local/include/cvd/Linux/v4lbuffer.h:108:40: error: ‘V4L2_PIX_FMT_UYVY’ was not declared in
    | this scope
    | /usr/local/include/cvd/Linux/v4lbuffer.h:114:40: error: ‘V4L2_PIX_FMT_YUV420′ was not declared in
    | this scope
    | /usr/local/include/cvd/Linux/v4lbuffer.h:120:40: error: ‘V4L2_PIX_FMT_RGB24′ was not declared in
    | this scope
    | /usr/local/include/cvd/Linux/v4lbuffer.h:126:40: error: ‘V4L2_PIX_FMT_RGB32′ was not declared in
    | this scope
    | make: *** [VideoSource_Linux_OpenCV.o] Error 1

    I’m guessing the API has changed, but I couldn’t find the equivalent #defines in “libv4l1-videodev.h”. Maybe it was moved to another header. Anyone has any idea about what to do here?

    Thanks,
    Will

    • georgklein says:

      Have you tried using the CVD video inputs first, before OpenCV?
      The CVD v4l code doesn’t use V4L1 I think… most everything uses V4L2, as you can see from the error messages you’re getting.

      • Will says:

        Okay, I found a way to fix it. Besides “libv4l1-videodev.h” I had to include “videodev2.h” in cvd/Linux/v4lbuffer.h. Also, the libcvd version contemporary to PTAM wouldn’t compile because of some inline assembly issue that I can’t recall now, but the most up to date one compiles ok and seems to be compatible with PTAM.

        I’m not sure if it’s the most correct solution, but hey, at least it works.

        I made some changes in Kameda’s bash script and patches for taking that in account and thought it could be useful for someone using Ubuntu Natty. Here it is: http://www.mediafire.com/?7m9f3h1t4b34x5g . The universe repository is required.

        Will

      • truyenle says:

        Will,
        So it seems that you got it work in Ubuntu11.04, what version of OpenCV are you using? Is it 2.1 or 2.2?
        Also stuck on this.

        Thanks

      • Will says:

        Hi, truyenle,

        I used OpenCv 2.1, the one in the apt repositories. It can get a little tricky, since it’s divided into several packages.

        Will

  90. Steph says:

    Hi,
    I am very interested on augmented reality applications and I find this one wonderfull! I begin to code some easy programs with opencv to calibrate a camera with a chessboard and add a 3D object on it. I also read your papers to try to understand how it works but it’s too difficult for me unfortunately ^^. I can’t ask you all my questions but one in particular that I think is important for me to understand better. In my opencv program, I have to consider that all my 3D points are one a plane (on the chessboard), but in PTAM the points are everywhere, sometimes on the walls … Does that mean that, if I want to use points on an object, I have to calculate the real 3D coordinates? Or does PTAM consider that all the tracked points are on the ground?

    Thanks!

    • georgklein says:

      Points in PTAM are fully 3D.

      It does initially fit a plane to the points and call that plane z=0.. but points are not constrained to lie on that plane at all, and the plane convention exists only to provide a coordinate frame for user graphics.

  91. Will says:

    I have tried to compile PTAM with Kameda’s patch and bash script inside a jail root with Ubuntu 10.10 libs. The compilation goes fine, but when I try to run CameraCalibrator or PTAM I get the following:

    $ valgrind ./CameraCalibrator

    KMD: parsing command line options …
    Parsing calibrator_settings.cfg ….
    VideoSource_Linux: Opening video source…
    > … got video source.
    ==17022== Invalid read of size 4
    ==17022== at 0x51DAE12: CVD::GLWindow::init(CVD::ImageRef const&, int, std::string const&, std::string const&) (glwindow.cc:53)
    ==17022== by 0x406832: GLWindow2::GLWindow2(CVD::ImageRef, std::string) (in /root/PTAM-work/PTAM/CameraCalibrator)
    ==17022== by 0x429C59: CameraCalibrator::CameraCalibrator() (in /root/PTAM-work/PTAM/CameraCalibrator)
    ==17022== by 0x42BCCF: main (in /root/PTAM-work/PTAM/CameraCalibrator)
    ==17022== Address 0x10 is not stack’d, malloc’d or (recently) free’d
    ==17022==
    ==17022==
    ==17022== Process terminating with default action of signal 11 (SIGSEGV)
    ==17022== Access not within mapped region at address 0x10
    ==17022== at 0x51DAE12: CVD::GLWindow::init(CVD::ImageRef const&, int, std::string const&, std::string const&) (glwindow.cc:53)
    ==17022== by 0x406832: GLWindow2::GLWindow2(CVD::ImageRef, std::string) (in /root/PTAM-work/PTAM/CameraCalibrator)
    ==17022== by 0x429C59: CameraCalibrator::CameraCalibrator() (in /root/PTAM-work/PTAM/CameraCalibrator)
    ==17022== by 0x42BCCF: main (in /root/PTAM-work/PTAM/CameraCalibrator)

    So, I tried to use the most up to date libcvd, but the segfault remains. Any ideas of what could be happening? Also, SagarJ posted a similar problem in the “Video sources” thread.

    Thanks,
    Will

    • georgklein says:

      Perhaps visualInfo==0. Check for this. There’s a check a few lines above which perhaps tests the wrong variable for zero..
      If visualinfo is indeed null, your graphics card + driver combo can’t provide the correct colour space for PTAM. Are you using an nvidia card + nvidia drivers?

  92. Ivan says:

    H,
    it is possible to embed animated objects to PTAMM

    • Truyenle says:

      Same concern like Ivan. Since PTAMM uses lib3ds to import .3ds model, I don’t think that it can import animated object but I think we can utilize lib3ds to animate the object in the code when the model is already imported?
      That’s what I know, just correct me if I’m wrong.

      Of if there is any other way to handle this, please share georgklein?

      Thanks
      Truyenle

      • Truyenle says:

        In Addition, I saw this video that does have object animated but don’t know how to achieve this.

        Truyen

      • georgklein says:

        A lot of the graphics in that were done using a quake .md2 model loader. I adapted the example code from GameTutorials.com, back when that site was still free.
        We cannot share this code.

      • georgklein says:

        The point of PTAM is to provide camera tracking. All the graphics stuff is really included just as examples of how you can use tracking to insert graphics. Anything more fancy is up to you!

  93. Hong says:

    Hi Georg,
    I am study in SLAM with edges. I want to ask if the source code with the edges can be offered now. Or maybe the source code of Edgelets of Ethan. I have written an email to Ethan, but it always failed. Maybe you could offer some help.

    Thanks,
    Hong

  94. A. K. says:

    Hi George,

    Thanks for sharing your program, it is appreciated indeed.
    I could compile PTAMM on ubuntu 10.4. Now the problem is that, when I try to run the program, I get the error message:

    Parsing calibrator_settings.cfg ….
    VideoSource_Linux: Opening video source…
    ? GV3::Register: string VideoSource.V4LDevice undefined. Defaults to “/dev/video0”
    ? GV3::Register: CVD::ImageRef VideoSource.Resolution undefined. Defaults to [640 480]
    ? GV3::Register: int VideoSource.Framerate undefined. Defaults to 30
    >
    !! Failed to run CameraCalibrator; got exception.
    Exception was:
    V4LBuffer: “V4L2: VIDIOC_S_FMT” ioctl failed on /dev/video0: Invalid argument

    My cameras are “uEye” and “logitech QuickCam 3000”.

    I already have noticed to one of your replies saying “Change the color format in the source code to something that your camera does support.”

    In “VideoSource_Linux_V4L.cc”, I have already replaced all the types with “Rgb8”, “bayer_grbg”, etc. already defined in “v4lbuffer.h”, but got no answer. The Logitech camera is already working in “Cheese” software on ubuntu, and also the os recognizes it as “/dev/Video0”, but I don’t know what is still my invalid argument.
    Would you please kindly let me know which parts should be changed to get the program running?

    Thanks a lot,
    A. K.

    • georgklein says:

      Sorry, but I can’t help you with the specifics of any one webcam. There are thousands, and some work better than others with the V4L stack.
      Try using the other software to determine what color format the webcam actually returns. If the other software is open-source, you can also try extracting the video capture code from that and using it in PTAM.

  95. truyenle says:

    I know we have _DrawAxes() method under ModelsGame.cc to draw the Axes of the axes at the origin. But I don’t know how to translate this to the center of the screeen always.
    How to Draw a 3D axis in the middle of the screen regardless of the Camera position?

    Thanks
    Truyen Le

    • Truyenle says:

      For this, I got it solve by the following steps
      1. Get 4 points in camera coordinate (close to the origin (0, 0, 0.5), one on x, one on y, and close to z)
      2. Convert these 4 points coordinate to 3D world
      3. Draw 3 lines that each of them originate from origin
      By this I always have the 3 axes in front of me regardless of the camera location and rotation.

    • georgklein says:

      Do you mean in AR mode or in tracking mode? In either case, in world coordinates, the axes would be axis aligned but offset by a time-varying translation. This translation would be fixed in camera coords, i.e. [0 0 dist]. Transform this through the inverse camera pose to get world coords:
      tracker.pos.inverse() * [0 0 dist]

  96. Christian Stewart says:

    Hey,

    I finally got PTAMM up and running, however I seem to not have a suitable webcam for this project, as it does not have a wide enough angle on its lens.

    I have been looking for one which would be good to buy however have not found one as of yet. Which webcam , preferably cheap, would you recommend I buy? I am looking for the < $40 price range.

    Thanks very much. I was looking at this but am not sure wether it has enough angle to it (70*)
    http://www.amazon.com/Microsoft-LifeCam-VX-6000-Webcam-Gray/dp/B000EVM5DU

    Thanks,
    Christian

    • georgklein says:

      Not had much good experience with any off-the-shelf webcams, I’ve usually ended up replacing the lens with a much wider M12 mount one.
      Having said that, I’ve used the MS lifecam cinema (or something like that) and it sort of worked; just don’t use any of the HD modes.

      • Bill says:

        Hi George, will the Apple iSight firewire camera work? I’ve a got a version of PTAMM running with a USB webcam, however video stream is a bit choppy (but the track fairly stable). I’m not concerned with how wide the angle of the lens is as I’ve got a way around that. Or better yet, any specific suggestions (brand, model, etc) on webcams you can recommend?

  97. junsik says:

    Hi Dr. Klein,

    I would like to test the PTAM on my computer, but unfortunately I have got a compilation error in compiling the libcvd library. My system has Ubuntu 10.04 x86_64 on the Intel Core2 Quad CPU, and the gcc version is 4.4.3. I downloaded the source codes as directed in the README file.

    The particular error message is as follows.


    g++ -I. -I. -INONE/include -g -Wall -Wextra -pipe -ggdb -fPIC -msse -msse -msse2 -msse3 -pthread -D_GLIBCXX_DEBUG -DCVD_IMAGE_DEBUG -c cvd_src/i686/yuv411_to_stuff_MMX_64.C -o debug/cvd_src/i686/yuv411_to_stuff_MMX_64.o
    cvd_src/i686/yuv411_to_stuff_MMX_64.C: In function ‘void CVD::ColourSpace::yuv411_to_rgb_y(const unsigned char*, int, unsigned char*, unsigned char*)’:
    cvd_src/i686/yuv411_to_stuff_MMX_64.C:246: error: bp cannot be used in asm here
    make: *** [debug/cvd_src/i686/yuv411_to_stuff_MMX_64.o] Error 1

    This seems a problem of inline asm. Because of this error, I can not go further.
    Do you have any idea?

    Thank you.

    Junsik

    • georgklein says:

      Either a bug in the x86_64 asm code, or the configure script is getting confused about what to put in the Makefile. Either way, you could just disable the compile unit which was the function which does not compile, and replace it with the plain .c version. Finally, unless you actually need YUV411 to XXX conversion, you could just remove all references to that from libCVD altogether.

      • junsik says:

        Thanks, I disabled the “mmxext” in the compilation of libcvd, and it worked.
        If someone has the same problem, try “–with-mmxext=no” when configuring the libcvd.

        Thanks again.

  98. 27roboman says:

    Hi I am a linux user running into issues when installing libCVD:
    sudo make install yields:

    cvd_src/i686/yuv411_to_stuff_MMX_64.C: In function ‘void CVD::ColourSpace::yuv411_to_rgb_y(const unsigned char*, int, unsigned char*, unsigned char*)’:
    cvd_src/i686/yuv411_to_stuff_MMX_64.C:246: error: bp cannot be used in asm here
    make: *** [debug/cvd_src/i686/yuv411_to_stuff_MMX_64.o] Error 1

    Any suggestions?

    Thanks

    • georgklein says:

      Either a bug in the x86_64 asm code, or the configure script is getting confused about what to put in the Makefile. Either way, you could just disable the compile unit which was the function which does not compile, and replace it with the plain .c version. Finally, unless you actually need YUV411 to XXX conversion, you could just remove all references to that from libCVD altogether.

  99. CH Wang says:

    Hey,
    I compiled the PTAM and met this problem:

    Parsing setting.cfg….
    !GUI_impl::loadfile:failed to load script file “camera.cfg”
    CMU 1394 driver camera interface.>
    Found 0 cameras
    !Not enough cameras found – exit

    I use a MS HD LifeCam which you have mentioned above. My system is Windows XP.
    Thanks,
    Wang

  100. Justin says:

    Hello, I was wondering if there is a way to get the camera’s translation in any sort of physical unit. Right now the only numbers I can see seem to be relative to the 16×16 grid that the initial map creates, whose size varies depending on the scene. Is there a way to set up the scene or initial map or something in the code I can use to get the camera location in something like feet or meters?

    Thank you

    • georgklein says:

      No, scale is fundamentally a gauge freedom for a mono system. If you were to add inertial sensors or some sort of known target, then you could fix the scale.

  101. truyenle says:

    Well,
    Any one successful on running PTAMM on ubuntu 11.04, please help to share.
    I have been trying and not success yet.

    Thanks

  102. Hey georg,

    I wish to use a custom video source. The video source I want to use would be this:

    Images would be taken rather than from a webcam, but from a c# Image. The project will be separate and can be referenced.

    How can I make your awesome PTAMM access and utilize a Image on a separate project?

    Thanks,
    Christian

    • georgklein says:

      The VideoSource.{cc,h} files have a very simple structure. Put whatever video loading code you want in there.

      • 27roboman says:

        Hello,
        So has anyone implemented a program like this? One that uploads a video for PTAM or PTAMM? If you have and would be willing to share the code, it would be super appreciated!!

        Thanks
        -J

  103. roboman27 says:

    I am getting the following error message when I use the Logitech C905:

    ————————–
    Parallel tracking and mapping for Small AR workspaces
    Copyright (C) Isis Innovation Limited 2008

    Parsing calibrator_settings.cfg ….
    VideoSource_Linux: Opening video source…
    ? GV3::Register: string VideoSource.V4LDevice undefined. Defaults to “/dev/video0”
    ? GV3::Register: CVD::ImageRef VideoSource.Resolution undefined. Defaults to [640 480]
    ? GV3::Register: int VideoSource.Framerate undefined. Defaults to 30

    !! Failed to run CameraCalibrator; got exception.
    Exception was:
    V4LBuffer: failed to open “/dev/video0”: No such file or directory
    ——————————————————————-
    I am getting the following message when I use the Logitech Quickcam Pro 5000:

    Parsing calibrator_settings.cfg ….
    VideoSource_Linux: Opening video source…
    ? GV3::Register: string VideoSource.V4LDevice undefined. Defaults to “/dev/video0”
    ? GV3::Register: CVD::ImageRef VideoSource.Resolution undefined. Defaults to [640 480]
    ? GV3::Register: int VideoSource.Framerate undefined. Defaults to 30
    !! Failed to run CameraCalibrator; got exception. Exception was:
    V4LBuffer: “V4L2: VIDIOC_S_FMT” ioctl failed on /dev/video0: Invalid argument
    —————————

    I am not sure if this is a driver issue, or how I could resolve this problem. When I try to use guvcview with the C905, the camera cannot be viewed either and I receive message “unable to open device…make sure correct driver is installed”. This is with linux drivers for usb cameras installed (http://qce-ga.sourceforge.net/).

    So, I have tried using the pre-configured linux code by Yoshinari KAMEDA (http://www.kameda-lab.org/_local/imagelab.tsukuba.ac.jp/ubuntu1004+opencv21/PTAMk/index-e.html). And when I run [./CameraCalibrator 1] the video from the C905 appears. I am unable to toggle the “capture image button” however. And after 45 seconds the program crashes. He uses OpenCV instead of V4L for video input. I am mentioning this as it might be relevant to the issue I am having getting my compiled PTAM to run.

    I would appreciate anyway you can point me in the right direction.

    Thanks,

    • georgklein says:

      What video* files are there in /dev/?

      • 27roboman says:

        Yea, so this error resolved itself mysteriously and PTAM worked well, but now it has returned.
        video0 and video1 (although only one camera is connected) are in dev, I’ve tried both:

        Welcome to PTAM
        —————
        Parallel tracking and mapping for Small AR workspaces
        Copyright (C) Isis Innovation Limited 2008

        Parsing settings.cfg ….
        ? GUI_impl::ParseLine: Unknown command “/” or invalid assignment.
        VideoSource_Linux: Opening video source…
        ? GV3::Register: string VideoSource.V4LDevice undefined. Defaults to “dev/video1”
        ? GV3::Register: CVD::ImageRef VideoSource.Resolution undefined. Defaults to [640 480]
        ? GV3::Register: int VideoSource.Framerate undefined. Defaults to 30

        !! Failed to run system; got exception.
        Exception was:
        V4LBuffer: failed to open “dev/video1”: No such file or directory
        >
        j

      • georgklein says:

        You probably want “/dev/video1” instead of “dev/video1” (you’re missing the beginning forward slash)

  104. Valdemar says:

    Hello,
    I’m having a problem with running PTAM. It compiled successfully, and calibration was successfull too, the camera.cfg file contains Camera.Parameters=[ 1.07221 1.41408 0.495148 0.367848 0.0359471 ]. when i run it i get the following output:
    Parsing settings.cfg ….
    VideoSource_Linux: Opening video source…
    > … got video source.
    ! GV3:Parse error setting TooN::Vector Camera.Parameters from [ 1.07221 1.41408 0.495148 0.367848 0.0359471 ]
    ARDriver: Creating FBO… .. created FBO.
    PTAM: MEstimator.h:79: static double Tukey::FindSigmaSquared(std::vector<double, std::allocator >&): Assertion `vdErrorSquared.size() > 0′ failed.
    Aborted

    What may be causing the problem?

  105. Steve says:

    Hi,
    I’m a complete Linux n00b. I’m only using it so that I can compile and run PTAMM, so please forgive any omissions, and don’t assume I’ve done anything right. I followed the instructions at http://www.minus-reality.com/how-to-run-ptamm-in-ubuntu-9-10/ to make sure I got all the necessary libraries.

    However, when I try to make the PTAMM itself, I get the output below (and a whole lot more errors, but I figured you didn’t want an 800 line post 🙂

    I can post the whole lot if you would prefer. I am running Ubuntu 10.04. I’m guessing that I need to link to the OpenGL libraries, but I don’t know how. I wish visual studio could think for me in Linux like it does in windows 😀

    Regards,
    Steve

    g++ -o PTAMM main.o GLWindow2.o GLWindowMenu.o VideoSource_Linux_V4L.o System.o ATANCamera.o KeyFrame.o MapPoint.o Map.o SmallBlurryImage.o ShiTomasi.o HomographyInit.o MapMaker.o Bundle.o PatchFinder.o Relocaliser.o MiniPatch.o MapViewer.o ARDriver.o EyeGame.o Tracker.o tinyxml.o tinyxmlerror.o tinyxmlparser.o MapLockManager.o MD5.o MD5Wrapper.o MapSerializer.o Games.o Utils.o ShooterGame.o ShooterGameTarget.o ModelsGame.o ModelBrowser.o ModelControls.o MGButton.o Model3ds.o ModelsGameData.o -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd -l3ds
    GLWindow2.o: In function `PTAMM::GLWindow2::PrintString(CVD::ImageRef, std::basic_string<char, std::char_traits, std::allocator >) const’:
    GLWindow2.cc:(.text+0x177): undefined reference to `glMatrixMode’
    GLWindow2.cc:(.text+0x17c): undefined reference to `glPushMatrix’
    GLWindow2.cc:(.text+0x18e): undefined reference to `glTranslatef’
    GLWindow2.cc:(.text+0x1ab): undefined reference to `glScalef’
    GLWindow2.cc:(.text+0x1c8): undefined reference to `CVD::glDrawText(std::basic_string<char, std::char_traits, std::allocator > const&, CVD::TEXT_STYLE, double, double)’
    GLWindow2.o: In function `PTAMM::GLWindow2::SetupVideoOrtho()’:
    GLWindow2.cc:(.text+0x1e0): undefined reference to `glMatrixMode’
    GLWindow2.cc:(.text+0x1e5): undefined reference to `glLoadIdentity’
    GLWindow2.o: In function `PTAMM::GLWindow2::SetupWindowOrtho() const’:
    GLWindow2.cc:(.text+0x230): undefined reference to `glMatrixMode’
    GLWindow2.cc:(.text+0x235): undefined reference to `glLoadIdentity’
    GLWindow2.cc:(.text+0x23e): undefined reference to `CVD::GLWindow::size() const’
    GLWindow2.o: In function `PTAMM::GLWindow2::SetupUnitOrtho()’:
    GLWindow2.cc:(.text+0x28e): undefined reference to `glMatrixMode’
    GLWindow2.cc:(.text+0x293): undefined reference to `glLoadIdentity’
    GLWindow2.o: In function `PTAMM::GLWindow2::DrawBox(int, int, int, int, float) const’:
    GLWindow2.cc:(.text+0x2e1): undefined reference to `glMatrixMode’
    GLWindow2.cc:(.text+0x2e6): undefined reference to `glLoadIdentity’
    GLWindow2.cc:(.text+0x2f0): undefined reference to `CVD::GLWindow::size() const’
    GLWindow2.cc:(.text+0x330): undefined reference to `glOrtho’
    GLWindow2.cc:(.text+0x345): undefined reference to `glColor4f’
    GLWindow2.cc:(.text+0x34f): undefined reference to `glEnable’
    GLWindow2.cc:(.text+0x35e): undefined reference to `glBlendFunc’
    GLWindow2.cc:(.text+0x368): undefined reference to `glBegin’
    GLWindow2.cc:(.text+0x388): undefined reference to `glVertex2d’
    GLWindow2.cc:(.text+0x3aa): undefined reference to `glVertex2d’
    GLWindow2.cc:(.text+0x3d5): undefined reference to `glVertex2d’
    GLWindow2.cc:(.text+0x3ed): undefined reference to `glVertex2d’

  106. Steve says:

    Sorry, that’s an x64 version of Ubuntu.
    Steve

    • zjz870416 says:

      Hi Steve,
      I have the same problem here. undefined reference from gl.h.
      but I pretty sure gl.h is under /usr/include/GL/.
      I modified Makefile:
      COMPILEFLAGS = -I/usr/include/GL -I MY_CUSTOM_INCLUDE_PATH -D_LINUX -D_REENTRANT -Wall -O3 -march=nocona -msse3
      the compiling still cannot finish.
      Do you solve this problem? or anybody can tell me?
      Much appreciated!

  107. Kate says:

    Hi!

    I have successfully compiled PTAMM on Ubuntu 10.4 but am having problems with map stability. The models I place on the map just jump all over the place and the frame rate is ridiculously low. Obviously my first thought was that maybe there’s a problem with camera calibration, so I ran the calibrator to sort it out, but for some reason it runs my built in webcam instead of the USB one (which PTAMM uses when it’s running).

    I have previously compiled PTAM but I used Yoshinari Kameda’s “PTAM-Linux-go” which allows you to choose which webcam you would like to calibrate, but there is no such option for PTAMM.

    Any suggestions on how I can solve this problem would be really brilliant, thanks!

    • georgklein says:

      Likely this just needs you pass the video device (probably something like /dev/video1) to the constructor of whatever V4L video source class you’re using.

  108. truyenle says:

    Specify the coordinate of a point in a map.
    I build a map using PTAMM and I have an interesting point in the map that I want to place object exactly at that point. Using function MoveTo() of Model3ds.cc I can achieve this. However, I don’t know how to specify the exact 3D coordinates for this point? Any help are awesome.

    Thanks

  109. truyenle says:

    OK, I think I should rewrite the question.

    Where it is in the code of PTAMM that it defines the origin (0, 0, 0)? I just want to offset this origin to a specific point in the map.

    Anyone know about this please help to share.

    Thanks

  110. C. H. says:

    Have anyone has experience of loading multiple maps built during a previous run of PTAMM? I could load one map with “LoadMap” (through MapSeridalizer’s member function LoadMap()). Is there any function to load multiple map in PTAMM?

    Thanks,
    ch

  111. Thomas Schmidt says:

    Hi,
    I want to do some calculation on the camera poses, which from the map.xml file, when I save a map.
    For each Keyframe I get somthing like that:

    I guess that the first 3 numbers (-0.140132 1.72254 1.4039) are the x,y,z coordinates in the local system (or with reference to the shown local plane).

    Are the next 3 numbers (1.84488 0.00795219 0.0104966) the angles to the axes of the local coordinate system?
    Or what does the numbers for the camera pose for each keyframe mean?

    Thank you
    Thomas

    • Thomas Schmidt says:

      Oh, it didn’t show the line from map.xml, maybe due to the angle brackets.
      Again( without the angle brackets):

      KeyFrame id=”0″ pose=”-0.140132 1.72254 1.4039 1.84488 0.00795219 0.0104966″ fixed=”1″

      How do I get the orientation of the camera out of the last 3 numbers?

    • georgklein says:

      It’s the logarithm of the [R t] matrix. Run SE3::exp() on that vector to get back an [R,t] pose matrix.

  112. william lai says:

    Hello,the program is awesome

    now i face some issue,how large the .3ds model can be read

    i put the 50mb’s Nerve model on program (like the photo :http://tinyurl.com/3tb6frq)

    when i tracking over and it start to read the model then crash

    popup “s​td::bad_alloc”

    how do i fixed it?

    • robertcastle says:

      Hi, it is possibly a problem with lib3ds, or you are running out of memory. I only used simple models as these were the most reliable, and even some simple models failed to load.

  113. aayalaga says:

    Hello Georg,

    I just set up PTAMM in my computer. I have some textured models that I would like to load using the model loader that comes with the Demos in PTAMM. At this point the model is loaded just perfect, the problems is that it doesn’t have any of the materials or textures I applied to it.

    Is there a way to load 3DS textured models in PTAMM? do I need to modify the source code in order to do that?

    Best regards

    • robertcastle says:

      Hi, PTAMM currently does not load any 3DS model textures. I never got around to figuring out how to get it all working with lib3ds. If you want to load textures, you would have to implement the code yourself.

  114. truyenle says:

    Hi,

    In PTAMM, if we place an object offset the origin using function MoveTo(Vector v3Position) of class Model3ds and if the v3Position’s component values (x, y, z) are closed to origin, then the objects are kind of very stable. However, if the one of the v3Position’s component values (my observation) greater than 0.5 then the objects are sliding when the camera moving. I used a wide angle camera that have the parameter meed the requirement of PTAMM and also the calibration provide a good value as:
    Camera.Parameters=[ 0.860133 1.15033 0.507394 0.523906 1.09021 ]

    The 3rd and 4th are closed to 0.5 and the fifth is closed to 1.0. This should be ok as George mentioned in one of his post?

    Anyway to improve it please help to share.

    Thank you so much for this very helpful blog.
    Truyenle

    • truyenle says:

      Any idea how to improve this, I have this issue whenever I place the object a little away from the origin. It will be sliding when I move the camera.
      Thank
      Truyen

  115. cchien says:

    Hi, Georg:

    I am trying to load multiple maps in PTAMM, but Serializer seems to load only a single map. I tried to figure out how to modify the code in order to load multiple maps, but not sure how to do it. Can you tell me how to load multiple maps in PTAMM?

    Thanks.

    • robertcastle says:

      Hi, there are a few ways to load multiple maps. Please see section 11.2 Console Commands in the manual for full details. In summary:

      Maps are loaded one at a time. If you are using the GUI, and press the Load Map button, PTAMM tries to load a map from the default location with the same number as the current map. So to load multiple maps using the GUI, start PTAMM, press the Load Map button to try and load the map with id 1. Then press New Map to create a new map with the next id (2), and then press Load Map again to try and load map 2. Repeat until all maps are loaded.

      If you use the command line you can load maps by number or name.
      eg. LoadMap 5 or LoadMap /path/to/mapdir. See the docs for more details.

  116. scwuhao says:

    I found a easy way to run PTAM on Ubuntu 11.04- remove V4L1buffer when compiling libcvd:

    $> ./configure –without-ffmpeg –without-V4L1buffer

  117. truyenle says:

    Hello,

    I have some problem in tracking when running PTAMM on objects made by metal that are shinning. When we move the camera, the shinning light does move also => cause lost tracking.

    Any idea how to improve it.

    Thanks

    • truyenle says:

      No response yet after a month!

      Might be I need to rewrite my question.
      How to improve the tracking on shiny device made by metal under normal lighting condition? Actually when the camera is moving, the shiny spots on metal is also moving.

      Please help to share if you know anyway to improve this?

      Thank
      Truyenle

  118. truyenle says:

    Might be a silly question but I can’t figure out an easy way to do.

    I’m using PTAMM and build multiple Maps: Map0, Map1, Map2. Is there an easy way to know the coordinates of origin of Map1 and Map2 in Map0.

    Well, right now what I try is to place two objects belong to Map0 but move them to the location of Map1 and Map2. This is handy and not that very precisely. I just want to know if is there anyway in the code that we can pull out this info if possible.

    Thanks

    • robertcastle says:

      The maps in PTAMM are completely independent. If you want to link the maps, you will have to do that yourself, maybe by matching keyframes and features.

      • truyenle says:

        Thank robertcastle, so it seems that we can’t get it from the code especially the maps that I mentioned are completely different, no overlapping sections. That means if I try to match keyframes + features => The result should be no matching.

  119. David says:

    Hi,

    Great work! and thanks for sharing.
    I was wondering, what algorithm did you use for the calibration module?
    The file ATANCamera.h mentions that the distortion model used is from the paper:
    Deverneay and Faugeras, Straight lines have to be straight, 2001

    But the iterative method to compute them does not seem to come from the same paper. Could you point me to the original paper, I’d like to understand the algorithm in detail.

    Thanks

    • georgklein says:

      It’s just a big nonlinear minimization of reprojection error over individual poses and the joint camera intrinsics. Nothing fancy, as evidenced by the fact it can often go wrong.

      • David says:

        Thank you for your answer.

        I was actually trying to understand why the calibration optimization does not converge for certain (rather low-quality) webcams.

        I tried to calibrate a Logitech HD Pro C910, a very good webcam, everything went fine (quick convergence, RMS of about 0.5, camera params are 0.87, 1.16, 0.49, 0.48, -0.16). The tracking is also very good. I thought the fact that the webcam automatically focuses on the grid (auto-focus-like feature) when zooming in and out the grid would mess up the calibration but apparently it did not.

        Then I tried to calibrate another webcam of much lower quality (logitech C300, no auto-focus). The optimization never converges and the RMS keeps going from 1.0 up to 3.0 from one iteration step to another.

        Do you have any idea why this is happening?
        What camera parameter influences the calibration process so badly?
        Isn’t the auto-focus of the good webcam suppose to compromise the calibration since it changes the lens parameters from one screenshot to another?

        Thanks

  120. Takayuki Sasaki says:

    Dear Mr. Goergklein,

    I’m very interested in your work and tried to compile PTAM on OSX 10.6(macbook pro) in 32 bit.
    But I’m running into issues when installing libCVD.
    The particular error message is as follows.

    Undefined symbols:
    “std::basic_ostream<char, std::char_traits >& std::basic_ostream<char, std::char_traits >::_M_insert(unsigned long)”, referenced from:
    CVD::BMP::read_header(std::basic_istream<char, std::char_traits >&)in bmp.o
    “std::basic_ostream<char, std::char_traits >& std::__ostream_insert<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*, int)”, referenced from:
    CVD::Exceptions::DiskBuffer2::BadSeek::BadSeek(double)in diskbuffer2.o

    “std::basic_istream<char, std::char_traits >& std::basic_istream<char, std::char_traits >::_M_extract(unsigned int&)”, referenced from:
    get_uint(std::basic_string<char, std::char_traits, std::allocator > const&)in fits.o
    “std::basic_istream<char, std::char_traits >& std::basic_istream<char, std::char_traits >::_M_extract(double&)”, referenced from:
    get_double(std::basic_string<char, std::char_traits, std::allocator > const&)in fits.o
    “std::basic_ostream<char, std::char_traits >& std::basic_ostream<char, std::char_traits >::_M_insert(double)”, referenced from:
    CVD::Exceptions::DiskBuffer2::BadSeek::BadSeek(double)in diskbuffer2.o
    “std::basic_ostream<char, std::char_traits >& std::basic_ostream<char, std::char_traits >::_M_insert(long)”, referenced from:
    CVD::PS::WritePimpl::output_header() in save_postscript.o
    “std::basic_istream<char, std::char_traits >& std::basic_istream<char, std::char_traits >::_M_extract(long&)”, referenced from:
    CVD::PNM::pnm_in::read_header() in pnm_grok.o
    “std::basic_istream<char, std::char_traits >& std::basic_istream<char, std::char_traits >::_M_extract(unsigned long&)”, referenced from:
    CVD::PNM::pnm_in::get_raw_pixel_lines(unsigned short*, unsigned long)in pnm_grok.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make: *** [libcvd.dylib] Error 1

    Any suggestions?
    If you could please help me, it would be great.

  121. Jacob Bowen says:

    I am having trouble building PTAM under Ubuntu Linux 11.04. When I attempt to build PTAM I get the following errors and more like them.

    $ sudo make
    g++ -o PTAM main.o GLWindow2.o GLWindowMenu.o VideoSource_Linux_V4L.o System.o ATANCamera.o KeyFrame.o MapPoint.o Map.o SmallBlurryImage.o ShiTomasi.o HomographyInit.o MapMaker.o Bundle.o PatchFinder.o Relocaliser.o MiniPatch.o MapViewer.o ARDriver.o EyeGame.o Tracker.o -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd -lGL -lGLU -llapack
    VideoSource_Linux_V4L.o: In function `VideoSource::VideoSource()’:
    VideoSource_Linux_V4L.cc:(.text+0x2b1b): undefined reference to `CVD::V4L::V4L2Client::V4L2Client(int, unsigned int, CVD::ImageRef, int, bool, int, bool)’
    VideoSource_Linux_V4L.cc:(.text+0x2c29): undefined reference to `CVD::Exceptions::V4LBuffer::DeviceOpen::DeviceOpen(std::basic_string<char, std::char_traits, std::allocator >)’

    When I built libcvd, I used the following configuration options

    $ sudo ./configure –without-ffmpeg –without-mmx –without-v4l1buffer

    and I noticed that it was unable to find V4L2 (which I do have installed).

    checking for v4l2… no
    checking for strange v4l2… no

    Note that I used the –without-v4l1buffer because Ubuntu 11.04 no longer supports V4L1, which supposedly worked for the person that wrote this blog: http://blog.icewu.tk/

    I checked the pkg-config for V4L2 on my system which produces the following result

    $ pkg-config –libs /usr/lib/pkgconfig/libv4l2.pc
    -lv4l2

    So after running ./configure I attempted to edit the two LOADLIBES lines in the libcvd Makefile so that they also contain -lv4l2.

    I rebuilt libcvd and attempted to rebuild PTAM, but I’m still getting the same errors as above.

    VideoSource_Linux_V4L.o: In function `VideoSource::VideoSource()’:
    VideoSource_Linux_V4L.cc:(.text+0x2b1b): undefined reference to `CVD::V4L::V4L2Client::V4L2Client(int, unsigned int, CVD::ImageRef, int, bool, int, bool)’

    Any help would be greatly appreciated!

  122. AK says:

    ***Corrected version***

    Hello,

    I’m trying to compile PTAMM on ubuntu 11.04 for a very long time. I also had the problem that “videodev.h” is not available on my system. As suggested by “Jacob Brown”, I also tried to include “videodev2.h” and “libv4l1-videodev.h”. But I still get the following error message:

    user@ubnt11:~/Src/PTAMM$ make
    g++ -o PTAMM main.o GLWindow2.o GLWindowMenu.o VideoSource_Linux_V4L.o System.o ATANCamera.o KeyFrame.o MapPoint.o Map.o SmallBlurryImage.o ShiTomasi.o HomographyInit.o MapMaker.o Bundle.o PatchFinder.o Relocaliser.o MiniPatch.o MapViewer.o ARDriver.o EyeGame.o Tracker.o tinyxml.o tinyxmlerror.o tinyxmlparser.o MapLockManager.o MD5.o MD5Wrapper.o MapSerializer.o Games.o Utils.o ShooterGame.o ShooterGameTarget.o ModelsGame.o ModelBrowser.o ModelControls.o MGButton.o Model3ds.o ModelsGameData.o -L /home/user/local/lib -lGVars3 -lcvd -l3ds
    VideoSource_Linux_V4L.o: In function `PTAMM::VideoSource::VideoSource()’:
    VideoSource_Linux_V4L.cc:(.text+0x2b5d): undefined reference to `CVD::V4L::V4L2Client::V4L2Client(int, unsigned int, CVD::ImageRef, int, bool, int, bool)’
    VideoSource_Linux_V4L.cc:(.text+0x2c6b): undefined reference to `CVD::Exceptions::V4LBuffer::DeviceOpen::DeviceOpen(std::basic_string)’
    VideoSource_Linux_V4L.cc:(.text+0x39d8): undefined reference to `CVD::Exceptions::V4LBuffer::DeviceSetup::DeviceSetup(std::basic_string, std::basic_string)’
    VideoSource_Linux_V4L.o: In function `CVD::V4LBuffer::frame_rate()’:
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE10frame_rateEv[CVD::V4LBuffer::frame_rate()]+0×15): undefined reference to `CVD::V4L::V4L2Client::getRate()’
    VideoSource_Linux_V4L.o: In function `CVD::V4LBuffer::frame_pending()’:
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE13frame_pendingEv[CVD::V4LBuffer::frame_pending()]+0×11): undefined reference to `CVD::V4L::V4L2Client::pendingFrame()’
    VideoSource_Linux_V4L.o: In function `CVD::V4LBuffer::size()’:
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE4sizeEv[CVD::V4LBuffer::size()]+0x1e): undefined reference to `CVD::V4L::V4L2Client::getSize()’
    VideoSource_Linux_V4L.o: In function `CVD::V4LBuffer::put_frame(CVD::VideoFrame*)’:
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE9put_frameEPNS_10VideoFrameIS1_EE[CVD::V4LBuffer::put_frame(CVD::VideoFrame*)]+0×59): undefined reference to `CVD::V4L::V4L2Client::releaseFrame(int)’
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE9put_frameEPNS_10VideoFrameIS1_EE[CVD::V4LBuffer::put_frame(CVD::VideoFrame*)]+0xab): undefined reference to `CVD::Exceptions::V4LBuffer::PutFrame::PutFrame(std::basic_string, std::basic_string)’
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE9put_frameEPNS_10VideoFrameIS1_EE[CVD::V4LBuffer::put_frame(CVD::VideoFrame*)]+0×131): undefined reference to `CVD::Exceptions::V4LBuffer::PutFrame::PutFrame(std::basic_string, std::basic_string)’
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE9put_frameEPNS_10VideoFrameIS1_EE[CVD::V4LBuffer::put_frame(CVD::VideoFrame*)]+0x2bb): undefined reference to `CVD::Exceptions::V4LBuffer::PutFrame::PutFrame(std::basic_string, std::basic_string)’
    VideoSource_Linux_V4L.o: In function `CVD::V4LBuffer::get_frame()’:
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE9get_frameEv[CVD::V4LBuffer::get_frame()]+0x1e): undefined reference to `CVD::V4L::V4L2Client::getFrame()’
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE9get_frameEv[CVD::V4LBuffer::get_frame()]+0×33): undefined reference to `CVD::V4L::V4L2Client::getSize()’
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE9get_frameEv[CVD::V4LBuffer::get_frame()]+0xc2): undefined reference to `CVD::Exceptions::V4LBuffer::GetFrame::GetFrame(std::basic_string, std::basic_string)’
    VideoSource_Linux_V4L.cc:(.text._ZN3CVD9V4LBufferINS_6yuv422EE9get_frameEv[CVD::V4LBuffer::get_frame()]+0x1d8): undefined reference to `CVD::Exceptions::V4LBuffer::GetFrame::GetFrame(std::basic_string, std::basic_string)’
    collect2: ld returned 1 exit status
    make: *** [PTAMM] Error 1

    It seems that “videodev2.h” and “libv4l1-videodev.h” cannot fully compensate the older version “videode.h”. Could anyone please kindly help me in that?

    Thanks,
    A K

    • georgklein says:

      Above just shows that libCVD is not compiling its V4L / V4L2 support. Therefore the PTAMM code which relies on that is failing to link. Ideally, figure out how to get libCVD to work with your distro. Otherwise to remove the link errors, just remove the PTAMM code with relies on libcvd’s V4LBuffer, but then you will need an alternative video input.

      Video input support on linux is tricky because each distro / kernel / camera is different. Find some program which manages to grab video from your camera, look at the source code of that one to see how it does it, and then you can maybe write a video source which works for your machine.

  123. Ita Li says:

    These are notes extending manual instruction for installation on windows.
    – If using VS2008 need to install service pack 1
    – ALL new created/self compiled projects should have the same runtime configuration: /MT for release and /MTd for debug, in project properties > C/C++ > Code generation > Runtime library
    – After executing page 24 of the manual, need to copy also zlib1.dll from c:\program files\GnuWin32\bin
    – No need to perform section 15.1 of the manual
    – In section 15.3 before building libcvd need to update blas and lapack lib names and add “_MT” to match actual files name on disk, in project properties > Linker > Input > Additional Dependencies
    – In section 15.3 before building libcvd, make sure that the Runtime library is correct as explained at the beginning of these notes. Validate Runtime library when executing sections 15.4, 15.5 and 15.6.
    – 1395Camera works with firewire camera input. For using a usb camera see the following section.
    – Create a dll folder to collect all dll files. Copy all files in dll folder to your working directory (Debug / Release)

  124. Matthew says:

    Hi there

    I’ve spent the last couple of days getting PTAM/PTAMM to compile on Windows 7. I now (appear) to have libcvd, gvars3, toon, and PTAM (etc) compiling. But when I run PTAM.exe or CameraCalibrator.exe I just get a blank console/cmd window. No errors. No output from main(), no nothing…

    Only clue I have is that if I run in Debug mode and then hit Pause (no way to use breakpoints, as it does not appear that the exe get’s as far as executing the main()!) I always get sent to:

    if (NULL != tv)
        {
            GetSystemTimeAsFileTime(&ft);
    		printf("here");
            tmpres |= ft.dwHighDateTime;
            tmpres <<= 32;
            tmpres |= ft.dwLowDateTime;
    
            /*converting file time to unix epoch*/
            tmpres /= 10;  /*convert into microseconds*/
            tmpres -= DELTA_EPOCH_IN_MICROSECS; 
            tv->tv_sec = (long)(tmpres / 1000000UL);
            tv->tv_usec = (long)(tmpres % 1000000UL);
        }

    in win32.cpp

    Anyone have any tips?

    M

    • georgklein says:

      That would be the libCVD timer initializing itself before main is called. It’s a global variable instantiated in cvd_timer.cc. I don’t know why that should cause problems, but you can try just disabling it or turning it into some other singleton pattern.

      • Matthew says:

        Thanks for such a prompt reply!

        So I disabled timer.h by doing:

        #ifdef __GNUC__
        #warning This file is deprecated. Use cvd/timer.h
        #else //elif defined(which ever compilers support this)
        #pragma warning "This file is deprecated. Use cvd/timer.h"
        #endif
        
        //#include <cvd/timer.h>

        But no dice: still just hangs on blank console window. When I hit Pause in debug mode I now always get a stackframe from somewhere in blas_win32_MT.dll, such as:

        00F70E86  mov         dword ptr [ebp-10h],eax

        I’m on a Windows 7 64-bit box, but figured I could compile as a Win32 application…perhaps not?

  125. WonJong Kim says:

    Dear, George

    I have completed successfully PTAMM
    But, Model Game runs then console window error occur..
    the error is “Failed to load icon image ARData/Overlays/model_browser.png : Image input : unsupported image type”, cannot run Model Game.

    PTAMM runs then console window error occur “Failed to load searching image ARData/Overlays/searching.png : Image input : unsupported image type”

    I setup the ARData folder “VCProject/PTAMM/ARData”
    other games run available

    Please, solve my problem
    Thank you for your reading

    Best Regards
    WonJong

  126. wajih says:

    Hi George,
    I have installed the PTAM software and make goes fine.
    The image window appears but nothing happens after i press the spacebar.
    Can you kindly guide me on this issue.

    regards

  127. Jonatan says:

    Hi,
    I am using the PTAM library in my Master Thesis, and would first of all like to thank you for making this software available.
    I am using a ptgrey camera with a changeable lens. Comparing a fisheye-lens (~180 degrees) and a regular lens, I find that the calibration fails for the fish-eye lens. That is, I receive a RMS of either (-nan) or, at best, around 8. My impression was that the implementation was made with support for fish-eye lenses, which made me wonder if the lens was perhaps too wide? Is this possible? Are there any parameters I should be looking into for this?

    Best regards,
    Jonatan

  128. Daniel Henell says:

    Hello!
    We are using PTAM to navigate a quadrocopter. Since we need absolute scaling of the world we use fiducial markers to set the scale during stereo initialization. I would like to get rid of these markers. Would it make sense to use a 2nd camera just to get a correct scale of the world? Perhaps there are better algorithms altogether if we have two cameras?

  129. Ben Lapaki says:

    Hi, PTAM looks wonderful.I have been comparing other Augmented reality libraries like ARtoolkit. And observed drastic differences in the values of their pose matrix vs PTAM’s mse3CamFromWorld. It will be greatly helpful if some one can explain what exactly is mse3CamFromWorld and if it could be used like a model view matrix for drawing in OpenGL. If not how could i derive MV matrix from mse3CamFromWorld. Thanks a ton in advance

  130. axelfurlan says:

    Hi All,

    I just went through the installation on Ubuntu 11.10 (kernel 3.0.0) and I had to put together hints from different websites to successfully complete the installation.

    Thus I wrote a simple wiki page to summarize the steps I did:

    http://irawiki.disco.unimib.it/irawiki/index.php/PTAM

    Hope this can be helpful!

    Cheers!

  131. BeLioN says:

    Hi,

    I just compiled as well PTAM in a Ubuntu 12.04 box. I share here my notes, in case they are useful for someone trying to compile:

    http://belion.tumblr.com/post/36151777927/ptam-compilation-notes

    Regards

    • BeLioN says:

      Hi again,

      I uploaded a modified version of the PTAM source code and required libraries to Github. See:

      http://belion.tumblr.com/post/36342654921/modified-ptam-in-github

      If there is any issue with licenceses regarding uploading the code to Github, please let me know and I will inmediately remove it.

      Regards

      • georgklein says:

        There might be some issues.. could you hold off for a couple days so I can check with the uni? Thanks Georg

      • BeLioN says:

        Ok, I just deleted it from Github. I will wait for your confirmation.
        Regards.

      • BeLioN says:

        I just read the license of the original PTAM version:

        <<>>

        So it seems that it is possible to upload the code to Github, as long as I do not obtain money from it (which I do not). Probably, it is enough to replicate the license text.

        But anyway, I will wait for your confirmation.

        Regards

      • georgklein says:

        Ideally, we can do the following:

        1. I or Oxford upload it to github, potentially with changed license 2. You fork that; 3. You apply your patches to that fork; 4. all good.

      • BeLioN says:

        This sounds good to me.
        Anyway, I do no think it is necessary to change the license. This is the relevant text: “Isis’s permission is not required if the said reproduction, modification, transmission or transference is done without financial return, the conditions of this Licence are imposed upon the receiver of the product, and all original and amended source code is included in any transmitted product.”
        Could you please notify me when you upload it to Github?
        Regards

      • Actually, a licence change might be very interesting in many ways! This would for instance simplify integration with Hauke Strasdat’s ScaViSlam (https://github.com/strasdat/ScaViSLAM/issues/6) and contribute immensely to the scientific development. It’s definetly worth considering.

  132. Ram says:

    Hi georgklein,
    I’ve implemented PTAM with edgelets according to your paper. Every thing works fine but I have a problem adjusting Bundle Adjustment to use edgelets. Did you manage somehow to use edgelets the same as points? Or did you use a whole different algorithm from the one implemented?
    Regards

    • georgklein says:

      Edgelets are optimized differently from points: Points have 3DOF, edgelets have 5DOF. For keyframes, each edgelet measurements are upgraded to 2DOF to provide the necessary constraints… this should be detailed in the paper I think.

  133. Hello ..

    I have modified PTAM to work with the SIFT detector. In this case I combined PTAM with OpenCV and used its SIFT implementation. At the moment I was able to triangulate the points by using SIFT features and initialize the map. Using the initial video frame (the frame we get after pressing the space bar second time) as the reference image, I managed to find the pose of the current video frame.

    The important thing was to find a common set of 3D points between the current image & the reference image. I did this by using a hashtable structure to store the 3D points & reference image keypoints, so that I could retrieve a certain 3D point by its relevant 2d keypoint. Then inside the loop, I obtained the best matches for each frame (w.r.t. reference image). At this instance, I could get the 3D points that are visible in the current frame by searching the hashtable with its query keypoint. This way I managed to get my ‘potentially visible set’.

    Once I had the ‘potentially visible set’ the rest was the same like original PTAM. The motion model gave me the predicted measurements, whereas the actual measurements were already obtained by the SIFT feature matching. Finally I updated the initial pose when the re-projection error was minimum.

    However, the marriage with SIFT gave me a very slow frame rate. I tested this on a Core-i7 with 16 GB memory and a 1GB NVIDIA (Cuda enabled) graphics card. But still the FPS was sloppy. I even tested SIFT with a small test application to see its FPS but again… it’s really slow.

    So.. I know PTAM is far greater fast and optimized …but just for my enthusiasm I’m keen to know any suggestion to improve its performance.
    Thank you !.

  134. houssam says:

    hi ptam did’t work on ubuntu10.1
    i got thos errors

    /usr/include/cvd/internal/gl_types.h:110: error: ‘GL_UNSIGNED_SHORT’ was not declared in this scope
    /usr/include/cvd/internal/gl_types.h:115: error: ‘GL_RGB’ was not declared in this scope
    /usr/include/cvd/internal/gl_types.h:116: error: ‘GL_SHORT’ was not declared in this scope
    /usr/include/cvd/internal/gl_types.h:121: error: ‘GL_RGB’ was not declared in this scope
    /usr/include/cvd/internal/gl_types.h:122: error: ‘GL_UNSIGNED_INT’ was not declared in this scope
    /usr/include/cvd/internal/gl_types.h:127: error: ‘GL_RGB’ was not declared in this scope
    help plssss

  135. dinesh says:

    /usr/local/include/TooN/internal/allocator.hh:69:3: error: ‘debug_initialize’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    In file included from /usr/local/include/TooN/TooN.h:88:0,
    from GLWindow2.h:12,
    from System.h:14,
    from main.cc:6:
    /usr/local/include/TooN/internal/debug.hh:94:33: note: ‘template void TooN::Internal::debug_initialize(P*, int)’ declared here, later in the translation unit
    make: *** [main.o] Error 1

    while compiling PTAMM i am getting this perticular error ….. is there any way i can resolve this???

    • piperoman says:

      Did you found the way to solve this problem. I have the same. I have try to add the FLAG -fpermissive but still failing.

    • mistycheney says:

      1. At the beginning of /usr/local/include/TooN/internal/allocator.hh,
      add #include “debug.hh”
      2. In /usr/local/include/TooN/internal/debug.hh,
      at the beginning, add
      #ifndef DEBUG_HH
      #define DEBUG_HH
      at the very end, add
      #endif

    • Yuncong Chen says:

      1. In /usr/local/include/TooN/internal/allocator.hh,
      add at the begining,
      #include “debug.hh”
      2. In /usr/local/include/TooN/internal/debug.hh,
      add at the beginning,
      #ifndef DEBUG_HH
      #define DEBUG_HH
      add at the end,
      #endif

  136. houssam says:

    hi
    in ptam i did run : ./CameraCalibrator got error below

    ./CameraCalibrator: error while loading shared libraries: libGVars3.so: cannot open shared object file: No such file or directory.
    any help pls

  137. tobyhijzen says:

    Hi,
    Im getting errors as discussed in the Q&A namly:
    (some file).cc:(.text+0x65a): undefined reference to `dgesvd_’
    The suggested solution is to make sure that BLAS and LAPACK are installed. They are as can be seen when I run the commands “dpkg -l | grep blas” and “dpkg -l | grep lapack” which show that libblas-dev, libblas3gf, liblapack-dev, liblapack3gf are installed. Yet the compilation still results in the same errors. Any help?

  138. cj says:

    Hi georgklein,
    i have compiled the PTAM in win7. But I could not run it. When it runs, nothing is output in the console(function main not execute). It seems paused in somewhere. But when i run it in other three computer, all win7, only one can run it successfully. Is it need more other support? THANKS.

    • cj says:

      It seems that the libs, blas_win32_MT_release.lib and lapack_win32_MT_release, i used is not right for my PC. I download the MinGW and used libblas.lib, liblapack.lib, liblapacke.lib, which pre-built in MinGW, and finally it work.

  139. Sangjun kim says:

    My steps are these:

    export CVS_RSH=ssh
    cvs -z3 -d:pserver:address@hidden:/sources/toon co TooN
    cvs -z3 -d:pserver:address@hidden:/sources/libcvd co libcvd

    After installing the TooN (./configure, make, make install)

    I proceed to install the Libcvd:

    cd libcvd
    export CXXFLAGS=-D_REENTRANT
    ./configure –without-ffmpeg
    make
    make install

    But the result is:

    g++ -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/diskbuffer2.cc -o cvd_src/diskbuffer2.o
    In file included from ./cvd/videoframe.h:33:0,
    from ./cvd/localvideoframe.h:38,
    from ./cvd/localvideobuffer.h:24,
    from ./cvd/diskbuffer2.h:29,
    from cvd_src/diskbuffer2.cc:23:
    ./cvd/image.h:193:11: error: ‘ptrdiff_t’ no nombra a un tipo
    ./cvd/image.h:568:97: error: ‘ptrdiff_t’ no se declaró en este ámbito

    ./cvd/image.h:568:97: nota: alternativas sugeridas:
    /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h:156:28: nota: ‘std::ptrdiff_t’
    /usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h:156:28: nota: ‘std::ptrdiff_t’

    ./cvd/image.h:568:106: error: el argumento de plantilla 3 es inválido
    ./cvd/internal/scalar_convert.h:112:21: aviso: se define ‘CVD::Pixel::Internal::init_float_for_byte’ pero no se usa [-Wunused-variable]
    ./cvd/internal/scalar_convert.h:113:21: aviso: se define ‘CVD::Pixel::Internal::init_double_for_byte’ pero no se usa [-Wunused-variable]

    make: *** [cvd_src/diskbuffer2.o] Error 1

    This, compiling with the g++ 4.6.3

    And with the g++-4.4 following occurs:

    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/diskbuffer2.cc -o cvd_src/diskbuffer2.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/deinterlacebuffer.cc -o cvd_src/deinterlacebuffer.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/exceptions.cc -o cvd_src/exceptions.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/image_io.cc -o cvd_src/image_io.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/bayer.cxx -o cvd_src/bayer.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/morphology.cc -o cvd_src/morphology.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/colourspace_convert.cxx -o cvd_src/colourspace_convert.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/draw.cc -o cvd_src/draw.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/yuv422.cpp -o cvd_src/yuv422.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/yuv420.cpp -o cvd_src/yuv420.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/pnm_grok.cxx -o pnm_src/pnm_grok.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/bmp.cxx -o pnm_src/bmp.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/bmp_read.cc -o pnm_src/bmp_read.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/bmp_write.cc -o pnm_src/bmp_write.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/cvdimage.cxx -o pnm_src/cvdimage.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/fits.cc -o pnm_src/fits.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/fitswrite.cc -o pnm_src/fitswrite.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/save_postscript.cxx -o pnm_src/save_postscript.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/text_write.cc -o pnm_src/text_write.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/text.cxx -o pnm_src/text.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast_corner.cxx -o cvd_src/fast_corner.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/convolution.cc -o cvd_src/convolution.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/nonmax_suppression.cxx -o cvd_src/nonmax_suppression.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/timeddiskbuffer.cc -o cvd_src/timeddiskbuffer.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/videosource.cpp -o cvd_src/videosource.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/connected_components.cc -o cvd_src/connected_components.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/i686/yuv411_to_stuff_MMX_64.C -o cvd_src/i686/yuv411_to_stuff_MMX_64.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/SSE2/half_sample.cc -o cvd_src/SSE2/half_sample.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/noarch/convert_rgb_to_y.cc -o cvd_src/noarch/convert_rgb_to_y.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/i686/convolve_gaussian.cc -o cvd_src/i686/convolve_gaussian.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/i686/gradient.cc -o cvd_src/i686/gradient.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/noarch/yuv422_wrapper.cc -o cvd_src/noarch/yuv422_wrapper.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/i686/median_3x3.cc -o cvd_src/i686/median_3x3.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/i686/utility_float.cc -o cvd_src/i686/utility_float.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/i686/utility_byte_differences.cc -o cvd_src/i686/utility_byte_differences.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/i686/utility_double_int.cc -o cvd_src/i686/utility_double_int.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/SSE2/two_thirds_sample.cc -o cvd_src/SSE2/two_thirds_sample.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_7_detect.cxx -o cvd_src/fast/fast_7_detect.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_7_score.cxx -o cvd_src/fast/fast_7_score.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/slower_corner_7.cxx -o cvd_src/slower_corner_7.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_8_detect.cxx -o cvd_src/fast/fast_8_detect.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_8_score.cxx -o cvd_src/fast/fast_8_score.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/slower_corner_8.cxx -o cvd_src/slower_corner_8.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_9_detect.cxx -o cvd_src/fast/fast_9_detect.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_9_score.cxx -o cvd_src/fast/fast_9_score.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast_corner_9_nonmax.cxx -o cvd_src/fast_corner_9_nonmax.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_10_detect.cxx -o cvd_src/fast/fast_10_detect.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_10_score.cxx -o cvd_src/fast/fast_10_score.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_11_detect.cxx -o cvd_src/fast/fast_11_detect.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_11_score.cxx -o cvd_src/fast/fast_11_score.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/slower_corner_11.cxx -o cvd_src/slower_corner_11.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_12_detect.cxx -o cvd_src/fast/fast_12_detect.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/fast/fast_12_score.cxx -o cvd_src/fast/fast_12_score.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/faster_corner_9.cxx -o cvd_src/faster_corner_9.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/faster_corner_10.cxx -o cvd_src/faster_corner_10.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/faster_corner_12.cxx -o cvd_src/faster_corner_12.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/Linux/dvbuffer3_dc1394v2.cc -o cvd_src/Linux/dvbuffer3_dc1394v2.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/videosource_dvbuffer.cc -o cvd_src/videosource_dvbuffer.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/Linux/videosource_nov4l1buffer.cc -o cvd_src/Linux/videosource_nov4l1buffer.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/Linux/videosource_nov4lbuffer.cc -o cvd_src/Linux/videosource_nov4lbuffer.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/OSX/videosource_noqtbuffer.cc -o cvd_src/OSX/videosource_noqtbuffer.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/posix/timer.cc -o cvd_src/posix/timer.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/synchronized.cpp -o cvd_src/synchronized.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/eventobject.cpp -o cvd_src/eventobject.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/thread.cpp -o cvd_src/thread.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/posix/sched_yield.cc -o cvd_src/posix/sched_yield.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/thread/runnable_batch.cc -o cvd_src/thread/runnable_batch.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/noarch/posix_memalign.cpp -o cvd_src/noarch/posix_memalign.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/videodisplay.cc -o cvd_src/videodisplay.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/glwindow.cc -o cvd_src/glwindow.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/gltext.cpp -o cvd_src/gltext.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/jpeg.cxx -o pnm_src/jpeg.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/tiff.cxx -o pnm_src/tiff.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/tiffwrite.cc -o pnm_src/tiffwrite.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c pnm_src/png.cc -o pnm_src/png.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/videosource_novideofilebuffer.cc -o cvd_src/videosource_novideofilebuffer.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/globlist.cxx -o cvd_src/globlist.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/tensor_voting.cc -o cvd_src/tensor_voting.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/brezenham.cc -o cvd_src/brezenham.o
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c cvd_src/draw_toon.cc -o cvd_src/draw_toon.o
    ar crvs libcvd.a cvd_src/diskbuffer2.o cvd_src/deinterlacebuffer.o cvd_src/exceptions.o cvd_src/image_io.o cvd_src/bayer.o cvd_src/morphology.o cvd_src/colourspace_convert.o cvd_src/draw.o cvd_src/yuv422.o cvd_src/yuv420.o pnm_src/pnm_grok.o pnm_src/bmp.o pnm_src/bmp_read.o pnm_src/bmp_write.o pnm_src/cvdimage.o pnm_src/fits.o pnm_src/fitswrite.o pnm_src/save_postscript.o pnm_src/text_write.o pnm_src/text.o cvd_src/fast_corner.o cvd_src/convolution.o cvd_src/nonmax_suppression.o cvd_src/timeddiskbuffer.o cvd_src/videosource.o cvd_src/connected_components.o cvd_src/i686/yuv411_to_stuff_MMX_64.o cvd_src/SSE2/half_sample.o cvd_src/noarch/convert_rgb_to_y.o cvd_src/i686/convolve_gaussian.o cvd_src/i686/gradient.o cvd_src/noarch/yuv422_wrapper.o cvd_src/i686/median_3x3.o cvd_src/i686/utility_float.o cvd_src/i686/utility_byte_differences.o cvd_src/i686/utility_double_int.o cvd_src/SSE2/two_thirds_sample.o cvd_src/fast/fast_7_detect.o cvd_src/fast/fast_7_score.o cvd_src/slower_corner_7.o cvd_src/fast/fast_8_detect.o cvd_src/fast/fast_8_score.o cvd_src/slower_corner_8.o cvd_src/fast/fast_9_detect.o cvd_src/fast/fast_9_score.o cvd_src/fast_corner_9_nonmax.o cvd_src/fast/fast_10_detect.o cvd_src/fast/fast_10_score.o cvd_src/fast/fast_11_detect.o cvd_src/fast/fast_11_score.o cvd_src/slower_corner_11.o cvd_src/fast/fast_12_detect.o cvd_src/fast/fast_12_score.o cvd_src/faster_corner_9.o cvd_src/faster_corner_10.o cvd_src/faster_corner_12.o cvd_src/Linux/dvbuffer3_dc1394v2.o cvd_src/videosource_dvbuffer.o cvd_src/Linux/videosource_nov4l1buffer.o cvd_src/Linux/videosource_nov4lbuffer.o cvd_src/OSX/videosource_noqtbuffer.o cvd_src/posix/timer.o cvd_src/synchronized.o cvd_src/eventobject.o cvd_src/thread.o cvd_src/posix/sched_yield.o cvd_src/thread/runnable_batch.o cvd_src/noarch/posix_memalign.o cvd_src/videodisplay.o cvd_src/glwindow.o cvd_src/gltext.o pnm_src/jpeg.o pnm_src/tiff.o pnm_src/tiffwrite.o pnm_src/png.o cvd_src/videosource_novideofilebuffer.o cvd_src/globlist.o cvd_src/tensor_voting.o cvd_src/brezenham.o cvd_src/draw_toon.o
    a – cvd_src/diskbuffer2.o
    a – cvd_src/deinterlacebuffer.o
    a – cvd_src/exceptions.o
    a – cvd_src/image_io.o
    a – cvd_src/bayer.o
    a – cvd_src/morphology.o
    a – cvd_src/colourspace_convert.o
    a – cvd_src/draw.o
    a – cvd_src/yuv422.o
    a – cvd_src/yuv420.o
    a – pnm_src/pnm_grok.o
    a – pnm_src/bmp.o
    a – pnm_src/bmp_read.o
    a – pnm_src/bmp_write.o
    a – pnm_src/cvdimage.o
    a – pnm_src/fits.o
    a – pnm_src/fitswrite.o
    a – pnm_src/save_postscript.o
    a – pnm_src/text_write.o
    a – pnm_src/text.o
    a – cvd_src/fast_corner.o
    a – cvd_src/convolution.o
    a – cvd_src/nonmax_suppression.o
    a – cvd_src/timeddiskbuffer.o
    a – cvd_src/videosource.o
    a – cvd_src/connected_components.o
    a – cvd_src/i686/yuv411_to_stuff_MMX_64.o
    a – cvd_src/SSE2/half_sample.o
    a – cvd_src/noarch/convert_rgb_to_y.o
    a – cvd_src/i686/convolve_gaussian.o
    a – cvd_src/i686/gradient.o
    a – cvd_src/noarch/yuv422_wrapper.o
    a – cvd_src/i686/median_3x3.o
    a – cvd_src/i686/utility_float.o
    a – cvd_src/i686/utility_byte_differences.o
    a – cvd_src/i686/utility_double_int.o
    a – cvd_src/SSE2/two_thirds_sample.o
    a – cvd_src/fast/fast_7_detect.o
    a – cvd_src/fast/fast_7_score.o
    a – cvd_src/slower_corner_7.o
    a – cvd_src/fast/fast_8_detect.o
    a – cvd_src/fast/fast_8_score.o
    a – cvd_src/slower_corner_8.o
    a – cvd_src/fast/fast_9_detect.o
    a – cvd_src/fast/fast_9_score.o
    a – cvd_src/fast_corner_9_nonmax.o
    a – cvd_src/fast/fast_10_detect.o
    a – cvd_src/fast/fast_10_score.o
    a – cvd_src/fast/fast_11_detect.o
    a – cvd_src/fast/fast_11_score.o
    a – cvd_src/slower_corner_11.o
    a – cvd_src/fast/fast_12_detect.o
    a – cvd_src/fast/fast_12_score.o
    a – cvd_src/faster_corner_9.o
    a – cvd_src/faster_corner_10.o
    a – cvd_src/faster_corner_12.o
    a – cvd_src/Linux/dvbuffer3_dc1394v2.o
    a – cvd_src/videosource_dvbuffer.o
    a – cvd_src/Linux/videosource_nov4l1buffer.o
    a – cvd_src/Linux/videosource_nov4lbuffer.o
    a – cvd_src/OSX/videosource_noqtbuffer.o
    a – cvd_src/posix/timer.o
    a – cvd_src/synchronized.o
    a – cvd_src/eventobject.o
    a – cvd_src/thread.o
    a – cvd_src/posix/sched_yield.o
    a – cvd_src/thread/runnable_batch.o
    a – cvd_src/noarch/posix_memalign.o
    a – cvd_src/videodisplay.o
    a – cvd_src/glwindow.o
    a – cvd_src/gltext.o
    a – pnm_src/jpeg.o
    a – pnm_src/tiff.o
    a – pnm_src/tiffwrite.o
    a – pnm_src/png.o
    a – cvd_src/videosource_novideofilebuffer.o
    a – cvd_src/globlist.o
    a – cvd_src/tensor_voting.o
    a – cvd_src/brezenham.o
    a – cvd_src/draw_toon.o
    ranlib libcvd.a
    rm -f libcvd.so libcvd.so.0 libcvd.so.0.8
    g++-4.4 -shared -o libcvd.so.0.8 cvd_src/diskbuffer2.o cvd_src/deinterlacebuffer.o cvd_src/exceptions.o cvd_src/image_io.o cvd_src/bayer.o cvd_src/morphology.o cvd_src/colourspace_convert.o cvd_src/draw.o cvd_src/yuv422.o cvd_src/yuv420.o pnm_src/pnm_grok.o pnm_src/bmp.o pnm_src/bmp_read.o pnm_src/bmp_write.o pnm_src/cvdimage.o pnm_src/fits.o pnm_src/fitswrite.o pnm_src/save_postscript.o pnm_src/text_write.o pnm_src/text.o cvd_src/fast_corner.o cvd_src/convolution.o cvd_src/nonmax_suppression.o cvd_src/timeddiskbuffer.o cvd_src/videosource.o cvd_src/connected_components.o cvd_src/i686/yuv411_to_stuff_MMX_64.o cvd_src/SSE2/half_sample.o cvd_src/noarch/convert_rgb_to_y.o cvd_src/i686/convolve_gaussian.o cvd_src/i686/gradient.o cvd_src/noarch/yuv422_wrapper.o cvd_src/i686/median_3x3.o cvd_src/i686/utility_float.o cvd_src/i686/utility_byte_differences.o cvd_src/i686/utility_double_int.o cvd_src/SSE2/two_thirds_sample.o cvd_src/fast/fast_7_detect.o cvd_src/fast/fast_7_score.o cvd_src/slower_corner_7.o cvd_src/fast/fast_8_detect.o cvd_src/fast/fast_8_score.o cvd_src/slower_corner_8.o cvd_src/fast/fast_9_detect.o cvd_src/fast/fast_9_score.o cvd_src/fast_corner_9_nonmax.o cvd_src/fast/fast_10_detect.o cvd_src/fast/fast_10_score.o cvd_src/fast/fast_11_detect.o cvd_src/fast/fast_11_score.o cvd_src/slower_corner_11.o cvd_src/fast/fast_12_detect.o cvd_src/fast/fast_12_score.o cvd_src/faster_corner_9.o cvd_src/faster_corner_10.o cvd_src/faster_corner_12.o cvd_src/Linux/dvbuffer3_dc1394v2.o cvd_src/videosource_dvbuffer.o cvd_src/Linux/videosource_nov4l1buffer.o cvd_src/Linux/videosource_nov4lbuffer.o cvd_src/OSX/videosource_noqtbuffer.o cvd_src/posix/timer.o cvd_src/synchronized.o cvd_src/eventobject.o cvd_src/thread.o cvd_src/posix/sched_yield.o cvd_src/thread/runnable_batch.o cvd_src/noarch/posix_memalign.o cvd_src/videodisplay.o cvd_src/glwindow.o cvd_src/gltext.o pnm_src/jpeg.o pnm_src/tiff.o pnm_src/tiffwrite.o pnm_src/png.o cvd_src/videosource_novideofilebuffer.o cvd_src/globlist.o cvd_src/tensor_voting.o cvd_src/brezenham.o cvd_src/draw_toon.o -L. -ltiff -ljpeg -lpng -lpng -llapack -lGLU -lGL -lrt -ldc1394 -L -lX11 -lXext -pthread
    ln -s libcvd.so.0.8 libcvd.so.0
    ln -s libcvd.so.0 libcvd.so
    g++-4.4 -O3 -I. -I. -INONE/include -D_REENTRANT -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c progs/se3_exp.cxx -o progs/se3_exp.o
    g++-4.4 -o progs/se3_exp progs/se3_exp.o -L. -lcvd -ltiff -ljpeg -lpng -lpng -llapack -lGLU -lGL -lrt -ldc1394 -L -lX11 -lXext -pthread
    ./libcvd.so: error: undefined reference to ‘raw1394_new_handle’
    ./libcvd.so: error: undefined reference to ‘raw1394_get_port_info’
    ./libcvd.so: error: undefined reference to ‘raw1394_new_handle_on_port’
    ./libcvd.so: error: undefined reference to ‘raw1394_iso_stop’
    ./libcvd.so: error: undefined reference to ‘raw1394_iso_shutdown’
    ./libcvd.so: error: undefined reference to ‘raw1394_reset_bus’
    ./libcvd.so: error: undefined reference to ‘raw1394_destroy_handle’
    ./libcvd.so: error: undefined reference to ‘XQueryPointer’
    ./libcvd.so: error: undefined reference to ‘XPending’
    ./libcvd.so: error: undefined reference to ‘XNextEvent’
    ./libcvd.so: error: undefined reference to ‘XFlush’
    ./libcvd.so: error: undefined reference to ‘XSelectInput’
    ./libcvd.so: error: undefined reference to ‘XStoreName’
    ./libcvd.so: error: undefined reference to ‘XUnmapWindow’
    ./libcvd.so: error: undefined reference to ‘XDestroyWindow’
    ./libcvd.so: error: undefined reference to ‘XCloseDisplay’
    ./libcvd.so: error: undefined reference to ‘XOpenDisplay’
    ./libcvd.so: error: undefined reference to ‘XCreateColormap’
    ./libcvd.so: error: undefined reference to ‘XCreateWindow’
    ./libcvd.so: error: undefined reference to ‘XMapWindow’
    ./libcvd.so: error: undefined reference to ‘XDefineCursor’
    ./libcvd.so: error: undefined reference to ‘XUndefineCursor’
    ./libcvd.so: error: undefined reference to ‘XWarpPointer’
    ./libcvd.so: error: undefined reference to ‘XMoveWindow’
    ./libcvd.so: error: undefined reference to ‘XResizeWindow’
    ./libcvd.so: error: undefined reference to ‘XGetWindowAttributes’
    ./libcvd.so: error: undefined reference to ‘XSetClassHint’
    ./libcvd.so: error: undefined reference to ‘XInternAtom’
    ./libcvd.so: error: undefined reference to ‘XSetWMProtocols’
    ./libcvd.so: error: undefined reference to ‘XLoadQueryFont’
    ./libcvd.so: error: undefined reference to ‘XCreateGlyphCursor’
    ./libcvd.so: error: undefined reference to ‘XFreeFont’
    ./libcvd.so: error: undefined reference to ‘XLookupString’
    collect2: ld returned 1 exit status
    make: *** [progs/se3_exp] Error 1

    I can do?, As I can compile the library?.

    Any help is appreciated!.

    • Tom says:

      Hi,

      Did you figure out the reason for the above problem. Please let me know if you did, as I am also getting similar error while compiling libcvd.
      ./cvd/image.h:174:11: error: ‘ptrdiff_t’ does not name a type
      /cvd/image.h:583:97: error: ‘ptrdiff_t’ was not declared in this scope
      /cvd/image.h:583:106: error: template argument 3 is invalid

      Thanks

  140. zf says:

    Is it possible to create a second GL window within the PTAM framework? I would like to render some additional info to the second window.

    Thank you!

  141. haya says:

    I would like to run the PTAMM, but it does not work.
    I run in visual studio 2010.
    Error out like this.
    —————
    LINK: LNK4075 warning: / INCREMENTAL is ignored by /OPT:ICF designation.
    LINK : fatal error LNK1181: Can not open input file ‘LTCG.obj’.
    —————

    I am hoping to be able to tell the solution of this.

  142. Tom says:

    Hi,

    I am having a lot of issues in building the libcvd library in ubuntu.

    I used the below libcvd version.
    cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/libcvd co -D “Mon May
    11 16:29:26 BST 2009” libcvd

    But when I run the make command, I get strange errors like
    ./cvd/image.h:583:106: error: template argument 3 is invalid
    ./cvd/utility.h:219:26: error: ‘int32_t’ does not name a type
    cvd_src/convolution.cc:15:59: error: ‘printf’ was not declared in this scope

    I am sure I am not supposed to edit the files and include the missing libraries. I a following the steps given in “An Example Linux Install Process” and cannot proceed beyond compiling the libcvd step.

    Please suggest.

    Thanks
    Tom

  143. Niraj Shakya says:

    Dear All,
    Transform [sender=/ptam_visualizer]
    For frame [/world]: Fixed Frame [map] does not exist…. i dont know why the ptam_visualizer is not sending . Any suggestion ?

  144. Anurag Sai says:

    Hi,
    I have been using PTAMM for several months now. Everything was great until I made few changes to System.cc and all of a sudden I keep getting the following error during the compilation:

    In file included from System.cc:11:0:
    MapSerializer.h:39:30: error: expected identifier before ‘(’ token
    MapSerializer.h:39:30: error: expected ‘}’ before ‘(’ token
    MapSerializer.h:39:30: error: expected unqualified-id before ‘void’
    MapSerializer.h:39:30: error: expected ‘)’ before ‘void’
    MapSerializer.h:39:30: error: expected ‘)’ before ‘void’
    MapSerializer.h:41:38: error: invalid declarator before ‘&’ token
    MapSerializer.h:41:38: error: expected ‘)’ before ‘&’ token
    MapSerializer.h:42:21: error: expected constructor, destructor, or type conversion before ‘;’ token
    MapSerializer.h:47:22: error: ‘virtual’ outside class declaration
    MapSerializer.h:49:3: error: expected unqualified-id before ‘private’
    MapSerializer.h:53:5: error: ‘MapStatus’ does not name a type
    MapSerializer.h:54:5: error: ‘MapStatus’ does not name a type
    MapSerializer.h:58:5: error: ‘MapStatus’ does not name a type
    MapSerializer.h:71:5: error: ‘MapStatus’ does not name a type
    MapSerializer.h:91:3: error: expected unqualified-id before ‘private’
    MapSerializer.h:94:25: error: ‘PTAMM::mvpMaps’ declared as reference but not initialized
    In file included from System.cc:11:0:
    MapSerializer.h:110:1: error: expected declaration before ‘}’ token

    I even undid all the changes and compiled PTAMM again but still the error persists. I remember downgrading the gcc version sometime ago. Is that the reason for this error? Please help me!

    Thanks,

  145. Reena says:

    Hi does PTAMM only work for OpenCV 2.1.0 version does it work for 2.4.4 version

  146. Reena says:

    I have been stuck with it for some time now so please help me solve these errors

  147. Reena says:

    Hello Sir
    I am working with PTAMM for windows for first time. I added all the necessary files and libraries but i still get errors like
    VideoSource_Win32_CMU1394.cc
    2>ClCompile:
    2> main.cc
    2>e:\ptamm\3rd party\toon\internal\operators.hh(60): error C2059: syntax error : ‘(‘
    2> e:\ptamm\3rd party\toon\internal\operators.hh(60) : see reference to class template instantiation ‘TooN::Internal::AddType’ being compiled
    2>e:\ptamm\3rd party\toon\internal\operators.hh(60): error C2059: syntax error : ‘)’
    2>e:\ptamm\3rd party\toon\internal\operators.hh(60): error C2059: syntax error : ‘)’
    2>e:\ptamm\3rd party\toon\internal\operators.hh(60): error C2146: syntax error : missing ‘)’ before identifier ‘type’
    2>e:\ptamm\3rd party\toon\internal\operators.hh(60): error C3646: ‘type’ : unknown override specifier
    2>e:\ptamm\3rd party\toon\internal\operators.hh(60): error C4430: missing type specifier – int assumed. Note: C++ does not support default-int
    2>e:\ptamm\3rd party\toon\internal\operators.hh(61): error C2059: syntax error : ‘(‘
    2> e:\ptamm\3rd party\toon\internal\operators.hh(61) : see reference to class template instantiation ‘TooN::Internal::SubtractType’ being compiled
    2>e:\ptamm\3rd party\toon\internal\operators.hh(61): error C2059: syntax error : ‘)’
    2>e:\ptamm\3rd party\toon\internal\operators.hh(61): error C2059: syntax error : ‘)’

    in widows. Though i added the necessary files and libraries I get these error. I think that some header file is to be included but I dont know which one. Would you please help me solve this problem cause I have been stuck with this for one week now. I have a deadline by tomorrow for my project. Before which I have to execute this code and show. Please help me solve this error because there are many related errors in other .cc file

  148. Reena says:

    I have another doubt I am using VS2010 for Windows 7 and is any opencv version fine will I have to get
    • TooN-2.0.beta7.zip
    • libcvd-20100511.zip
    • gvars3-20090421.tar.gz
    • pthreads-w32-2-8-0-release.exe
    • lib3ds-20080909.zip
    • lapack-MT-release.zip
    • glew-1.5.5-win32.zip
    • 1394camera645.exe
    • jpeg-6b-4.exe
    • libpng-1.2.37-setup.exe
    • zlib125.zip
    • PTAM.zip
    • ptamm.zip

    Please someone give me some reply coz I am running out of time

  149. Reena says:

    Can someone tell me which version of Toon, libCVD and Gvars3 I need for Visual Studio 2010 in WIndows 7

  150. Reena says:

    Hello Sir
    I am trying to read from another USB camera to read the video data. I did not change VideoSource.h but made it in .cpp

    VideoSource.h

    struct VideoSourceData;
    class VideoSource
    {
    public:
    VideoSource();
    void GetAndFillFrameBWandRGB(CVD::Image &imBW, CVD::Image<CVD::Rgb > &imRGB);
    CVD::ImageRef Size();

    private:
    void *mptr;
    CVD::ImageRef mirSize;
    };

    Video.cpp

    VideoSource::VideoSource()
    {
    VideoCapture* cap = new::VideoCapture;//(VideoCapture*)mptr;
    mptr = cap;
    cout << " VideoSource_Windows: Opening video source…" <isOpened();
    if(!cap->isOpened())
    {
    std::cerr<<"Could Not Find the Camera or Video "<<std::endl;
    exit(1);
    }
    else
    {
    cout << " … got video source." << endl;
    }
    mirSize = ImageRef(640,480);

    };

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

    void conversionNB(Mat &frame, Image &imBW)
    {

    Mat clone = frame.clone();
    Mat& frame_p = Mat(frame.rows,frame.cols, CV_32FC1); //(Mat&)clone;
    frame_p = (Mat&)clone;
    for (int i = 0; i < 480; i++)
    {
    for (int j = 0; j < 640; j++)
    {
    imBW[i][j] = ((frame_p(i,j))[0] + frame_p(i,j)[1] + frame_p(i,j)[2]) / 3;
    }
    }

    }

    void conversionRGB(Mat &frame, Image<CVD::Rgb > &imRGB)
    {

    Mat clone = frame.clone();
    Mat_& frame_p = (Mat_&)clone;
    for (int i = 0; i < 480; i++)
    {
    for (int j = 0; j < 640; j++)
    {
    imRGB[i][j].red = frame_p(i,j)[0];
    imRGB[i][j].green = frame_p(i,j)[1];
    imRGB[i][j].blue = frame_p(i,j)[2];
    }
    }
    }

    void VideoSource::GetAndFillFrameBWandRGB(Image &imBW, Image<CVD::Rgb > &imRGB)
    {
    Mat frame;
    VideoCapture* cap = (VideoCapture*)mptr;
    cap->set(CV_CAP_PROP_FRAME_WIDTH,640);
    cap->set(CV_CAP_PROP_FRAME_HEIGHT,480);
    cap->set(CV_CAP_PROP_FPS,30);
    double fps = cap->get(CV_CAP_PROP_FPS); //get the frames per seconds of the video

    cout << "Frame per seconds : " << fps <open(1);
    *cap >> frame;
    //cvCvtColor (&frame,&frame,CV_GRAY2BGR);//(tmpImg, imagenColor, CV_GRAY2BGR);
    conversionNB(frame, imBW);
    conversionRGB(frame, imRGB);
    frame.release();
    }

    error
    1>VideoSource_Win32_CMU1394.cpp(56): error C2664: ‘cv::Mat cv::Mat::operator ()(cv::Range,cv::Range) const’ : cannot convert parameter 1 from ‘int’ to ‘cv::Range’
    1> No constructor could take the source type, or constructor overload resolution was ambiguous
    1>VideoSource_Win32_CMU1394.cpp(56): error C2664: ‘cv::Mat cv::Mat::operator ()(cv::Range,cv::Range) const’ : cannot convert parameter 1 from ‘int’ to ‘cv::Range’
    1> No constructor could take the source type, or constructor overload resolution was ambiguous
    1>VideoSource_Win32_CMU1394.cpp(56): error C2664: ‘cv::Mat cv::Mat::operator ()(cv::Range,cv::Range) const’ : cannot convert parameter 1 from ‘int’ to ‘cv::Range’
    1> No constructor could take the source type, or constructor overload resolution was ambiguous
    1>VideoSource_Win32_CMU1394.cpp(71): error C3849: function-style call on an expression of type ‘cv::Mat_’ would lose const and/or volatile qualifiers for all 13 available operator overloads
    1>VideoSource_Win32_CMU1394.cpp(72): error C3849: function-style call on an expression of type ‘cv::Mat_’ would lose const and/or volatile qualifiers for all 13 available operator overloads
    1>VideoSource_Win32_CMU1394.cpp(73): error C3849: function-style call on an expression of type ‘cv::Mat_’ would lose const and/or volatile qualifiers for all 13 available operator overloads
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:02.59
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    I am using OpenCV 2.4.4 in VS2010 in Windows so am not sure if the error is because some header file is missing or the syntax is wrong or how to modify the code.. I was wondering if you could help me resolve this error please.
    Some advice on hoe to go about it would be fine

    • Niraj Shakya says:

      Hi, I am not sure about the above error, the ROS version of PTAM is more flexible, I had this problem but when I changed to ROS i was able to use different usb camera and it was more flexible.

  151. Reena says:

    Hi the PTAMM code started ti work finally in Windows and I was finally able to get the video source from usb web cam using the code
    /*
    * Autor : Arnaud GROSJEAN (VIDE SARL)
    * 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
    *
    * INSTALLATION :
    * – Copy the VideoSource_Linux_OpenCV.cc file in your PTAM directory
    * – In the Makefile:
    * – set the linkflags to
    LINKFLAGS = -L MY_CUSTOM_LINK_PATH -lblas -llapack -lGVars3 -lcvd -lcv -lcxcore -lhighgui
    * – set the videosource to
    VIDEOSOURCE = VideoSource_Linux_OpenCV.o
    * – Compile the project
    * – Enjoy !
    *
    * Notice this code define two constants for the image width and height (OPENCV_VIDEO_W and OPENCV_VIDEO_H)
    */

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

    using namespace CVD;
    using namespace std;
    using namespace GVars3;
    using namespace cv;

    #define OPENCV_VIDEO_W 640
    #define OPENCV_VIDEO_H 480

    namespace PTAMM
    {
    VideoSource::VideoSource()
    {
    cout << " VideoSource_Linux: Opening video source…" <isOpened()){
    cerr << "Unable to get the camera" << endl;
    exit(-1);
    }
    cout << " … got video source." << endl;
    mirSize = ImageRef(OPENCV_VIDEO_W, OPENCV_VIDEO_H);
    };

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

    void conversionNB(Mat frame, Image &imBW){
    Mat clone = frame.clone();
    Mat_& frame_p = (Mat_&)clone;
    for (int i = 0; i < OPENCV_VIDEO_H; i++){
    for (int j = 0; j < OPENCV_VIDEO_W; j++){
    imBW[i][j] = (frame_p(i,j)[0] + frame_p(i,j)[1] + frame_p(i,j)[2]) / 3;
    }
    }

    }

    void conversionRGB(Mat frame, Image<Rgb > &imRGB){
    Mat clone = frame.clone();
    Mat_& frame_p = (Mat_&)clone;
    for (int i = 0; i < OPENCV_VIDEO_H; i++){
    for (int j = 0; j < OPENCV_VIDEO_W; j++){
    imRGB[i][j].red = frame_p(i,j)[2];
    imRGB[i][j].green = frame_p(i,j)[1];
    imRGB[i][j].blue = frame_p(i,j)[0];
    }
    }
    }

    void VideoSource::GetAndFillFrameBWandRGB(Image &imBW, Image<Rgb > &imRGB)
    {
    Mat frame;
    VideoCapture* cap = (VideoCapture*)mptr;
    *cap >> frame;
    conversionNB(frame, imBW);
    conversionRGB(frame, imRGB);
    }
    }

    But the video source for PTAMM is black and white how do I get the an RGB video source instead of a gray image as video source. I think I need to add the line cvCvtColor(&frame,&frame,CV_GRAY2BGR);

    but it dosnt work cause I get OpenCV assertion error. Could someone tell me how to get RGB type video Input Source

  152. Reena says:

    Hi
    I am executing the code for PTAM in Windows 7 and OpenCV 2.4 in VS2010 for getting the Video Source. I was wondering if you could tell me where in the code would I have to change to create and save RGB or Colored keyframes and also if I wanted to add more keyframes just in which .cxx files would I have to make the changes and how I should do it . I know it works in PTAMM but I wanted to do the same in PTAM and also add more keyframes. The maximum keyframes I can generate is two per map and is gray image I want the ketframes as colored

  153. eranda says:

    Hi All,

    I used PTAMM as the foundation for building a new human-robot interaction framework where we could control robots through Augmented Reality (AR) objects. PTAMM was ideal for my work since it does not require the environment to be instrumented with special markers. That helped me to control robots in any environment using AR objects (marker-less) with a standard web-cam.

    In doing so we must ensure that PTAMM can track an AR object under changing perspectives of the camera angle (i.e. imagine you turn the camera in a 180 angle and still want the AR object to remain persistent at its original location without any jitter.) So I extended PTAMM with a linear transformation algorithm which allows us to combine multiple local maps into a single global map, and maintain the camera pose with regard to this global map. The linear transformation algorithm works at frame rate as the camera enters unexplored regions in the environment and creates new local maps. The extended version of PTAMM is demonstrated in the following url.

    http://www.youtube.com/watch?v=cu7BIbyKMNc&hd=1

    Having extended PTAMM in this way, we can express user intentions in the form of AR diagrams and embed those diagrams inside the robot’s environment. These AR diagrams (or objects) could communicate in both ways, from a human to a robot or from a robot to a human, while facilitating an intuitive form of human-robot interaction. Provided below are some of the demonstrations I made using two different robot platforms, Parallax and LEGO Mindstorm NXT.

    http://www.youtube.com/watch?v=N0uQpxihSUo&hd=1
    http://www.youtube.com/watch?v=lIlpv3QPH5g&hd=1

    Your comments and ideas are much appreciated for the further development of my research. I’d like to look at your feedback in general, and see whether this framework could really improve the user-experience for less-experienced robot users.

    Thank you!

  154. General says:

    Hi, When I try to make PTAM, it appers the following error, how could I solve this ? All the previous steps are done before this make.
    Thanks.

    g++ -o PTAM main.o GLWindow2.o GLWindowMenu.o VideoSource_Linux_DV.o System.o ATANCamera.o KeyFrame.o MapPoint.o Map.o SmallBlurryImage.o ShiTomasi.o HomographyInit.o MapMaker.o Bundle.o PatchFinder.o Relocaliser.o MiniPatch.o MapViewer.o ARDriver.o EyeGame.o Tracker.o -L /usr/local/lib -lGVars3 -lcvd -lGLU -lGL -llapack
    VideoSource_Linux_DV.o: In function `VideoSource::VideoSource()’:
    VideoSource_Linux_DV.cc:(.text+0xaa): undefined reference to `CVD::DV3::RawDVBuffer3::RawDVBuffer3(CVD::DV3::DV3ColourSpace, unsigned int, CVD::ImageRef, float, CVD::ImageRef)’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::frame_pending()’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EE13frame_pendingEv[CVD::DVBuffer3::frame_pending()]+0x5): undefined reference to `CVD::DV3::RawDVBuffer3::frame_pending()’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::~DVBuffer3()’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EED2Ev[_ZN3CVD9DVBuffer3INS_6yuv411EED5Ev]+0x14): undefined reference to `CVD::DV3::RawDVBuffer3::~RawDVBuffer3()’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::put_frame(CVD::VideoFrame*)’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EE9put_frameEPNS_10VideoFrameIS1_EE[CVD::DVBuffer3::put_frame(CVD::VideoFrame*)]+0x5): undefined reference to `CVD::DV3::RawDVBuffer3::put_frame(CVD::VideoFrame*)’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::get_frame()’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EE9get_frameEv[CVD::DVBuffer3::get_frame()]+0x5): undefined reference to `CVD::DV3::RawDVBuffer3::get_frame()’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::~DVBuffer3()’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EED0Ev[_ZN3CVD9DVBuffer3INS_6yuv411EED5Ev]+0x14): undefined reference to `CVD::DV3::RawDVBuffer3::~RawDVBuffer3()’
    collect2: ld returned 1 exit status
    make: *** [PTAM] Error 1
    jgui@JJG:~/eclipse_ws/PTAM-master$ sudo make install
    [sudo] password for jgui:
    make: *** No rule to make target `install’. Stop.
    jgui@JJG:~/eclipse_ws/PTAM-master$ sudo make
    g++ -o PTAM main.o GLWindow2.o GLWindowMenu.o VideoSource_Linux_DV.o System.o ATANCamera.o KeyFrame.o MapPoint.o Map.o SmallBlurryImage.o ShiTomasi.o HomographyInit.o MapMaker.o Bundle.o PatchFinder.o Relocaliser.o MiniPatch.o MapViewer.o ARDriver.o EyeGame.o Tracker.o -L /usr/local/lib -lGVars3 -lcvd -lGLU -lGL -llapack
    VideoSource_Linux_DV.o: In function `VideoSource::VideoSource()’:
    VideoSource_Linux_DV.cc:(.text+0xaa): undefined reference to `CVD::DV3::RawDVBuffer3::RawDVBuffer3(CVD::DV3::DV3ColourSpace, unsigned int, CVD::ImageRef, float, CVD::ImageRef)’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::frame_pending()’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EE13frame_pendingEv[CVD::DVBuffer3::frame_pending()]+0x5): undefined reference to `CVD::DV3::RawDVBuffer3::frame_pending()’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::~DVBuffer3()’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EED2Ev[_ZN3CVD9DVBuffer3INS_6yuv411EED5Ev]+0x14): undefined reference to `CVD::DV3::RawDVBuffer3::~RawDVBuffer3()’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::put_frame(CVD::VideoFrame*)’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EE9put_frameEPNS_10VideoFrameIS1_EE[CVD::DVBuffer3::put_frame(CVD::VideoFrame*)]+0x5): undefined reference to `CVD::DV3::RawDVBuffer3::put_frame(CVD::VideoFrame*)’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::get_frame()’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EE9get_frameEv[CVD::DVBuffer3::get_frame()]+0x5): undefined reference to `CVD::DV3::RawDVBuffer3::get_frame()’
    VideoSource_Linux_DV.o: In function `CVD::DVBuffer3::~DVBuffer3()’:
    VideoSource_Linux_DV.cc:(.text._ZN3CVD9DVBuffer3INS_6yuv411EED0Ev[_ZN3CVD9DVBuffer3INS_6yuv411EED5Ev]+0x14): undefined reference to `CVD::DV3::RawDVBuffer3::~RawDVBuffer3()’
    collect2: ld returned 1 exit status
    make: *** [PTAM] Error 1

  155. Nader Mahmoud says:

    Hi all,

    i have problem building PTAM,
    here are error messages displayed when i trying to Build PTAM

    Linking…
    1>LINK : warning LNK4075: ignoring ‘/INCREMENTAL’ due to ‘/OPT:ICF’ specification
    1>gvars3.lib(gvars3.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
    1>LINK : warning LNK4075: ignoring ‘/INCREMENTAL’ due to ‘/LTCG’ specification
    1>libcvd.lib(win32.obj) : error LNK2001: unresolved external symbol __imp___aligned_malloc
    1>libcvd.lib(win32.obj) : error LNK2001: unresolved external symbol __imp___aligned_free
    1>libcvd.lib(win32.obj) : error LNK2001: unresolved external symbol __imp___findclose
    1>libcvd.lib(win32.obj) : error LNK2001: unresolved external symbol __imp___findnext64
    1>libcvd.lib(win32.obj) : error LNK2001: unresolved external symbol __imp___findfirst64
    1>libcvd.lib(win32.obj) : error LNK2001: unresolved external symbol __imp___makepath
    1>libcvd.lib(win32.obj) : error LNK2001: unresolved external symbol __imp___splitpath_s
    1>libcvd.lib(gltext.obj) : error LNK2001: unresolved external symbol __imp__toupper
    1>libcvd.lib(gltext.obj) : error LNK2001: unresolved external symbol “__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits,class std::allocator >::find(char,unsigned int)const ” (__imp_?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z)
    1>Release\PTAM.exe : fatal error LNK1120: 9 unresolved externals

    Could you please help me to solve this problem?

    Thanks in Advance.

  156. roby says:

    why does not PTAM rely on OPenCV? i think OpenCV is easier to handle image processing.

  157. Mike Beauford says:

    Hi George,

    Just wanted to say thanks for sharing this program. I got it to compile under the latest Linux Mint 17 build with a Logitec Pro 9000 camera running under VMWare Player 6.0.3 on my Windows 7 x64 box. For some reason VMWorkstation 10 can’t handle the USB video like the VMWare Player, don’t understand why. I followed the steps in the Linux how-to and they worked perfectly (http://hustcalm.me/blog/2013/09/27/ptam-compilation-on-linux-howto).

    I’ve made a very crude head mounted display with a half silvered mirror to demo the eyeballs to the kids, they absolutely loved it!

    Thanks so much!

    Mike Beauford

  158. Hang Chu says:

    Hi all,

    PTAM has become quite popular, and it definitely has influenced designs of lots of related software. I was trying to run some other 3D reconstruction package, in its tutorial it just says something like “the calibration parameters have similar format with the PTAM calibrator”.

    However in my case, I have the camera calibrated (with Zhang’s Matlab Toolbox), but I don’t know how should I format the calibration file in the PTAM format. The 1st-4th parameters are obvious, but I searched basically all the places and I still can not find what does the 5th parameter mean. I know it describes the camera distortion, but where can I find the exact mathematical representation of it?

    • georgklein says:

      Hi,

      The model is derived from the FOV model described here
      http://hal.inria.fr/inria-00267247/PDF/distcalib.pdf
      (“Straight Lines Have to Be Straight, Automatic Calibration and Removal of Distortion from Scenes of Structured Environments”, Frederic Devernay, Olivier Faugeras)

      The fifth parameter is related to the omega (field-of-view) parameter described in that paper… although in the PTAM implementation it might be scaled differently. You’d have to look at how it’s used in the r->r’ mapping function.

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