Is there a better way to rewrite this part in python. It doesnot have to be shorter as long as its much better. thanks in advance
count = 1
while count < 10:
_, pho = webcam.read()
gr = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
images = face_cascade.detectMultiScale(gr, 1.3, 4)
for (x,y,w,h) in faces:
cv2.rectangle(pho,(x,y),(x+w,y+h),(0,255,0),2)
fa = gray[y:y + h, x:x + w]
e_size = cv2.resize(fa, (100, 100))
cv2.imwrite('%s/%s.JPEG' % (folder,count), e_size)
count += 1
cv2.imshow('OpenCV', pho)
key = cv2.waitKey(20)