Susan Lin + Chong Han Chua — Balloon Grab, Project 3 Final
The Technical Magic
Technically, this project was lots of fun and frustration, all in the same sentence. The kinect depth map is not a very stable in general. Blob detection tends to be unstable across frames as a result.
The hand detection algorithm is overtly complex but it works like this:
- For every depth of 15 values or so, it thresholds front and back.
- For the thresholded image, it uses the openCV contour finder to look for blobs within a certain range.
- Cull if the blobs are too high or low in the frame.
- Calculate the ratio between blob and boundingRect.
- Calculate the distances between the centroid and the perimeter. Cull if there are no more than 4 peaks in the difference in distances. The idea is to start the recognition by looking at an open hand.
- Iterate through current row of hands. If there is already an existing hand in the same location, assume they are the same and merge them together.
- If not, add a new hand.
- There is also a lifetime function to calculate basically a confidence level for the blob. Because the kinect drop frames, it is essential to actually “remember” that there was a hand in the same location.
The closed hand detection uses the above, but looks if the smaller blob overlaps the existing larger area. As we can observe in the video, it is fairly good but not entirely robust. There are a few techniques to improve detection going forward.
- Use real dimensions to calculate length. We can estimate hand size by using real measurements.
- Use bounding polygon versus blob instead of bounding rect. This way we can account for the “holes” in the hand and get a more accurate result.
- Remember the size, depth and location and guess intelligently.
The rest of the sketch uses box2d and various other enhancements such as a gradient drawer that takes in any arbitrary RGB color on each end. Another challenge that we had in the project was to deal with C++ code. C++ is en entirely too verbose language compared even to Java, which says alot. Another bug that I encountered was that the vector class actually uses the copy constructor on the push_back function. This actually led to 2 different copies of the same object at one point in the program. In short, pointers is such a big hairy mess. However, this was solved in the version demoed, hence the animations.
All in all, pretty fun! I’ll continue in working on the robustness of the hand detection and hopefully able to get some hand gestures going on.
Process + Back-story
At first, we were planning to generate the art using code. The first two prototypes were done in Flash and Processing, to get the feel for the physics of the floating and collisions. However, when porting to C++ it became evident that our project’s scope was somewhat large. We cut trying to generate images and having implementing a system that animated the pngs.
As for the story, we wanted to play with the idea of the “Red String of Fate.” Ran out of the time, but ideally, the hands would be tied together with red string and the players would not be able to float unless all participants were clenching their hands (grabbing balloons). There was a lot of thought for all the cases. Here’s a snippet:
2 Hands:
Co-op
Rise: can only rise when both hands are closed
Fall: when EITHER hand is open1 open, 1 closed: balloon hand goes to top of screen, but balloon bursts due to lack of co-op
3 Hands:
Co-op with “weighted” areas on string
Rise: all 3
Fall: any 1 hand
1 open, 2 closed: can’t even float up
2 open, 1 closed: balloon hand goes to top of screen, but balloon bursts due to lack of co-op
Hi Chong-Han, Susan — nice work — here are comments from the crit.
—————————-
Don’t worry about the current state of the project. Even if it dosen’t work, don’t make excuses when presenting. Just say “We had some trouble. Its not finished, but lets talk about the current state, what we learned, and what we will fix by Friday.” If you start apologizing during a presentation, you are asking the listeners to not pay as much attention.
Again, don’t be down .. push your concept and get that video for Friday.
Really nifty premise.
“This is a humble pie for me” — Chong Han
^ haha
The interaction with the hand is really nice. It looks like you still accomplished a lot with this project, even if you didn’t quite get it to the point that you wanted.
Interesting and unique source of inspiration! Very cool graphics.
Interesting idea, and the graphic asthetics look really good. We all have bugs with our code, it’s hard to convey them in a presentation. The sliding of the screen is awesome. FEAR the dark colors on projectors.
Could’ve used more process description & detail on the issues you faced since the final demo wasn’t 100%.
High complexity project. Too bad C++ got in your way.
Beautiful graphic style – great backstory. Would be neat to see more about how that plays out in the demo.