Posted by synedra on Feb 27, 2009 in
Uncategorized
I need to get OpenCV working on my system for a couple of image processing tasks I have for work, and as with many complex software systems, it was somewhat difficult to get it working on my system, a macbook pro running Leopard (OS/X 10.5).
Their
installation instructions were fairly good. I first tried to use regular old make, but I had a few issues with libraries that regular old make couldn’t find. So I installed cmake to use for this purpose. I highly recommend it.
With cmake, I was successful with the suggested instructions:
% mkdir build
% cd build
% cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -DBUILD_PYTHON_SUPPORT=ON ../
After that, ‘make’ and ‘make install’.
I ran into a few issues during this process.
- No swig on my system. The installation page lists it as an optional install, but it’s needed for python, and python is what I want (they say this, but I thought it would do something other than just ignore my desire for python). So install swig, and use the CMake GUI tool to make sure that your SWIG_DIR is set correctly.
- Couldn’t find my Python.h file. Since I had installed my python using darwinports, my Python.h isn’t really where it was looking. I fixed this by editing the CMakeCache.txt to change PYTHON_INCLUDE_PATH:PATH=/sw/include/python2.5. If your swig stuff is complaining about no Python.h (but you have one), find your Python.h and change this line in CMakeCache.txt. There’s probably a more elegant solution, but this worked.
- For some reason CMake was pointing to the wrong SDK on my system (. It wanted to use the 1.4u version, but I’ve got 1.5, so I changed /Developer/SDKs/MacOSX10.4u.sdk to /Developer/SDKs/MacOSX10.5.sdk using the CMake GUI.
- Couldn’t find my resulting opencv library. I copied it to the /Library/Python path.
- I wanted to make sure it installed all of the examples, so I selected them using hte CMake GUI utility.
Note that I did try the darwinports version, and lost a couple of hours trying to figure out how to get the python piece of that to work on my system. I don’t suggest that path.
I am pleased to report that now the python examples (at least) work on my system. Including the houghlines.py which I needed to do the actual task ahead of me. So, hurray.
I decided that to implement a houghcircles example I should really get the C code examples working, and thanks to the helpful instructions
here I was able to do it easily. Follow those instructions and then you’ll be able to compile and run all of the C example files (and make your own, and run them too!)
So I wrote a houghcircles example using some of the example code from the opencv book, and it works, kinda. Pretty well I think, for just futzing around for an evening:
Someone wrote to me about this blog post and said they were having some trouble with using the iSight for video input. I discovered I was having the same problem. The answer, gleaned from various places on the internets, was to unset DYLD_LIBRARY_PATH in my environment. Confuses the heck out of openCV. Which is kind of a problem because ROS requires it, at least to build. So if you get weird library missing/wrong errors, unset that bad boy and see if it helps.
Tags: opencv, python
Posted by synedra on Feb 18, 2009 in
Uncategorized
I was having some fun poking around at the Netflix API, and realized that there wasn’t a Netflix module for python, so I put one together. First version is up at http://code.google.com/p/pyflix. Has installable code, an example file, and a py.test compatible test file.
Posted by synedra on Feb 10, 2009 in
Uncategorized
When last we left my intrepid tummy, we were headed to the gastro doc to talk about why it was so sad. She decided I should have a colonoscopy to make sure my intestines weren’t problematic, and a CAT scan to make sure my pancreas wasn’t puffy. So, after finishing my 3 weeks of the elimination diet, I spent a day drinking barium for the cat scan, and then later that week I spent a day eating clear liquids for the colonoscopy.
Verdict: My pancreas is fine. My intestines did have a flat polyp which she removed (hurray!) No crohn’s, no other problems.
So, we’re left with the likely problem of Small Intestine Bacterial Overgrowth. I’ve done some research on this and I’ve found a program that seems to really be working. So, anyone in a similar situation can take heed and see if something like this will help you too:
- Enteric-coated peppermint oil. This stuff is awesome. It kills bacteria in your small intestine and reduces gas and bloating. 3x/day. I’m gonna take this for a month and then switch to building up my flora, because I’m guessing the peppermint oil isn’t smart enough to distinguish between “good flora in the large intestine” and “misguided flora in the small intestine”
- Much less crap. I’m trying to keep myself to foods which are as close to whole as possible. I know, duh, but really, this is making a huge difference. I’m making bread in my breadmaker almost every morning, making dinners from actual ingredients, avoiding foods that tend to cause acidity in your system. I noticed that eating more alkaline-causing foods made my body happier so I’m working on that. Note that artificial sweeteners are the acidest foods of all.
- UltraClear Ph. This is medical food that helps keep your Ph in the right place. And it seems to help my system be happy.
So much success I’m having on this plan that two days ago I WORE PANTS for the first time in 3 years. And didn’t have to take them off from uncomfortable bloating.