Image "Outlining" Algorithm

01-11-2005, 10:31 PM
This is a very tricky and rather advanced subject for me to properly describe, which makes it even harder for me to research for. That's why I decided to simply post my question for now, so meanwhile I could continue my wild, search-engine goose-chase, and possibly double my chances for answers. Anyways, here goes, nice and slow:

For quite some time now i've been working on a gigantic library containing a series of sectioned objects, each pointing toward a specific aspect of programming. One of those categories includes an Imaging object, which mostly wraps the gdi32.dll from the WinAPI. For years now, I've been hearing people left and right asking about how application skinning works, and so I decided to go the extra mile with this paticular object and add a few skinning functions into the mix. They work great and all, but I had one paticular idea in mind that I wanted to implement from the start, but kept holding back on...

I wanted to figure out how to determine the "outline" of an image (not neccesarilly a graphical outline, but an imaginary polygon that outlines specific areas of the image), for use with API regions, so that form clipping can occur in several customizable ways depending on the colorkey used in the source image (in this library, colorkeys are used to specify transparent areas in a loaded image). I hope i'm not confusing anyone so far... =/

I guess what i'm searching for are ways to implement an algorithm similar to the one used for Paintshop Pro's "Magic Wand Selection" tool, where if you click a color in the image, the selection expands outward until it finds a pixel that doesn't fit the specified parameters of the first one. I believe, perhaps, it would be possible to turn the resulted "selection" into an API region, which I could then delete or manipulate in whichever way I see fit. I want to be able to allow my clients to create a monochrome image that specifies areas to be seen (unclipped regions) and areas to be transparent (clipped regions).

I know i've seen this sort of thing somewhere before, but I can't quite put my finger on it. I still don't know where to start my research with this, so I was wondering if I could get a quick little hint/shove in the right direction if anyone else knew. Thanks for your time.

01-11-2005, 11:16 PM
Are you looking for Edge Detection or Active Contours perhaps? As a nice jumping off point I've found lots of great links from here:

Several Active Countour (snakes) links there that might be just what you are looking for.

(I'll admit I haven't used Paintshop Pro but I think that's the gist of what you were asking about). Cheers.

01-12-2005, 12:27 AM
Wow, that's a nice find! I'll move my searches to that site, maybe I'll find what i'm looking for. Regardless, i'm bookmarking that page... It's of great use to my future searches. ;)

Thanks! I'll be back with whatever I can manage to find...

01-12-2005, 07:43 AM
You may have speed problems with larger forms using an edge detection alg to create regions.

A better way would be to use a colorkey as the removed region of a form then place the data into a dat file...


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum