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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -