CodePudding user response:
Double GetGrayAverage (Bitmap BMP, int w, int h)
{
Double sum=0;
Use the average value of the//
for (int i=0; I & lt; w; I++)
For (int j=0; J & lt; H; J++)
{
Color=c BMP. GetPixel (I, j);
Sum=sum + (int) (0.299 * c.R be sad) chtistina georgina rossetti.british poetess mount + 0.114 + 0.587 * *;
}
Double aver=sum/(w * h);
Return aver.
}