使用Emgu裁剪图像 [英] Crop an image with Emgu
问题描述
尊敬的专家,
我正在尝试使用emgu制作面部检测的表格申请表。我的目的是用网络摄像机拍摄一个人的照片,检测面部坐标并裁剪图像,使得检测到的面部总是与图像边缘的比例和位置相同。基本上是一张文档图片,我总是可以在同一个地方放置面部图像,这样我就可以将面部安装在另一个图像上。
我用python和opencv制作它(使用getsubrect)但不知道如何使用emgu。
Dear experts,
I´m trying to make a form application for face dtection with emgu. My purpose is to take a picture of a person with the web camera, detect the face coordinates and crop the image in such a way that the detected faces be always in the same proportion and position with respect of the picture edges. Basically is a document picture where I can always have the face image in the same place so I can mount the face over another image.
I made it with python and opencv (with getsubrect)but don't know how to do it with emgu.
if detectedFace:
arg1 = detectedFace[0][0][0]
arg2 = detectedFace[0][0][1]
arg3 = detectedFace[0][0][2]
arg4 = detectedFace[0][0][3]
Izq = arg1 - arg3/10
Sup = arg2 - arg4/4
Der = arg3 + (arg3/5)
Inf = arg4 +(arg4/2)
destino = ('C:\\temp\\camera-test-cut.jpg')
imagen = cv.GetSubRect(imcolor,(Izq, Sup, Der, Inf))
cv.SaveImage(destino, imagen)
在emgu tutotial的帮助下,我已经能够捕获相机并检测到脸部,但无法裁剪图像。任何消化?
谢谢。
With the help of emgu tutotial I have been able to capture the camera and detect the face but can't crop the image. Any sugestion?
Thanks.
推荐答案
参见..
< a href =http://matheeid.blogspot.com/2012/10/to-crop-selected-area-from-image-usign.html> http://matheeid.blogspot.com/2012/10/to -crop-selected-area-from-image-usign.html [ ^ ]
http://stackoverflow.com/questions/6516573/how-to-cut-a-sub-part-图像使用-emgu-cv-or-opencv [ ^ ]
http://stackoverflow.com/questions/9477602/how-to-crop-image-without-changing -The -aspect-ratio [ ^ ]
http://friism.com/webcam-face-detection-in-c-using-emgu-cv [ ^ ]
See..
http://matheeid.blogspot.com/2012/10/to-crop-selected-area-from-image-usign.html[^]
http://stackoverflow.com/questions/6516573/how-to-cut-a-sub-part-of-an-image-using-emgu-cv-or-opencv[^]
http://stackoverflow.com/questions/9477602/how-to-crop-image-without-changing-the-aspect-ratio[^]
http://friism.com/webcam-face-detection-in-c-using-emgu-cv[^]
这篇关于使用Emgu裁剪图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!