Created
January 22, 2013 13:17
-
-
Save walidvb/4594606 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Image RDC::compensate(const Image& srcImg) | |
{ | |
Image dstImg(srcImg.width, srcImg.height); | |
for (int i = 0; i < srcImg.width; i++) | |
{ | |
for (int j = 0 ; j < srcImg.height; j++) | |
{ | |
float newPix = 0; | |
//Simple fixed threshold method | |
if (srcImg.pixelAt(i,j) > 127) | |
{ | |
newPix = 255; | |
} | |
dstImg.pixelWrite(newPix, i, j); | |
//cout << dstImg.pixelAt(i,j) << " "; | |
} | |
//cout << endl; | |
} | |
return dstImg; | |
//TODO compensate #1 test with dummy matrix | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment