|
|
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[WM]: Problems understanding this algorithm...
i am trying to do a watermarking on image, i facing
some problems in image processing...
*******************************************************
public static int[] extractGreyValues(int pixels[])
{
// int pixels[] = extractPixelValues(image,ob);
/* int alpha=0;*/
int newClr =0;
int [] clr = new int [NO_OF_CHANNEL];
newClr =(int) (0.2125*(double)clr[ImageData.RED] +
0.7154*(double)clr[ImageData.GREEN] + 0.0721*
double)clr[ImageData.BLUE]) ;
for (int k = 0; k < pixels.length; k++)
{
// red = clr = extractColourValue(pixels[k]);
/*uses ITU-R Recommendation BT.709, "Basic Parameter
Values for the Studio and for International Programme
Exchange (1990) [formerly CCIR Rec.709]*/
newClr =(int) (0.2125*(double)clr[RED] + 0.7154*(double)clr[GREEN] +
0.0721*(double)clr[BLUE]) ;
pixels[k] = 0xff000000 | (newClr << 16) |
(newClr << 8) | (newClr);
}
return pixels;
}
******************************************************
CAn anyone explain to me how is it working here:
******************************************************
newClr =(int) (0.2125*(double)clr[RED] + 0.7154*(double)clr[GREEN] +
0.0721*(double)clr[BLUE]) ;
pixels[k] = 0xff000000 | (newClr << 16) |
(newClr << 8) | (newClr);
******************************************************
Thanks.
From:Siang
______________________________________________________________________________
Watermarking Mailing List - http://www.watermarkingworld.org/ml.html
To unsubscribe send email to "majordomo@watermarkingworld.org" with
"unsubscribe watermarking YOURMAIL" in the body.
______________________________________________________________________________
|