3
$\begingroup$

I would like to ask that is it possible to draw borderline - contour - around those cells (pixels) which are neighboring and contains the same value.

An example by hand:

enter image description here

enter image description here

Thanks!

$\endgroup$

1 Answer 1

6
$\begingroup$

One way is to treat it as an image and to use edgedetect:

img = Import["https://i.sstatic.net/DI4S4.png"];
ImageMultiply[ColorNegate[EdgeDetect[img, 1, 0.1]], img]

enter image description here

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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