Ask Your Question

drdan14's profile - activity

2013-12-06 19:38:00 -0600 asked a question Print contents of Mat object when debugging in Xcode 5 with lldb

I'm building a project in Xcode 5, which uses the lldb debugger. I'd like to be able to examine the contents of a Mat object from the lldb prompt. However, doing the obvious thing, printing with std::cout, doesn't work. For example, let's say I have declared Mat err and filled it with something. I'm actually debugging the BundleAdjusterBase::estimate method where this happens. Here's what happens when I try to examine the variable in lldb:

(lldb) expr cout << err
error: use of undeclared identifier 'cout'
error: 1 errors parsing expression

and

(lldb) expr std::cout << err
error: no member named 'cout' in namespace 'std'
error: 1 errors parsing expression

This is probably related to lldb not understanding the std::cout command; see also my stackoverflow post about generally using cout in lldb.

Is there any other way to examine a Mat structure in lldb?

2013-11-21 16:02:39 -0600 asked a question Step through OpenCV source when debugging in Macports OpenCV 2.4.6, Xcode 5

I am using OpenCV 2.4.6, installed by Macports on OS X 10.9, along with Xcode 5. I am attempting to use the OpenCV stitching library to make a mosaic of some images. I'm using the stitching.cpp file included with OpenCV. The mosaic works fine for some sets of images, and gives the following error for other sets:

OpenCV Error: Assertion failed ((globalDescIdx>=0) && (globalDescIdx < size())) in getLocalIdx, file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_opencv/opencv/work/opencv-2.4.6.1/modules/features2d/src/matchers.cpp, line 163
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_opencv/opencv/work/opencv-2.4.6.1/modules/features2d/src/matchers.cpp:163: error: (-215) (globalDescIdx>=0) && (globalDescIdx < size()) in function getLocalIdx

I would like to step through the OpenCV code using the debugger in Xcode, but when I attempt to peek into the stitcher.stitch() method in Xcode, all I see is assembly code. Is there a way to make Xcode aware of the OpenCV source or debugging information so that I can step through built-in OpenCV functions to find out what's going wrong?

Thank you in advance!

2013-10-31 12:27:58 -0600 received badge  Organizer (source)
2013-10-31 12:25:32 -0600 asked a question Build HTML documentation for macports OpenCV 2.4.6 on OS X

I downloaded and installed the latest version of OpenCV (2.4.6) for OS X Mavericks via the macports command:

sudo port install opencv

As far as I can tell, no documentation was installed.

I know that I can access the HTML documentation online at http://docs.opencv.org/, and I know that I can download a PDF of the documentation from http://docs.opencv.org/opencv2refman.pdf‎, but what I really want is a local HTML version of the documentation because (a) I want an offline version that is fast and doesn't require Internet access and (b) having all the documentation in a flat PDF is confusing.

It seems very likely that I can build the documentation somehow in the Linux/Mac OpenCV 2.4.6 archive file that I downloaded from http://opencv.org/downloads.html, but I don't know how to do it. There is a doc/ folder in that archive file, but everything is written in .rst files that probably need to be compiled somehow.

Can anyone help me either with commands to compile the included documentation, or with a way to download an archive of the HTML documentation?

I saw this related question but it's unclear to me what the specific sequence of commands is to build the documentation from scratch.

I know sphinx is required from that question. My python version is 2.7:

$ python --version
Python 2.7.5

$ which python
/usr/bin/python

And I installed sphinx for python 2.7 via the command:

sudo port install py27-sphinx

From the opencv-2.4.6.1/opencv-2.4.6.1 folder of the expanded opencv archive, I ran:

cmake -D BUILD_DOCS=YES -D CMAKE_BUILD_TYPE=RELEASE .

Among many other things in the output was:

--   Documentation:
--     Build Documentation:         NO
--     Sphinx:                      NO
--     PdfLaTeX compiler:           /usr/texbin/pdflatex

And running make html_docs from the same folder (opencv-2.4.6.1/opencv-2.4.6.1) didn't do anything

make html_docs
make: *** No rule to make target `html_docs'.  Stop.

Thank you in advance!