Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8187977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:44:53+00:00 2026-06-07T02:44:53+00:00

I am trying to make a face detection software using OpenCV 2.3.0. While OpenCV

  • 0

I am trying to make a face detection software using OpenCV 2.3.0. While OpenCV 2.4 has the face recognizer class 2.3.0 is devoid of this feature. I checked the documentation and is specifies that the detectMultiScale function has the following declaration

void CascadeClassifier::detectMultiScale(const Mat& image, vector<Rect>& objects, double      
scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size())

Now I am giving the image, that is the camera feed, but don’t know what to fill in vector block.
Here is the code that I have written.

#include "cv.h"
#include "highgui.h"
#include <stdio.h>
#include<iostream>

using namespace cv;
using namespace std;

int main()
{
    std::vector<Rect> faces;
    VideoCapture cap(0);

    if(!cap.isOpened())
        cout<<"Camera is not connected"<<endl;
    cv::CascadeClassifier* cascade=0;
    if(cascade.empty())
        return -1;
    Mat edges;
    namedWindow("Camera Feed",1);
    for(;;)
    {
        Mat frame;
        cap >> frame;
        imshow("Camera Feed", frame);
        if(waitKey(10)==27)
            break;
        cascade.detectMultiScale(frame,faces);
    }
    return 0;
}

Question: How to proceed further?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:44:54+00:00Added an answer on June 7, 2026 at 2:44 am

    go through Docs OpenCV. check here for detail example

    void detectAndDisplay( Mat frame )
    {
      std::vector<Rect> faces;
      Mat frame_gray;
    
      cvtColor( frame, frame_gray, CV_BGR2GRAY );
      equalizeHist( frame_gray, frame_gray );
    
      //-- Detect faces
      face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) );
    
      for( int i = 0; i < faces.size(); i++ )
      {
        Point center( faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5 );
        ellipse( frame, center, Size( faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 );
    
        Mat faceROI = frame_gray( faces[i] );
        std::vector<Rect> eyes;
    
        //-- In each face, detect eyes
        eyes_cascade.detectMultiScale( faceROI, eyes, 1.1, 2, 0 |CV_HAAR_SCALE_IMAGE, Size(30, 30) );
    
        for( int j = 0; j < eyes.size(); j++ )
         {
           Point center( faces[i].x + eyes[j].x + eyes[j].width*0.5, faces[i].y + eyes[j].y + eyes[j].height*0.5 );
           int radius = cvRound( (eyes[j].width + eyes[j].height)*0.25 );
           circle( frame, center, radius, Scalar( 255, 0, 0 ), 4, 8, 0 );
         }
      }
      //-- Show what you got
      imshow( window_name, frame );
     }
    

    hope this will help you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a hand detection program by using OpenCV and Haar cascade.
I'm trying make an entity with doctrine that has three associations with other entities
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to make a simple number clicker control for BlackBerry 6/7, like this: At
I am trying to implement face recognition on camera captured faces.In order to make
Using the vs2008 query builder, I’m trying to make a query that gets a
I am trying to develop an iPhone for Face recognition/detection. In my app i
I`m trying to make a music streaming server using VLC and the VLM manager.
I'm trying to make my first android game and to do this I made
I'm trying to make a copy of MineCraft in Java using OpenGL (LWJGL). The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.