[BangPypers] how to see each line result in python
narayan naik
narayannaik.05 at gmail.com
Tue Mar 3 14:20:05 CET 2015
hi,
i have face detection code as
import cv2
import sys
def detect(path):
img = cv2.imread(path)
cascade =
cv2.CascadeClassifier("/home/nv/haarcascade_frontalface_alt.xml")
rects = cascade.detectMultiScale(img, 1.3, 4,
cv2.cv.CV_HAAR_SCALE_IMAGE, (20,20))
if len(rects) == 0:
return [], img
rects[:, 2:] += rects[:, :2]
return rects, img
def box(rects, img):
for x1, y1, x2, y2 in rects:
cv2.rectangle(img, (x1, y1), (x2, y2), (127, 255, 0), 2)
#cv2.imwrite('/home/nv/m.JPG', img);
rects, img = detect("/home/nv/img.JPG")
box(rects, img)
cv2.imshow('img',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
#crop_img=image(rects, img)
#cropped.save('L_2d_cropped.jpg')
I want to see what happens in each line.I know what happens in
theoritically but i want each line result.is i possible.
please help me.
thank you in advance
More information about the BangPypers
mailing list