Processing image and find outer edge. Find an algorithm -


i have problem 1 steps have do. important problem. have image, example: enter image description here

the second step's select part of image: enter image description here

ok. if have image in cache, selected area:

enter image description here

early steps have done. problem last step, task select (exactly outer) border area. here's example how should looks:

enter image description here

my ask's algorithm or steps have last effect. it's feasible images? prefered language's c#/c/js if know knowledge solution nice! had find algorithm detect edge, not outer edge.

maybe try following:

  • pick random 10 pixels borders of selection (it important borders)
  • get average rgb of pixels
  • get max = max color distance between pixels
  • perform white flood fill tolerance = k*max, starting 1 of edge pixels

this way should able flood fill gray background in selection


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -