Results 1 to 8 of 8
  1. #1
    farhanz2009 is offline Member
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Help with face detection Viola Jones Algorithm

    I'm currently working on a face detection project. And i read the Viola Jones algorithm. Which has a requirement of converting an image to integral image and it also has some features thing. I have been superly confused with what is this feature thing and how it works. If anyone can help it will be greatly appreciated. Kindly explain what are features and how they work.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: Help with face detection Viola Jones Algorithm

    How does your question relate to java programming?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    farhanz2009 is offline Member
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Re: Help with face detection Viola Jones Algorithm

    May be you can guide me to the best approach for face detection in java.. :/

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: Help with face detection Viola Jones Algorithm

    Can you explain the algorithm that you want to use. Given an array of pixels what do you want to do?
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    farhanz2009 is offline Member
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Re: Help with face detection Viola Jones Algorithm

    Look em currently working with YCbCr color model. I have taken rgb values of a pic and converted them to YCbCr. It works fine when em in front of a black background but it is not useful in complex backgrounds. Maybe it is because of the threshold values. Em giving you the code i want your help if you can suggest me correct threshold or the most effective one or some other way of face detection in java.
    Java Code:
      int wid = img.getWidth();
      int hei = img.getHeight();
      int [] arr1 = new int [3];
      arr1[0] = 0;
      arr1[1]=0;
      arr1[2]=0;
    int[] arr = new int[3];
    arr[0]  = 248;
    arr[1] = 248;
    arr[2] = 255;
      int[][] pixels = new int[wid][hei]; 
    	
    for(int i = 0; i<wid; i++)
    {
        for(int j = 0;j<hei;j++)
            { 
             
                pixels[i][j] = img.getRGB(i,j);
         
                int red = (((pixels[i][j]  >> 16) & 0xff));
                int green = (((pixels[i][j] >> 8) & 0xff));
                int blue = ((pixels[i][j] & 0xff));
      
               
                
                
                
                
                int[] y = new int[3];      
     y[0] =  (int) (((0.299*red)+(0.587*green)+(0.114*blue))+16);
    y[1] = (int) (((-0.169*red)+(-0.331*green)+(0.5*blue))+128);
     y[2] = (int) (((0.5*red)+(-0.419*green)+(-0.081*blue))+128);
    
           if((y[1]>80)&&(y[1]<120)&&(y[2]>133)&&(y[2]<173))
            
       img.getRaster().setPixel(i, j, arr);
           else
              img.getRaster().setPixel(i, j, arr1);
    Last edited by Norm; 03-24-2012 at 08:03 PM. Reason: added code tags

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: Help with face detection Viola Jones Algorithm

    can suggest me correct threshold
    define what a threshhold is.
    I'm not familiar with YCbCr

    What is the posted code supposed to do? It has a lot of hardcoded/undefined numbers in it. Those should all be used as named variables to help explain what they are being used for.
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    farhanz2009 is offline Member
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Re: Help with face detection Viola Jones Algorithm

    There is only one thing that is not properly defined here and that is img. It is an image which i capture by grabbing frame. A threshold converts image to white and black color in my case skin is marked as white and everything else is black. This code takes RGB values of given image and then convert it to Y "y[0]", Cb "y[1]", and Cr"y[2]". Ycbcr is widely used for skin detection. Is this information enough?

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: Help with face detection Viola Jones Algorithm

    What java programming questions do you have? Your discussion of threshold did not explain anything related to the code that you posted.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Geomajas GWT face 1.10.0
    By java software in forum Java Software
    Replies: 0
    Last Post: 02-05-2012, 06:31 PM
  2. Smiley Face
    By eppoair2 in forum Java Applets
    Replies: 6
    Last Post: 01-07-2012, 09:38 AM
  3. Face Dections CTS
    By rockos in forum Advanced Java
    Replies: 2
    Last Post: 09-17-2011, 09:40 AM
  4. Let's Check My Collision Detection Algorithm
    By Revenna in forum Java 2D
    Replies: 3
    Last Post: 03-23-2011, 02:44 PM
  5. Replies: 0
    Last Post: 09-01-2010, 05:31 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •