Ask Your Question

Revision history [back]

in here I get error for roi it is 'inconsistent use of tabs and spaces in indentation '

import numpy as np import cv2

face_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_frontalface_alt2.xml')

cap = cv2.VideoCapture(0)

while(True):

ret,frame = cap.read()
gray  = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray, scaleFactor=1.5, minNeighbors=5)
for (x, y, w, h) in faces:
    print(x,y,w,h)
    roi

cv2.imshow('frame',frame)
if cv2.waitKey(20) & 0xFF == ord('q'):
    break

cap.release() cv2.destroyAllWindows()

in here I get error for roi it is 'inconsistent use of tabs and spaces in indentation '

Code:

import numpy as np
import cv2

cv2 face_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_frontalface_alt2.xml')

face_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_frontalface_alt2.xml')

cap = cv2.VideoCapture(0)

cv2.VideoCapture(0) while(True):

while(True):

 ret,frame = cap.read()
 gray  = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
 faces = face_cascade.detectMultiScale(gray, scaleFactor=1.5, minNeighbors=5)
 for (x, y, w, h) in faces:
     print(x,y,w,h)
     roi

 cv2.imshow('frame',frame)
 if cv2.waitKey(20) & 0xFF == ord('q'):
     break

cap.release()
cv2.destroyAllWindows()

cap.release() cv2.destroyAllWindows()