Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8026

Python • Re: python

$
0
0
If you choose to post your script here please be sure to make use of the [ CODE ] tag markup provided by the forum software.
That might have been taken as 'put the code between [ and ]' rather than 'put the code between [code] and [/code]'.
this is my script:
That post appears to have the indentation included when replied to so ...

Code:

import cv2face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')cap = cv2.VideoCapture(0)  # 0 je zvyčajne predvolený index pre hlavnú kameruwhile True:    ret, frame = cap.read()    if not ret:        break    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)    faces = face_cascade.detectMultiScale(gray, 1.1, 4)    for (x, y, w, h) in faces:        cv2.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)      cv2.imshow('Video', frame)     if cv2.waitKey(1) & 0xFF == ord('q'):        breakcap.release()cv2.destroyAllWindows()]

Statistics: Posted by hippy — Sat Apr 20, 2024 7:56 pm



Viewing all articles
Browse latest Browse all 8026

Trending Articles