在肖像图像中检测头发? [英] Detecting hair in a portrait image?

查看:128
本文介绍了在肖像图像中检测头发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在简单的肖像图像中检测和移除人的头发的最佳方法是什么?任何有用的算法库?我一直在关注openCV,看起来它可能有些用处

What would be the best approach for detecting and removing a person's hair in a simple portrait image ? Any useful libraries of algorithms ? I have been looking over openCV which looks like it could be of some use

推荐答案

你在这里处理两个不同的问题:

You're dealing with two different problems here:


  1. 检测肖像中的脸部是否有头发

  2. 删除头发

第一种可以轻松解决:


  • 分开来自背景的脸部(正如你提到的简单的肖像图像,这应该不会太难)。

  • 将图像转换为Y'CbCr 色彩空间

  • 无论种族如何,人体皮肤的色度值范围都相当窄。有关详细信息,请查看本文

  • 上述方法将帮助您将面部皮肤区域与非皮肤区域分开。

  • 假设非皮肤区域由头发组成。请注意,面部毛发也会被作为非皮肤区域拾起。

  • Separate the face from the background (as you've mentioned a "simple portrait image", this shouldn't be too hard).
  • Convert your image to the Y'CbCr color space
  • Human skin has a fairly narrow range of chrominance values, regardless of race. Check out this paper for the details.
  • The approach above will help you separate skin areas of the face from non-skin areas
  • Assume that the non-skin areas consist of hair. Note that facial hair will get picked up as a non-skin area, too.

就第二个问题而言,你需要通过删除明确说明你的意思:

As far as the second problem goes, you need to clarify exactly what you mean by "removing":


  • 你只是剪掉了有头发的肖像部分吗?在这种情况下,解决方案直接来自上面的检测方法。

  • 你是否试图使它看起来像一个人根本没有头发(例如是秃头,刮胡子?)在这种情况下,事情会变得更加困难 - 专业照片操纵者得到报酬的原因就在这里。

这篇关于在肖像图像中检测头发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆