2
$\begingroup$

I would like to obtain contours(outline) of the image (black and white thin curve version of the original image). Outline that would just look nice.

First attempt

I first try using EdgeDetect however result just doesn't look very good. The shape of the head and torso looks good, however lips and nose looks quite unnatural.

image = Import[
   "https://i.imgur.com/fFmetq6_d.webp?maxwidth=760&fidelity=grand"];
Thinning[EdgeDetect[image]]

enter image description here

Second attempt

I then thought that maybe I should try to detect contour instead first. However ContourDetect seems to loose a lot of detail even with different delta values.

EdgeDetect[ContourDetect[image, 0.5]]

enter image description here

Do you have any idea how could I obtain pretty looking outline of the image?

$\endgroup$
1
  • $\begingroup$ You can first take the row or column of the pixels that goes through the interesting region and apply the MinMax to corresponding set of color channels. Next, you should take the edge value in between the obtained Min and Max. $\endgroup$ – Rom38 Mar 20 at 11:37
5
$\begingroup$

Edgedetect gives a binary image. Faces really aren't binary. Perhaps GradientFilter is worth a look:

Manipulate[GradientFilter[image, {s, t}] // ImageAdjust, 
                                 {s, {1, 2, 3}}, {t, 0, 5}]

Here I used the Manipulate to find "good" values of the parameters of the gradient.

enter image description here

$\endgroup$

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.