检测脸部的眉毛 [EMGU CV/Open CV/C#]
我对 Emgu CV 很陌生,我已经完全测试了大多数代码,例如 Hough Lines / Canny Edge 检测和谷歌搜索的论文,但我仍然不知所措。
这就是我所做的
1) 使用 HaarCascading 检测正面 2)对人脸的特定区域进行分割(以减少误报并节省CPU功耗),并在指定区域检测眼睛、鼻子、嘴巴。
我想做的也是检测眉毛。我找不到眉毛的 HaarCascades,我可以在上面附加一个特定区域来扫描眉毛。我已经测试了 Hough Lines 和 Canny Edge,但我无法让它检测眉毛(它正在将我脸部的其他部分检测为线条)。
Gray cannyThreshold = new Gray(255);
Gray cannyThresholdLinking = new Gray(0);
图像
Image
LineSegment2D[] lines = cannyEdges.HoughLines(
cannyThreshold,
cannyThresholdLinking,
1, //Distance resolution in pixel-related units
Math.PI / 45.0, //Angle resolution measured in radians.
1, //threshold
10, //min Line width
3 //gap between lines
)[0]; //Get the lines from the first channel
List<MCvBox2D> boxList = new List<MCvBox2D>();
foreach (LineSegment2D line in lines)
{
frame.Draw(line, new Bgr(Color.Green), 2);
}
我对 EMGU CV 很陌生,并且已经在眉毛检测上工作了几周 - 有人可以建议我如何能够做到这一点吗?
非常感谢任何帮助或建议。 :)
I am quite new to Emgu CV and I have absolutely tested out most of the codes such as Hough Lines / Canny Edge detection and googled papers but I am still at a loss.
This is what I've done
1) Detect a frontal face with HaarCascading
2) Break specific regions of the face (to prevent less false positives and save CPU power) , and detect eyes, nose, mouth at the specified region.
What I want to do is also detect eyebrows. I cannot find HaarCascades for eyebrows and I can append a specific region to the above, to scan for eyebrow. I have tested out Hough Lines and Canny Edge, but I cannot get it to detect the brows (it is detecting some other parts of my face as lines).
Gray cannyThreshold = new Gray(255);
Gray cannyThresholdLinking = new Gray(0);
Image<Gray, Byte> gray = grayFrame.Convert<Gray, Byte>().PyrDown().PyrUp();
Image<Gray, Byte> cannyEdges = gray.Canny(cannyThreshold, cannyThresholdLinking);
LineSegment2D[] lines = cannyEdges.HoughLines(
cannyThreshold,
cannyThresholdLinking,
1, //Distance resolution in pixel-related units
Math.PI / 45.0, //Angle resolution measured in radians.
1, //threshold
10, //min Line width
3 //gap between lines
)[0]; //Get the lines from the first channel
List<MCvBox2D> boxList = new List<MCvBox2D>();
foreach (LineSegment2D line in lines)
{
frame.Draw(line, new Bgr(Color.Green), 2);
}
I am quite new to EMGU CV and have worked on this eyebrow detection for a few weeks - can anybody kindly advise how I can be able to do this?
Will greatly appreciate any help or advice. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Hough Lines 和 Canny Edge 对于眉毛实际上没有任何好处,并且没有用于眉毛的 Haar 检测器。您可以尝试自己制作,但这不是一个建议的方法。通过检测图像中的眼睛,您已经完成了大部分工作。您现在可以采取的最佳方法是从彩色图像中的每只眼睛上方获取 ROI。然后使用颜色分析来检测眉毛。从这个 ROI 中,您应该能够检测到每个角落的皮肤颜色。
使用此数据,您可以扫描此 ROI 以及任何不在阈值范围内的数据,例如值的 ± 10%,那么您可以将其视为眉毛数据。显然,这需要一些尝试才能发挥作用。尝试不同的图像类型(例如 HSV 方式)可以提高准确性。
如果您需要有关代码的任何帮助,请告诉我,我将为您整理一个示例。我回答了一个类似的问题,关于在opencv中分割脸部和颈部的皮肤,这可能是一个很好的参考。 EmguCV 仅切割面部+颈部皮肤并保存新皮肤图片
我希望这有帮助,
干杯,
克里斯
Hough Lines and Canny Edge are not really any good for eyebrows and there is no Haar detector for eyebrows. You could try making your own but this would not be a suggestible approach. You have done a good portion of the work by detecting the eyes within the image. The best approach you can take now is to take an ROI above each eye from the colour image. Then use colour analysis to detect the eyebrows. From this ROI you should be able to detect the colour of the skin say from each corner.
Using this data you can scan this ROI and any data that is not within a threshold say +- 10% in values then you could consider this to be eyebrow data. Obviously this will need a little playing with to make work. Trying different image types such as HSV way increase accuracy.
If you need any help with the code let me know and I'll sort an example out for you. I answered a similar question on segmenting the skin of the face a neck in opencv which might be good reference. EmguCV Cut Face+Neck Skin Only And Save New Image
I hope this helps,
Cheers,
Chris