Ask Your Question

Revision history [back]

The proper intensity value was able to be accessed with the .at() function once the proper object types were used. In this case, and unsigned char object was being assigned to a char object.

"The typical effect (for almost every C++ compiler you'll use) is that 0-128 is the same, but anything above that becomes negative." -Tetragramm

Once the conversion was from uchar directly to int, instead of uchar to char to int, the expected 0-255 range of intensities were observed.

unsigned char g = image.at<uchar>(center); int r = int(g); cout << "r: " << r << endl;

Special Thanks to Tetragramm for helping resolve the issue.

-Rowan