Python Forum
How to zoom on/follow MOUTH in FACE? (OPENCV Face Detection)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to zoom on/follow MOUTH in FACE? (OPENCV Face Detection)
#1
When I only detect the face the camera zoom on the face and follows it. But when I want to detect & zoom/follow the mouth it doesn't.

Mouth detection only work when the face is detected first so I can't just detect only the mouth as I could detect the face.

So this works:

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
face = face_cascade.detectMultiScale(gray, scaleFactor=SCALE_FACTOR, minNeighbors=MIN_NEIGHBORS, minSize=MINSIZE, )
boxes = np.array(face)
But this doesn't:

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
face = face_cascade.detectMultiScale(gray, 1.3, 15)
for (x, y, w, h) in face:
   roi_gray = gray[y:y + w, x:x + w]
   mouth = mouth_cascade.detectMultiScale(roi_gray, scaleFactor=SCALE_FACTOR, minNeighbors=MIN_NEIGHBORS, minSize=MINSIZE,)
   boxes = np.array(mouth)
What is the problem? How do I make this work?? How will I be able to detect the mouth and zoom/follow it? Any help or tips are welcome!

Main.py(full code):
https://raw.githubusercontent.com/kailau...in/main.py

Frame.py:
https://raw.githubusercontent.com/kailau...n/Frame.py
Reply


Messages In This Thread
How to zoom on/follow MOUTH in FACE? (OPENCV Face Detection) - by buzzdarkyear - Jan-10-2022, 11:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with Zoom Python venpa 1 968 Jan-09-2025, 09:21 PM
Last Post: deanhystad
  Art Project including face detection, screenshot and Face TEXTURE MAP ecaillerose 1 887 Oct-15-2024, 01:55 PM
Last Post: DPaul
  Face detector project? korenron 5 3,777 Jul-24-2024, 08:32 AM
Last Post: jamesmartinsjtdd
  Spyder console zoom in not working? Dionysis 2 1,753 Feb-06-2024, 03:31 PM
Last Post: paul18fr
  (OpenCV) Help to improve code for object detection and finding center of it saoko 0 2,202 May-14-2022, 05:34 PM
Last Post: saoko
  How to crop eyes/nose/mouth in the face only? [OpenCV] buzzdarkyear 0 3,342 Jan-11-2022, 01:41 PM
Last Post: buzzdarkyear
  if statement follow up questions Nickd12 3 3,825 Sep-16-2020, 11:37 PM
Last Post: Nickd12
  Loop face landmarking in all folder using dlib lokoprof 5 4,917 Apr-17-2020, 10:08 AM
Last Post: deanhystad
  Defect Detection using OpenCV Ranganath 1 5,331 May-29-2019, 06:44 AM
Last Post: AzminaMokhtar
  pycharm face recognition mcgrim 5 10,305 May-20-2019, 05:06 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020