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

  • SEARCH
  • Home
  • 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 7518445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:45:05+00:00 2026-05-30T01:45:05+00:00

I am trying to do face detection on android, and I am following the

  • 0

I am trying to do face detection on android, and I am following the guide http://www.richardnichols.net/2011/01/java-facial-recognition-haar-cascade-with-jjil-guide/

but on android instead. When i do

Gray8DetectHaarMultiScale detectHaar = new Gray8DetectHaarMultiScale(is, minScale, maxScale);
RgbAvgGray toGray = new RgbAvgGray();
toGray.push(RgbImage);
detectHaar.pushAndReturn(toGray.getFront());

It seems that pushAndReturn is only returning one face from the image on Android although the exact code returns 2 faces using the netbeans code. The difference is only in the type of the image (RgbImage on android and RgbImageJ2se on netbeans)

I don’t know what i m missing and why i can’t detect more than one face on Android ?

I am using JJIL so i mean by RgbImage: jjil.core.RgbImage type, vs. RgbImageJ2SE type. The rest is just the same!! it seems that pushAndReturn is only returning one entry in the stack. This does not work on any image with more than one face.

  • 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-05-30T01:45:06+00:00Added an answer on May 30, 2026 at 1:45 am

    Go for this its working and detecting all faces from a given picture

        public class AndroidFaceDetector extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            //setContentView(R.layout.main);
            setContentView(new myView(this));
        }
    
        private class myView extends View{
    
         private int imageWidth, imageHeight;
         private int numberOfFace = 5;
         private FaceDetector myFaceDetect; 
         private FaceDetector.Face[] myFace;
         float myEyesDistance;
         int numberOfFaceDetected;
    
         Bitmap myBitmap;
    
    
        public myView(Context context) {
       super(context);
       // TODO Auto-generated constructor stub
    
       BitmapFactory.Options BitmapFactoryOptionsbfo = new BitmapFactory.Options();
       BitmapFactoryOptionsbfo.inPreferredConfig = Bitmap.Config.RGB_565; 
       myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.face5,   
          BitmapFactoryOptionsbfo);
       imageWidth = myBitmap.getWidth();
       imageHeight = myBitmap.getHeight();
       myFace = new FaceDetector.Face[numberOfFace];
       myFaceDetect = new FaceDetector(imageWidth, imageHeight, numberOfFace);
       numberOfFaceDetected = myFaceDetect.findFaces(myBitmap, myFace); 
    
      }
    
      @Override
      protected void onDraw(Canvas canvas) {
       // TODO Auto-generated method stub
    
                canvas.drawBitmap(myBitmap, 0, 0, null);
    
                Paint myPaint = new Paint();
                myPaint.setColor(Color.GREEN);
                myPaint.setStyle(Paint.Style.STROKE); 
                myPaint.setStrokeWidth(3);
    
                for(int i=0; i < numberOfFaceDetected; i++)
                {
                 Face face = myFace[i];
                 PointF myMidPoint = new PointF();
                 face.getMidPoint(myMidPoint);
        myEyesDistance = face.eyesDistance();
                 canvas.drawRect(
                   (int)(myMidPoint.x - myEyesDistance),
                   (int)(myMidPoint.y - myEyesDistance),
                   (int)(myMidPoint.x + myEyesDistance),
                   (int)(myMidPoint.y + myEyesDistance),
                   myPaint);
                }
      }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying face detection using opencv in android but I unable to load the
I am trying to do some Face Recognition (not detection) stuff using OpenCV. I
I'm trying to make a hand detection program by using OpenCV and Haar cascade.
I am trying to use CoreImage's face detection in iOS 5 but it is
I am trying to implement face recognition on camera captured faces.In order to make
I'm trying to build an application for android tablets that uses androids new face
I'm trying to implement the Viola Johns face detection algorithm on Cuda platform (I'm
I'm trying to get better understanding over the Face detection implementation by openCV. I
I am currently trying to find the face in a particular image.I am following
I am trying to learn python, the guide I am following is asking me

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.