1

I have developed an app for image comparison. here i am comparing colors. the reference chart is in the database. the working of my app is like.. Capturing the colors by camera . camera is controlled by camera API not intent. and the captured image is compared with the reference chart. My problem is LIGHT. and I am capturing the image in a white background.. but according to Light change the output is heavily varying. i am using euclidean distance. by Light variation i couldnt getting the correct output. Has anyone have any sugg: to solve the light problem.?? is there any method for normalizing image.?? im using android 2.2

Nisha
  • 95
  • 2
  • 9

2 Answers2

0

Maybe You could use some open Source Image processing libraries hat provides convenient options for image comparisions.

I would suggest you to use OpenCV which has numerous image manipulation functions and you can easily integrate it with android.

OpenCV

May be this could help you in solving the light problems.

Sanober Malik
  • 2,765
  • 23
  • 30
0

IF you facing the light background then i suggest to use ARBB value of all pixel of both image , you can compare ARGB values of both image , i have recently gone through this task in my one project . here is small code from it .

  • that method will give you average ARGB color of image .
  • after having set of average value of both image you just simply compare as two Collection comparison
private int[] getAvgARGB(int[] imagePixels ){
      int [] argbColection  = new int[4];
      int pixcel=0 , Aavg=0 ,Ravg =0, Gavg=0 ,Bavg=0 ;
      int pixcelSize  = 0 ; 
      for(int i = 0 ; i<imagePixels.length; i++){
          pixcel = imagePixels[i];  //get pixel value (ARGB)
          int A = (pixcel >> 24) & 0xFF; //Isolate Alpha value...
              int R = (pixcel >> 16) & 0xFF; //Isolate Red Channel value...
              int G = (pixcel >> 8) & 0xFF; //Isolate Green Channel value...
              int B = pixcel & 0xFF; //Isolate Blue Channel value...
              Aavg += A ;
              Ravg += R ;
              Gavg += G ;
              Bavg += B ;
        }
   pixcelSize = imagePixels.length ;  

   argbColection[0] = Aavg/pixcelSize ;
   argbColection[1] = Ravg/pixcelSize ; 
   argbColection[2] = Gavg/pixcelSize ;
   argbColection[3] = Bavg/pixcelSize ;

   return argbColection ;
}
dharmendra
  • 7,835
  • 5
  • 38
  • 71