By default, libCVD compiles to 64 bit on OS X 10.6 Snow Leopard. However CVD uses QuickTime.Framework for video input, and this does not support 64-bit C bindings. Currently to get video input on snow leopard options are to either compile everything as 32 bit, or use libDC1394 (supposedly works fine on OS X, and CVD supports it), or figure out a way to get video input from the Cocoa bindings (which are supported in 64 bit.)
Joe Newman has been checked a partial workaround into libCVD which uses QTKit. It’s not a drop-in replacement for QTBuffer though, since QTKit is callback based and has to run in the main thread, so some manual plumbing is required.
Having tried this out, I cannot get this to give me a good frame-rate. It seems almost like despite me asking for 640×480 it drives my webcam at max resolution resulting in only ~7 FPS. The 32-bit approach is currently probably best. Or use libDC1394v2.
hi,
i`m trying compile in snow leopard using 32bits. I tried pass to gcc a argument to compile in 32 bits, but isn`t work. can you give me a tip to compile?
at linux it works very well. =)
Damian Stewart has posted instructions on compiling 32-bit libCVD on OSX to the libCVD mailing list. Link to post.
Hi, it compile libcvd but i still having problems. I’m doing it:
1: Download the sources from cvs
# cvs -z3 -d:pserver:[email protected]:/sources/toon co -D “Mon May 11 16:29:26 BST 2009” TooN
# cvs -z3 -d:pserver:[email protected]:/sources/libcvd co -D “Mon May 11 16:29:26 BST 2009” libcvd
# cvs -z3 -d:pserver:[email protected]:/sources/libcvd co -D “Mon May 11 16:29:26 BST 2009” gvars3
2: compiling
Toon: All ok… ./configure and make install;
libcvd: i used Stewart script to configure. it compiles ok, but i received this message
“checking for TooN… no
checking Old TooN… yes
configure: WARNING: Your version of TooN is too old for this version of GCC.
You need a recent version (SNAPSHOT_20080725 or later), or GCC version
less than 4.2.0.”
gvars3: i added -arch i386 in the makefile to compiler an linker. it compiled with no errors.
PTAM: first i fix the GL/gl.h to openGL/gl.h and openGL/glu.h in gl_helpers.
when i compile i receive this error:
“GLWindow2.cc: In member function ‘void GLWindow2::SetupWindowOrtho()’:
GLWindow2.cc:117: error: cannot convert ‘CVD::ImageRef’ to ‘GLdouble’ for argument ‘1’ to ‘void glOrtho(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble)’”
I saw in gl_helpers.h has a #ifdef CVD_HAVE_TOON and inside it has the glOrtho (const Toon:: Vector & param).
I think ptam cant find TooN, but why?
Strange.. did you have an old version of TooN lying around? Check that there is only a single version of TooN installed on your system. Ideally erase all installs you can find and then re- make install it.
hi again =)
i added it to Stewart script “-I /usr/local/include” and now libCvd found TooN =).
But now i have a new error when run PTAM make:
Undefined symbols:
“CVD::GLWindow::size() const”, referenced from:
GLWindow2::SetupWindowOrtho() in GLWindow2.o
GLWindow2::SetupViewport() in GLWindow2.o
GLWindow2::SetupViewport() in GLWindow2.o
GLWindow2::SetupVideoRasterPosAndZoom() in GLWindow2.o
GLWindow2::SetupVideoRasterPosAndZoom() 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
“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:
_main in main.o
_main 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
i looked in GLWindow2.cc and i think this erro happens with the use of size(), but why?
I’m guessing libCVD’s configure script couldn’t find your OpenGL. Check the configure script output and/or log.
hi,
yep, libcdv not found X and OpenGL:
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
i try to fix it without success =(.
Check the config.log for clues on this.
I succeeded finally. =D I will try create a .sh to do it automatically.
Klein, thanks for help =)
luis: Could you please show me how to fix this problem
because i am also encountering this problem too
many thanks
I’ll try create a tutorial to do it. But now i’m very buzy (i’m doing my graduation final paper) =/
Okay
Thank you
Hi Luis,
I am having the same problem as well. Could you please post your solution?
Thanks
I’m struggling with compilation on Snow Leopard with the same issue – please post your solution – even if its just a hint where to start …
thanks !!!
I managed to get the configure script to see the X libs on leopard at least using the following configure line:
./configure –without-ffmpeg –x-libraries=/usr/X11/lib –x-includes=/usr/X11/include
which explicitly tells cvd where to find the X libs, however I also had a problem that the _png_set_gray_1_2_4_8 method in libpng is now deprecated and has been removed. There is one instance of it that needs changing to _png_set_expand_1_2_4_8 in pnm_src/png.cc
Hope that gets you on the right track
I’ve written some compilation notes for PTAM on OSX Leopard, and also how to port PTAMM to OSX Leopard. While I know a lot of people want Snow Leopard, we have got this working, and a write up will be coming shortly. These notes might be a good start though:
Please! Some one post their solution to Compile PTAM on snow leopard!