CImage i; unsigned char gray[1000][1000]; i.Load(_T("1.jpg")); for(int x=0;x<i.GetWidth();x++){ for(int y=0;y<i.GetHeight();y++){ COLORREF color=i.GetPixel(x,y); int ave=(GetRValue(color)+GetGValue(color)+GetBValue(color))/3; gray[x][y]=ave; } }
avarage
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)