Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. cnts = contours.sort_contours(questionCnts[i:i+30])[0]
  2.  
  3. for (l ,k )in enumerate(cnts):
  4. (x, y, w, h) = cv2.boundingRect(k)
  5. if (w >= 20 and h >= 20) and (w <= 25 and h <= 25) and ar >= 0.7 and ar <= 1.3:
  6. box = [(x//5)*5, y]
  7. #print(x, y)
  8.  
  9. posicaoRespostas = np.append(posicaoRespostas,(l))
  10.  
  11. cv2.rectangle(bolhas, (x, y), (x+w, y+h), (0, 0, 255), 1) #desenho para visualização
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement