I have code that detects a face. All I want to do is save the detected face as a jpg
Here is the code f
import cv2 as cv
import numpy as np
from cvzone.FaceDetectionModule import FaceDetector
from cvzone.FaceMeshModule import FaceMeshDetector
cap = cv.VideoCapture(0)
detector = FaceDetector()
meshdetector = FaceMeshDetector(maxFaces=3)
while(True):
rec, frame = cap.read()
frame, bbox = detector.findFaces(frame)
print(bbox)
print(type(bbox))
print("------------------------")
frame, faces = meshdetector.findFaceMesh(frame)
cv.imshow('frame', frame)
keyexit = cv.waitKey(5) & 0xFF
if keyexit == 27:
break
cv.destroyAllWindows()
cap.release()
How do I save the detected face? Please help!