Simple shape recognition

Started by
1 comment, last by Jan Wassenberg 15 years, 10 months ago
Hi guys! I'm doing a simple game project for university. The tricky part is the input: The game has to be controlled via WebCam (the player is waving around a blue postcard in front of the cam). Now here's the problem: How can I find the position and rotation of the postcard from the captured image? I already post-processed the image a little to make it Black and white. Take a look at the pictures below: First one shows the post processed image (256x256), the second one what I would like to have (the four corners). Two Pictures So for the human eye it's very easy to find the rectangle in this picture...but for my PC? I actually don't have the slightest clue how to approach this... Can you help me out?
Advertisement
wikipedia on edge detection might be a good starting point
Suggestion #1:
1) "morphological open" to reduce noise
2) apply edge detector, e.g. Canny
3) hough transform, extract 4 highest peaks (assuming you know the target is always a quadrilateral)
4) intersect lines to find corner points

Suggestion #2:
1) edge-preserving smooth filter (e.g. bilateral)
2) segment the image using boundary representation of regions
3) calculate min-area oriented bounding box

Both will probably do well, it's just a question of convenience depending on what libraries you have available - more low-level image processing, or rather geometric tools.
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3

This topic is closed to new replies.

Advertisement