Jump to content
  • Advertisement
Sign in to follow this  
VanKurt

Simple shape recognition

This topic is 3750 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!