Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.

VB
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)



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.
Posted
Updated 11-Dec-19 21:55pm
Comments
Sergey Alexandrovich Kryukov 6-Jun-13 16:40pm    
What is that language you are showing?
—SA
dlinaresg 6-Jun-13 18:27pm    
Python.
Sergey Alexandrovich Kryukov 6-Jun-13 18:29pm    
Ah... OK, thank you for answering. Such things are good to tag or specify when asking a question...
—SA

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900