Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public long[] GetHistogram(Bitmap picture)
- {
- long[] myHistogram = new long[256];
- for (int i = 0; i < picture.Size.Width; i++)
- {
- for (int j = 0; j < picture.Size.Height; j++)
- {
- Color c = picture.GetPixel(i, j);
- long Temp = 0;
- Temp += c.R;
- Temp += c.G;
- Temp += c.B;
- Temp = (int)Temp / 3;
- myHistogram[Temp]++;
- }
- }
- return myHistogram;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement