c# - Generate a polygon from an image mask? -
i have image mask (could format let's keep simple, let's represented 256x256 array of bools false means masked , true means not masked) containing single shape, way started go polygon outline of said shape? shape guaranteed closed (not on edges of picture) , guaranteed non masked region.
so far i'm thinking of tackling way seems pretty naive i'm wondering if there's better solution (a third party library not option, i'm looking alternative / better algorithms, not dependencies).
- find masked pixels
- for each of those, ignore if doesn't have non masked pixel neightboor
- else pick point outline (i need outline "outside" area of interest, pick pixel in masked area , not in shape)
is best 1 can assumine no other properties known shape? (shape complex , detailed, trying find lines isn't option). note in cases shape human.
Comments
Post a Comment