With just 5 steps, you’ll get a perfect environment in your Mac for OpenPool Effect development.
Below shows how to set up all necessary tools to create your own effects.
It might look like a long article since we put many screenshots for easier understanding, but it’ll only take about 30 min to complete.
Are you ready? Let’s begin!
(Tested under MacOS X 10.8.3 Mountain Lion)
STEP1. Install Processing
The key to OpenPool is Processing. So let’s install it first.
Download Processing from:
http://www.processing.org/
Download Processing 1.5.1 for Mac OS X, which is located in the Stable Releases section.
(Important Notice: Don’t download ver2.0. At this time, OpenPool is NOT compatible with Processing ver2.0)
Then unzip the downloaded file, and move Processing(.app) file into Applications folder.
That’s it! Easy, eh?
STEP2. Install OpenCV
Next, let’s install OpenCV, Open Source Computer Vision Library, which is an open-srouce library aimed at real-time computer vision.
First, you’ll need wget, cmake and make commands to install OpenCV.
If you don’t think you already installed these commands, click to open the folded sections below.
Open a terminal window, and type:
1 |
make |
If you see a message like below, you can skip this section.
1 |
make: *** No targets specified and no makefile found. Stop. |
However, if you see a message like this;
1 |
make: command not found |
You need to install Xcode Command Line Tools in order to use the make command. Go to https://developer.apple.com/downloads/index.action and download it.
(You’ll need to login with Apple ID. You already have it if you have iPhone or iPad. It’s the one you use when you download apps.)
Note: Please make sure the file you are downloading is correct: It’s different between Mountain Lion and Lion)
After installation is done, you’ll be able to use the make command”.
※You can install Xcode itself of course, but it’s a huge file to download, so we recommend you to install Commanld Line Tools instead. It actually works as long as you play with OpenPool.
Open a terminal window, and type:
1 |
wget |
And if you see:
1 |
wget: command not found |
then you’ll need to install wget. (You may need to check out in the same way for cmake.)
We will use homebrew to install wget and cmake. If you don’t have homebrew in your Mac, just paste and this line on Terminal.
1 |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" |
After installing homebrew, you can install wget and cmake with:
1 |
brew install wget |
1 |
brew install cmake |
So, let’s install OpenCV 32bit. Open a terminal window, and cd to some directory and;
1 2 3 4 5 6 7 |
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.3/OpenCV-2.4.3.tar.bz2 tar xjvf OpenCV-2.4.3.tar.bz2 cd OpenCV-2.4.3 mkdir build; cd build cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=i386 -D CMAKE_C_FLAGS=-m32 -D CMAKE_CXX_FLAGS=-m32 .. make -j4 sudo make install |
When you “make -j4”, it’ll take a bit long time and your Mac may get very heated and fans may go crazy, but just wait until it’s done.
You can go complete STEP3 and STEP4 while you are waiting. But don’t forget the last line, sudo make install.
※By the way, you may want to install OpenCV with homebrew. But it’s problematic at this time. See: https://github.com/mxcl/homebrew/issues/18139
STEP3. Install OpenNI
We need OpenNI to use Kinect.
Let’s download these two files: SimpleOpenNI-0.27.zip and OpenNI_NITE_Installer-OSX-0.24.zip.
http://code.google.com/p/simple-openni/downloads/list
Firstly, unzip the latter file and cd to the extracted OpenNI_NITE_Installer-OSX directory on Terminal, like:
1 |
cd ~/Downloads/OpenNI_NITE_Installer-OSX |
Then, do this:
1 |
sudo ./install.sh |
Next, unzip the former file and move the extracted SimpleOpenNI folder into:
/Users/(your Mac username)/Documents/Processing/libraries/SimpleOpenNI
(You might need to create new folders named Processing and libraries by yourself.)
Very good! You got OpenNI ready now.
※Make sure you are moving NOT SimpleOpenNI-0.24 folder, but SimpleOpenNI folder which is inside it.
※Processing folder must be locate in Documents folder.
※The same instuction is described here too: http://code.google.com/p/simple-openni/wiki/Installation#OSX
STEP4. Install OpenPool
Finally, let’s install OpenPool.
http://www.openpool.cc/wp-content/uploads/OpenPoolCore.zip
Unzip the file, and move the extracted folder to:
/Users/(you Mac username)/Documents/Processing/libraries/OpenPoolCore/
Easy!
STEP5. Run Sample Effect
You did it! Everything’s all set. Now, let’ run the sample effect!
The sample file is located here:
(OpenPool directory)/examples/OpenPoolExampleImageOnBall/OpenPoolExampleImageOnBall.pde
After Processing window appeares, press the Play button.
Hooray!!
The effect is working with a recorded video, which is in the data folder next to OpenPoolExampleImageOnBall.pde.
Let’s change the image with this line:
1 |
img = loadImage("sample.png"); |
The image is also located in the data folder.
Enjoy!