I want to display the values in the loaded 8 bit image for code analysis purpose and find that the loaded image has no values?
I have the following primary lines to help me:
#define CHANNEL_NUM 1
int width, height, bpp;
uint8_t* image = stbi_load("FTTESTGS.bmp", &width, &height, &bpp, CHANNEL_NUM);
if (image == NULL) {printf("Error in loading the image\n");}
size_t n = sizeof(image) / sizeof(image[0]);
std::cout << "The size is " << n << '\n';
for (size_t i = 0; i < n; i++) {std::cout << image[i];}
std::cout << '\n' << "The largest element is " << *std::max_element(image, image + width * height) << '\n';
It compiles. No errors. My output is unfortunately showing me size of 8, no values, and the largest element is nothing.
The size is 8
The largest element is
I am not sure where the problem lays. Any suggestions are welcomed! Here's a screenshot of the code: