T
trant
Hello,
I am hoping to find someone who is very knowledgeable in geometric algorithms.
I need to scan a bmp file which has many distinctly colored continuous
regions. The color is the exact same RGB value for each pixel in it's region,
if a pixel has any variation in RGB from another it means it's from a
separate region.
Here is a sample of what it looks like:
http://members.verizon.net/~vze28272/a1.JPG
Upon scanning such a file (this one is converted to JPG for compression
sake, but the real file is bmp and completely solid colors) I want to be able
to make an object which represents each distinct region - so it would have a
polygon which roughly matches the border from the image (though not exact
since it would be far too many vertices if I tried to make a polygon that fit
it precisely by the pixel).
The only thing that I can think of which remotely resembles what this
algorithm needs to do is convex hull, but that algorithm would not be good
because it would create polygons with shortest distance between the points
and thus create bulkier shapes - I need the shapes to roughly "shrink" into
these colored regions
The desired result would be illustrated by this next picture:
http://members.verizon.net/~vze28272/a2.JPG
Imagine the letters represent the objects which would be created for each
colored region detected, and the lines represent the polygon border for them.
Notice those borders do not precisely follow the border pixel by pixel so
that I can save potentially hundreds of Points per polygon. This is
absolutely necessary since the real application would be dealing with
thousands of these regions.
Can you recommend any algorithm or article that may teach me how to
accomplish this goal?
Thanks in advance!
I am hoping to find someone who is very knowledgeable in geometric algorithms.
I need to scan a bmp file which has many distinctly colored continuous
regions. The color is the exact same RGB value for each pixel in it's region,
if a pixel has any variation in RGB from another it means it's from a
separate region.
Here is a sample of what it looks like:
http://members.verizon.net/~vze28272/a1.JPG
Upon scanning such a file (this one is converted to JPG for compression
sake, but the real file is bmp and completely solid colors) I want to be able
to make an object which represents each distinct region - so it would have a
polygon which roughly matches the border from the image (though not exact
since it would be far too many vertices if I tried to make a polygon that fit
it precisely by the pixel).
The only thing that I can think of which remotely resembles what this
algorithm needs to do is convex hull, but that algorithm would not be good
because it would create polygons with shortest distance between the points
and thus create bulkier shapes - I need the shapes to roughly "shrink" into
these colored regions
The desired result would be illustrated by this next picture:
http://members.verizon.net/~vze28272/a2.JPG
Imagine the letters represent the objects which would be created for each
colored region detected, and the lines represent the polygon border for them.
Notice those borders do not precisely follow the border pixel by pixel so
that I can save potentially hundreds of Points per polygon. This is
absolutely necessary since the real application would be dealing with
thousands of these regions.
Can you recommend any algorithm or article that may teach me how to
accomplish this goal?
Thanks in advance!