Face detection for static image, Find Top of head and chin

Hi everyone, I have studied OpenCV for couple of hours, but What I want to do is detect those two red line

  1. top of head
  2. chin

For now, I don’t need to find the point in real time, I can cost 2~3 second to calculate the two points( only needs Y-coordination )

So my need is pretty simple, But what I found on the internet is find the 2. chin only, but for the top of head… I haven’t found a good post yet.

What I have found is this post

So somehow it can extract the hair, so I just get the topmost point of hair segmentation as top of head, then I can figure out these two point.

But I just wonder, does this simple request needed to be commit so much efforts? are there simple ways to do?
And since hair is varied a lot, maybe the person is bald or with colorful hair, but usually is black, white or gray
I need to consider all of these cases.

Thanks for review my question.

welcome, expect some more :wink:

i would not think you need something as complicated as hair detection.
opencv comes with several face detection methods, like cascades and dnn based detection, there are also facial landmark detectors, which can give you the actual face outline.

I check topmost results of google “facial landmark detectors” and “facial landmark detection”, but what I have seen, they don’t detect “top of head”(need to consider hair), they do detect chin, and face outline.

For example, I found this one post

it says if you want detection area include hair, then you need to train your data, since current model not include that.

If there has something I have missed, please tell me.

so, what have you tried, so far, on your own ?
and what is the purpose of it all ?

again, you probably do not need to detect hairs

I have followed this example and test it on my image.

But still try to find how to draw the line of top of head (red line)

Now I know the lowest Y coordinate will be jaw position.

Thanks for the keyword hint. Now I need to figure out how to find the point of top of head.

Do you know how to find that?

landmarks68

(edit: better image)

Got it. So the 8th point would be jaw point? How about the top of head… still don’t have any idea about that.

can you tell us, what you’re trying to do with it ? what’s the purpose of your program ?

finding the top of the head is highly unreliable
(hair gets in the way again, which is probably meaningless for “measurement”)

We need to extract head for printing photo, let’s what we want to do.
But I found a way to solve that using Canny to detect edge will probably solve my problem