Following the pattern of the 15 patterns of visual perception, one
wants to categorize images based on that. But it will be difficult
to put a lot of the images in that pattern, namely since the image
variability in terms of color is usually, in real life pictures,
high. Therefore we introduce a different index that assimilates the
degree of dominance of any color in each of the four quandrants.
Usually again there will be small or weak dominance since there will
be a lot of colors.
But if we denote l1, l2, ln as the sequence of colors in a
quadrant, in order sequence, then the degree of dominance is
if(i==j) meas[1]=1; else meas[1]=(xy[j]-xy[i])/(l*wc*hc/4.);
xy[j] is the highest non-and xy[i] is the lowest non-zero
color.
We use reduction in the XY space where the x-y
chromaticities are measured in a n1xn1 quoantized space
the color then is x+n1*y
this doesn't count the continuity of color that is if the
colors of the same value bunch up together in the same space or are
distributed around.
l is the number of non-zero colors found on that square
low values mean a lot of different colors of little variability
1 means there is only one color
colors with high variability will reflect into high values of the
measure
The complete algorithm is as follows:
int[] pix=bim.getRGB(0, 0, wc, hc, null, 0, wc);
int n1=10, n2=n1*n1;
int[][] XY=new int[n1][n1];
int[] pix2=computeXYColor(pix, XY);
int[] xy=new int[n2], indx=new int[n2];
for(i=0; i
i=0;
while(xy[i]==0) i++;
j=xy.length-1;
while(xy[j]==0) j--;
double[] meas=new double[4];
l=0;
m=0;
while(m
where
public int[] computeXYColor(int[] pixels, int[][] xyArray) {
int i, j;
double red, green, blue, Z, X, Y;
int[] pix=new int[pixels.length];
for (j=0; j
green=(pixels[i]&0x0000ff00)>>8;
blue=pixels[i]&0x000000ff;
X = (0.607*red) + (0.174*green) + (0.200*blue);
Y = (0.299*red) + (0.587*green) + (0.114*blue);
Z = (0.066*green) + (1.111*blue);
if((X+Y+Z)!=0) {
X = X/(X+Y+Z);
Y = Y/(X+Y+Z);
}
else X=Y=0;
pix[i]=(int)(xyArray.length*X)+xyArray.length*((int)(xyArray[0].length*Y));
// System.out.println(red+" "+blue+" "+green+" "+X+" "+Y+" "+pix[i]);
}
return pix;
}
Here are some examples of a known tv show
the measures are
[0.05666280864197531, 0.014199074074074074, 0.013543669871794872, 0.012049305555555556]
[0.016871843434343434, 0.013857159961685824, 0.014730179398148148, 0.015558619281045752]
[0.05359375, 0.012198275862068966, 0.043934461805555554, 0.010064380787037037]
[0.009635416666666667, 0.0063762626262626266, 0.008587319958847737, 0.015591613247863248]
[0.017122189153439153, 0.011901276276276277, 0.007659313725490196, 0.006080142642642642]
they have been amped by 10 to show some color otherwise it would be too dark to differentiate
most images fall into pattern 15; and wouldn't you know it
Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου