I have a program that compresses an image by blurring out everything outside of a circular area, how would I verify that this circular region has been unaltered? I'm using JasPer and CImg libraries.
Printable View
I have a program that compresses an image by blurring out everything outside of a circular area, how would I verify that this circular region has been unaltered? I'm using JasPer and CImg libraries.
Is your image file format a lossy compression like .JPG, in which case you're hosed.
Or is it a loss-less compression like .PNG, in which case, you could say XOR both images together and see if you end up with a big black circle.
I wrote a super detailed post but this forum logged me out when i hit reply, when i went back it was gone (god damnit).
jp2 allows you to do lossless compression on a specified area of a picture. I have an 'area of interest' in a .tif image that gets the lossless compress (jp2 guarantees lossless but I need to have a program that also demonstrates this). Everything outside of the area of interest gets a lossy compression. I have two nested for loops that loop through each pixel in the image and I get the same value for each (even though the pixels have different values in the pictures. Here is the list of all commands, see the section for image information (about 1/6th down the page). I think they way I'm supposed to check the value of a pixel is by using img(x,y), where img is the image using their class, x and y specify the coordinate of the pixel. I am not sure I'm using this correctly. According to their documentation its supposed to return T & type. img(x,y) produces the same result as img.at(x,y). How would I get the value of a pixel in an image. I'm having trouble understand their library, perhaps someone could enlighten me, there is not much reading - the hard part is making sense of it. They give the following example:
CImg<float> img(100,100,1,1,0); // Define a 100x100 greyscale image
float *ptr = ptr(10,10); // Get a pointer to the pixel located at (10,10).
float val = *ptr; // Get the pixel value.
How can they have a ptr and a function with the same name? Perhaps they made a mistake and meant to write img(10,10) instead of ptr(10,10).
I have tried to make my program to cout img1(x,y) == img2(x,y), or !=, but cannot get their library to return the value of a pixel