Sign in to follow this  
MangaTigerBoy

Points along a black and White image

Recommended Posts

MangaTigerBoy    101
I'm using C++ and Dark GDK, and I was wondering: how can I get my program to place points around a simple black and white image? I want it to trace and create a "connect the dots" style structure of variables. Like this: http://i878.photobucket.com/albums/ab348/MangaTigerBoy/wotIwant.jpg

Share this post


Link to post
Share on other sites
bzroom    647
You'll want to use edge detection algorithms to generate a single pixel border around the contained volume. Treat the pixels as a loop of line segements. Then interpolate along your line loop placing those nodes at what ever interval/criteria you choose.

Share this post


Link to post
Share on other sites
Zahlman    1682
What do you *really* want? Would it work to pick the dot positions first and then draw the curved path through them? Because that's a hell of a lot easier. :)

Share this post


Link to post
Share on other sites
MangaTigerBoy    101
Ok, yeah. What I need is it to only place points at angles of 10 degrees or more, and always space the nodes maybe 10 -15 pixels apart.

and sorry, bzroom, the LAST thing I need at this point is a bunch of nonspecific "commands".

Share this post


Link to post
Share on other sites
Zahlman    1682
And do you have to generate a path from scratch? Why not have some kind of data file with a bunch of (r, theta) pairs? You would find the next point by storing the current point position and angle, and for each pair in the data file, update the angle with theta, and move forward r pixels in the new direction.

Does the path need to be a closed loop? Do you need to tweak dot positions so they're evenly spaced around the curve? (If so, does "evenly spaced" refer to straight-line distance, distance following the curve, or something else?) About how many points per curve are we talking about?

And perhaps most important: what do these points and curves actually mean? What is their significance?

Share this post


Link to post
Share on other sites
bzroom    647
Quote:
Original post by MangaTigerBoy
and sorry, bzroom, the LAST thing I need at this point is a bunch of nonspecific "commands".


I dont know what you mean by that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this