2
$\begingroup$

Is there an algorithm that fills the area outside the edges?

e.g.:
From this
enter image description here
to this
enter image description here

$\endgroup$
  • 3
    $\begingroup$ Yes, flood fill run from an appropriate point. $\endgroup$ – Yuval Filmus Mar 9 '17 at 12:19
2
$\begingroup$

Assuming for simplicity that the edges don't touch the image boundary (you can always guarantee that by adding a pixel-wide "frame"), you can simply run flood fill from an arbitrary point on the image boundary.

$\endgroup$
  • $\begingroup$ And these are the moments where I would say, "Why didn't I think of that". Thank you sir. $\endgroup$ – MrCzeal Mar 10 '17 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.