Ask Your Question

eliaz's profile - activity

2015-06-09 11:31:25 -0600 answered a question Help! Show coordinates face detection

i found the answer, thanks!

2015-06-01 11:16:31 -0600 commented question Help! Show coordinates face detection

i am using other code, do you can help me?

2015-06-01 11:15:08 -0600 received badge  Editor (source)
2015-05-29 20:34:17 -0600 commented question Help! Show coordinates face detection

HI berak, I searched info in many websites and tutorial, the code is correct run, does not it the problem, the problem is find the coordenates of each rectangle, and calculate the distance between each rectangle, after, use conditional ( if distancia(rectangle1 and rectangle2<= "n pixel") print, "face together" n= measure selected for the user, do you can help me with that function? thanks

2015-05-29 11:23:11 -0600 asked a question Help! Show coordinates face detection

Hi! i need calculate the distance between two o more faces (the faces are inside rectangle, because i am using facedetection code in python), and if two or more faces are together(rectangles together) then print " faces together". if(distance(face1 and face2)<= "n" pixel) {print "faces together"} #n = your calibrate distance. I do not know how translate this order to python language, somebody can help me? Thanks. this is the code:

i am using other code with opencv 2.4.9, this code:

#Ejemplo de deteccion facial con OpenCV y Python
#Por Glare
#www.robologs.net

import numpy as np
import cv2

#cargamos la plantilla e inicializamos la webcam:
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml')
cap = cv2.VideoCapture(0)

while(True):
#leemos un frame y lo guardamos
ret, img = cap.read()

#convertimos la imagen a blanco y negro
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
#buscamos las coordenadas de los rostros (si los hay) y
#guardamos su posicion
faces = face_cascade.detectMultiScale(gray, 1.3, 5)

#Dibujamos un rectangulo en las coordenadas de cada rostro
for (x,y,w,h) in faces:
    cv2.rectangle(img,(x,y),(x+w,y+h),(125,255,0),2)


#Mostramos la imagen
cv2.imshow('img',img)

#con la tecla 'q' salimos del programa
if cv2.waitKey(1) & 0xFF == ord('q'):
    break
cap.release()
cv2-destroyAllWindows()