3d from single camera -

Hey there!

I’m trying to break down this cool bundle of software into pieces.

Try to incorporate opencv instead of that CVD and find a better solution for the linear algebra thingy.

the image sources should be covered by the videoGrabber offered by OF (and its possible extensions), as well as the GUI, ofxGUI or the simple one is considered to be fit enough for replacing the original interface.

I believe when in calibrated session there are a huge of code being executed, and it is no problem since the requirement of the calibration is being ‘steady’; can be translated as not-really-need high frame rate.

cheers

Dio

I am unsure of what you meant by the following two paragraphs:

“Try to incorporate opencv instead of that CVD and find a better solution for the linear algebra thingy.”

Will openCV provide better performance compared to libCVD and gvars?

“the image sources should be covered by the videoGrabber offered by OF (and its possible extensions), as well as the GUI, ofxGUI or the simple one is considered to be fit enough for replacing the original interface.”

is this another possible performance increase suggestion by using OF?

Will openCV provide better performance compared to libCVD and gvars?

Who knows? *hahaha* but at least it is manageable and easiest to incorporate with OF, instead of introducing another similar foreign library.

is this another possible performance increase suggestion by using OF?

Actually the latter is my dream to build this system with OF’s components…:P)

Hmmm… I have also hit the following error that results in PTAM crashing:

ARDRiver: Creating FBO…

Was anyone able to get past this error? I saw that it may be a result of some nvidia function calls. Not sure if a workaround was found yet. Like a previous poster, I am also using the Intel graphics driver on my laptop.

If there is no workaround, maybe someone point me to the class that is creating the error so that I can look at it?

BTW following these instructions on OS X work well:

http://www.robots.ox.ac.uk/~gk/PTAM/README.txt

But I had to change my make file for PTAM at the final step to this line:

COMPILEFLAGS = -I /usr/X11/include -D_OSX -D_REENTRANT

From the previous compile flags settings. If you have X11 and the X11 SDK it works seemingly, I just have to print out the calibration sheet. Anyone else got it going on OSX?

[quote author=“strife25”]Hmmm… I have also hit the following error that results in PTAM crashing:

ARDRiver: Creating FBO…

Was anyone able to get past this error? I saw that it may be a result of some nvidia function calls. Not sure if a workaround was found yet. Like a previous poster, I am also using the Intel graphics driver on my laptop.

If there is no workaround, maybe someone point me to the class that is creating the error so that I can look at it?[/quote]

Yeah, unfortunately FBOs will definitely not be supported by an intel integrated graphics card. Sorry!

Theo

[quote author=“JGL”]BTW following these instructions on OS X work well:

http://www.robots.ox.ac.uk/~gk/PTAM/README.txt

But I had to change my make file for PTAM at the final step to this line:

COMPILEFLAGS = -I /usr/X11/include -D_OSX -D_REENTRANT

From the previous compile flags settings. If you have X11 and the X11 SDK it works seemingly, I just have to print out the calibration sheet. Anyone else got it going on OSX?[/quote]

oh awesome - wow - figured it would be more of a pain that that!
screen grab when you get it working!!

Theo

nice! I tried doing it all by hand which a bit like using a sledgehammer. Ah, readme files…

  • z

Could anyone also post a screenshot or video of it working on windows as well?

It definitely seems like there is a lot of performance issues with windows, regardless or crashes and compilation problems…which is why the readme file does explicitly state that there are problems with it on the respective platform

[quote author=“theo”]
Yeah, unfortunately FBOs will definitely not be supported by an intel integrated graphics card. Sorry!

Theo[/quote]

pootrousers, is there a way around that?

d

Looks like the mac drivers for some of the intel cards support FBOs
There is a nice discussion about it here:

http://www.opengl.org/discussion-boards-…-ber=240097

I don’t know if it is useful or not, but FBO takes care the Off Screen Rendering, which is can (also) be done by using pBuffers.

http://www.mesa3d.org/brianp/sig97/offscrn.htm

cheers

Dio

I could be wrong, but as I understand it - one important difference between pbuffer and FBO is that pbuffer is a different context completely, meaning textures, drawing state, etc wont be able to be shared between pbuffers… This means while it’s possible for an FBO to replace a pbuffer, it’s harder for a pbuffer to replace an FBO.

  • z

Download as far as I got (Intel OS X 10.5, XCode 3.1.2.

http://dl.getdropbox.com/u/370155/PTAMJGLIntelOSX.zip

Might only be there temporarily!

I haven’t got a printer at home, so I have been unable to calibrate - could some one with a Mac give it a go? Everything should be complete.

You will need X11 and X11 SDK installed I believe.

Cheers,

JGL

Hello All,

I got my new printer today, and printed out the calibration.

I am just using my iSight (buildt in MacbookPro) at the moment, and I think I need to do some more calibration - but it works and tracks!

See below:

I have also moved the code to a more permanent location:

http://homepage.mac.com/joelgethinlewis/download/PTAMOSXIntelX11.zip

Don’t forget to run from the X11 Terminal!

I can’t wait to get this working in oF.

Cheers,

Joel

PTAM on windows with logitech webcam

yeah! I can’t wait it works with OF too…

cheers,

Dio
~exam-oh-exam

Actually, Hashimoto Straight is the author of that code …
http://kougaku.blog28.fc2.com/blog-entry-317.html

_Anyone else who has done this in windows (webcam or 1394 ) please chime in with your performance and functionality._

I too am experiencing low frame rates … that diminishes the over all functionality. The readme says ‘we experience some frame-drop issues which don’t seem to arise on other platforms.’ I wounder if this is what they were talking about. I would define my attempt at this as not working as expected.

I am running on a WINXP AMD dual core 2.3Ghz, with 2GB RAM and SLI NVIDIA GFORCE video and a Quickcam 5000. I used the source from http://image.chonnam.ac.kr/scraps/share/PTAM.zip and modified it with PTAM_webcam.zip from http://briefcase.yahoo.co.jp/blog-kougaku/ and compiled it with vs2005.

I am able to calibrate, but performance is not like I have seen in the videos. I can also do the tracker initialization … very poor performance. The main thing I don’t see is all the fancy stuff you see them doing in the videos … when I click on menu … I get a blank box :cry: do all we get is the goggling eyes? (boooo)

I am able to register clicks, although the lag involved makes it a bit difficult.
I have to click and hold the mouse button until the PTAM program catches up.

I also would like to try and compile this stuff with ACML the AMD math library that replaces lapack and blas functions with optimized versions. I will also try the intel MKL math library once i figure out how … not to mention it cost $$. lastly there is also and optimized version of libjpeg http://cetus.sakura.ne.jp/softlab/jpeg–…-gsimd.html

Finally, What needs to be done to make this NOT Nvidia dependant. I would love to be able to run this on intel video platforms.

sfranzyshen

@JGL: thanks for putting all the source code in one place…i’m pretty fresh to the terminal but managed to get it up and running…

…yes there is slow down when calibrating the camera, but that seems fine given that it is super fast once the camera is calibrated and you are running the tracking program…

…awesome!!!

:wink:

@sfranzyshen

Concerning the cameraCalibrator, you were right that the buttons were registering fine, they just took FOREVER to register.

With the performance of the calibrator, I have narrowed down the function that causes the poor 1fps performance and it is when the program determines if the current frame is showing corners or not:

  
  
inline bool IsCorner(Image<byte> &im, ImageRef ir, int nGate)  
{ // Does a quick check to see if a point in an image could be a grid corner.  
  // Does this by going around a 16-pixel ring, and checking that there's four  
  // transitions (black - white- black - white - )  
  // Also checks that the central pixel is blurred.  
  
  // Find the mean intensity of the pixel ring...  
  int nSum = 0;  
  static byte abPixels[16];  
  for(int i=0; i<16; i++)  
    {  
      abPixels[i] = im[ir + fast_pixel_ring[i]];  
      nSum += abPixels[i];  
    };  
  int nMean = nSum / 16;  
  int nHiThresh = nMean + nGate;  
  int nLoThresh = nMean - nGate;  
  
  // If the center pixel is roughly the same as the mean, this isn't a corner.  
  int nCenter = im[ir];  
  if(nCenter <= nLoThresh || nCenter >= nHiThresh)  
    return false;  
    
  // Count transitions around the ring... there should be four!  
  bool bState = (abPixels[15] > nMean);  
  int nSwaps = 0;  
  for(int i=0; i<16; i++)  
    {  
      byte bValNow = abPixels[i];  
      if(bState)  
	{  
	  if(bValNow < nLoThresh)  
	    {  
	      bState = false;  
	      nSwaps++;  
	    }  
	}  
      else  
	if(bValNow > nHiThresh)  
	  {  
	    bState = true;  
	    nSwaps++;  
	  };  
    }  
  return (nSwaps == 4);  
};  
  

I also agree that this software needs to be ported from nvidia, if anyone is looking for help with this, I am currently working on the same problem so just PM me so we can collaborate.

ok i was actually able to get it all to work. The problem was openGL’s framebuffer objects (FBOs). I am using Mobile Intel 965 chipset for my graphics and updated my driver to the one created on 12/2/08:

http://downloadcenter.intel.com/Product-…-0&lang=eng

Now i am able to start and run the software fine (granted there are definitely some performance issues still apparent, but i am fine with that atm.)

My only question left is how do i get the 3D objects (like the eyes) to appear on the screen? I am able to create a map, but when i click on “Menu” on the screen, an empty menu appears.