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
#2
Not an answer, but wouldn't you be better off asking on OpenCV forum?

They just concentrate on openCV.
Reply
#3
(Jan-10-2022, 11:31 PM)Pedroski55 Wrote: Not an answer, but wouldn't you be better off asking on OpenCV forum?

They just concentrate on openCV.

Thank you I'll do that!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Spyder console zoom in not working? Dionysis 2 550 Feb-06-2024, 03:31 PM
Last Post: paul18fr
  (OpenCV) Help to improve code for object detection and finding center of it saoko 0 1,270 May-14-2022, 05:34 PM
Last Post: saoko
  How to crop eyes/nose/mouth in the face only? [OpenCV] buzzdarkyear 0 2,241 Jan-11-2022, 01:41 PM
Last Post: buzzdarkyear
  Face detector project? korenron 2 2,181 Mar-24-2021, 03:43 PM
Last Post: korenron
  if statement follow up questions Nickd12 3 2,723 Sep-16-2020, 11:37 PM
Last Post: Nickd12
  Loop face landmarking in all folder using dlib lokoprof 5 3,025 Apr-17-2020, 10:08 AM
Last Post: deanhystad
  Defect Detection using OpenCV Ranganath 1 4,598 May-29-2019, 06:44 AM
Last Post: AzminaMokhtar
  pycharm face recognition mcgrim 5 8,568 May-20-2019, 05:06 PM
Last Post: Larz60+
  Functions to make an image zoom in until a response is made sawilliams 1 2,179 Aug-02-2018, 08:06 AM
Last Post: Larz60+
  Spyder IDE - make variable explorer to follow the color scheme of the Editor Antonio 0 5,538 May-05-2018, 10:20 PM
Last Post: Antonio

Forum Jump:

User Panel Messages

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