如何给图像添加效果
我是图像处理领域的新手。我想知道如何使用 EmguCV 或任何其他技术向图像添加效果。就像 Microsoft LifeCam 一样。(例如,在头上显示帽子、在头上显示名字等。 )
请帮忙,提前致谢。
更新::我现在正在使用代码
人脸识别x86
,因为我使用函数 currentFrame.Draw(...) 来绘制图像。 现在我想添加新的位图图像与当前图像,但它向我显示了异常。
OpenCV: The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array'
所以我将用图像 myimg.Add() 做的任何事情
I am new to the image processing.I want to know that how i can add the effects to the image using EmguCV or any other technique.Just like Microsoft LifeCam.(ex. showing hat on the head,showing name on the head etc.)
Please help,thanks in advance.
Update::I am now working with the code
face recognition x86
in that i am using the function currentFrame.Draw(...) to drow the image.
now i want to add the new bitmap image with the current image but it showing me the exception.
OpenCV: The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array'
So anything which i will do with the Image myimg.Add()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读文档是一个好的开始。
我使用了 Emgu CV,有一个面部检测模块,它返回人脸的矩形。 (Haar Cascades)
一旦获得该信息,就可以轻松地将图形放置在图像顶部相对于脸部的位置。
该库还支持眼睛检测,因此您可以使用与上述相同的方法在眼镜上绘图。
它非常容易使用,而且文档也非常好,所以我会从这里开始。
更新:
我找到了我使用的代码(Emgu CV),它可以检测图像中的每张脸并返回一个矩形列表及其位置。 (请原谅任何较差的代码质量)
您还需要调整参数以满足您的需求。
A good start would be to read the documentation.
I have used Emgu CV and there is a face detection module, which returns the Rectangle of the persons face. (Haar Cascades)
Once you have that information it would be easy to position a graphic on top of the image in a location relative to the face.
The library also supports eye detection so you could draw on glasses using the same method as above.
It's very easy to use and the documentation is excellent so I would start there.
Update:
I found the code I used (Emgu CV) which detects every face in an image and returns a list of rectangles with their locations. (please excuse any poor code quality)
You will also need to tweak the parameters to suit your needs.