That might have been taken as 'put the code between [ and ]' rather than 'put the code between [code] and [/code]'.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 post appears to have the indentation included when replied to so ...this is my script:
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