|
Code base obscuration (for images) 1.0
It implements different obscuration methods on portable images (.pgm and .ppm)
|
This class implements various image obscuration techniques for the PPM image format. More...
#include <obscurationPPM.hpp>


Static Public Member Functions | |
| static int | interpolate_color (int p11, int p21, int p12, int p22, float dx, float dy) |
| Interpolates the color value of a pixel at a given position using bilinear interpolation. | |
| static void | interpolate_bilinear (ImageBase &image, int &valR, int &valG, int &valB, float i, float j) |
| Interpolates the color values of a pixel at a given position in an image using bilinear interpolation. | |
| static void | bilinearRedim299 (ImageBase &image, ImageBase &o_image) |
| Resizes an image to 299x299 pixels using bilinear interpolation. | |
| static void | computeColorHist (ImageBase &image, int histR[256], int histG[256], int histB[256]) |
| Computes the histograms of the red, green, and blue color components of an image. | |
| static void | compareImagesByHist (ImageBase &image1, ImageBase &image2) |
| Compares the histograms of two images. | |
| static void | generateGaussianKernel (std::vector< std::vector< float > > &kernel, int size, float sigma) |
| Generates a Gaussian kernel for image blurring. | |
| static void | gaussianBlur (ImageBase &image, ImageBase &o_image, int kernelSize, float sigma) |
| Applies Gaussian blurring to an image using a given kernel size and standard deviation. | |
| static void | averageBlurring (ImageBase &image, ImageBase &o_image, int regionSize) |
| Applies average blurring to an image using a given region size. | |
| static void | newAverageBlurring (ImageBase &image, std::vector< ImageBase > &o_images) |
| Applies new average blurring to an image using a given number of images. | |
| static void | areaScrambling (ImageBase &image, ImageBase &o_image, int start_i, int start_j, int area_h, int area_w) |
| Applies area scrambling to an image using a given start position and area size. | |
| static void | scrambling (ImageBase &image, ImageBase &o_image, int regionHeight, int regionWidth) |
| Applies scrambling to an image using a given region size. | |
| static void | areaAverager (ImageBase &image, ImageBase &o_image, int start_i, int start_j, int area_h, int area_w) |
| Applies area averaging to an image using a given start position and area size. | |
| static void | averageByRegion (ImageBase &image, ImageBase &o_image, int regionHeight, int regionWidth) |
| Applies average by region to an image using a given region size. | |
| static void | selectiveProgressiveEncryption (ImageBase &image, ImageBase o_images[8], bool MSBtoLSB) |
| Applies selective progressive encryption to an image using a given encryption direction. | |
| static void | selectiveIndividualEncryption (ImageBase &image, ImageBase o_images[8]) |
| Applies selective individual encryption to an image. | |
| static void | selectiveGroupEncryption (ImageBase &image, ImageBase &o_image, int bitsGroup[8], int groupSize) |
| Applies selective group encryption to an image using a given bit group and group size. | |
| static double | computePSNR (ImageBase &image1, ImageBase &image2) |
| Computes the peak signal-to-noise ratio (PSNR) between two images. | |
| static void | computePSNRforAllAlterations (std::vector< double > &PSNRArray, const char *baseName, int i_min, int i_max, int step) |
| Computes the PSNR for all alterations in a given range. | |
| static void | writeDataOnTxt (std::vector< double > &data, std::string filename) |
| Writes data to a text file. | |
| static void | RGB2GREY (ImageBase &imColor, ImageBase &imGrey) |
| Converts an RGB image to grayscale. | |
| static double | computeImageMean (ImageBase &image) |
| Computes the mean value of an image. | |
| static double | computeSSIM (ImageBase &image1, ImageBase &image2) |
| Computes the structural similarity index (SSIM) between two images. | |
Static Public Member Functions inherited from obscurationCommon | |
| static void | genPRNS (unsigned int seq[8]) |
| Generate a random sequence of 8 bits. | |
| static void | genBitsGroups (std::vector< std::vector< int > > &groups, int groupSize) |
| Generate groups of bits. | |
| static void | intVec2intArray (std::vector< int > &vec, int arr[8]) |
| Convert a vector of integers to an array of integers. | |
This class implements various image obscuration techniques for the PPM image format.
subclass obscurationCommon
|
static |
Applies area averaging to an image using a given start position and area size.
| image | The input image. |
| o_image | The output image. |
| start_i | The vertical start position of the averaging area. |
| start_j | The horizontal start position of the averaging area. |
| area_h | The height of the averaging area. |
| area_w | The width of the averaging area. |
|
static |
Applies area scrambling to an image using a given start position and area size.
| image | The input image. |
| o_image | The output image. |
| start_i | The vertical start position of the scrambling area. |
| start_j | The horizontal start position of the scrambling area. |
| area_h | The height of the scrambling area. |
| area_w | The width of the scrambling area. |
|
static |
Applies average blurring to an image using a given region size.
| image | The input image. |
| o_image | The output image. |
| regionSize | The size of the averaging region. |
|
static |
Applies average by region to an image using a given region size.
| image | The input image. |
| o_image | The output image. |
| regionHeight | The height of the averaging region. |
| regionWidth | The width of the averaging region. |
Resizes an image to 299x299 pixels using bilinear interpolation.
| image | The input image. |
| o_image | The output image. |
Compares the histograms of two images.
| image1 | The first image. |
| image2 | The second image. |
|
static |
Computes the histograms of the red, green, and blue color components of an image.
| image | The input image. |
| histR | The histogram of the red color component. |
| histG | The histogram of the green color component. |
| histB | The histogram of the blue color component. |
|
static |
Computes the mean value of an image.
| image | The input image. |
Computes the peak signal-to-noise ratio (PSNR) between two images.
| image1 | The first image. |
| image2 | The second image. |
|
static |
Computes the PSNR for all alterations in a given range.
| PSNRArray | The output array of PSNR values. |
| baseName | The base name of the input files. |
| i_min | The minimum alteration index. |
| i_max | The maximum alteration index. |
| step | The step size between alteration indices. |
Computes the structural similarity index (SSIM) between two images.
| image1 | The first image. |
| image2 | The second image. |
|
static |
Applies Gaussian blurring to an image using a given kernel size and standard deviation.
| image | The input image. |
| o_image | The output image. |
| kernelSize | The size of the Gaussian kernel. |
| sigma | The standard deviation of the Gaussian distribution. |
|
static |
Generates a Gaussian kernel for image blurring.
| kernel | The output kernel. |
| size | The size of the kernel. |
| sigma | The standard deviation of the Gaussian distribution. |
|
static |
Interpolates the color values of a pixel at a given position in an image using bilinear interpolation.
| image | The input image. |
| valR | The interpolated red color value. |
| valG | The interpolated green color value. |
| valB | The interpolated blue color value. |
| i | The vertical coordinate of the target position. |
| j | The horizontal coordinate of the target position. |
|
static |
Interpolates the color value of a pixel at a given position using bilinear interpolation.
| p11 | The color value at the top-left corner of the interpolation rectangle. |
| p21 | The color value at the top-right corner of the interpolation rectangle. |
| p12 | The color value at the bottom-left corner of the interpolation rectangle. |
| p22 | The color value at the bottom-right corner of the interpolation rectangle. |
| dx | The horizontal distance from the top-left corner of the interpolation rectangle to the target position. |
| dy | The vertical distance from the top-left corner of the interpolation rectangle to the target position. |
|
static |
Applies new average blurring to an image using a given number of images.
| image | The input image. |
| o_images | The output images. |
Converts an RGB image to grayscale.
| imColor | The input RGB image. |
| imGrey | The output grayscale image. |
|
static |
Applies scrambling to an image using a given region size.
| image | The input image. |
| o_image | The output image. |
| regionHeight | The height of the scrambling region. |
| regionWidth | The width of the scrambling region. |
|
static |
Applies selective group encryption to an image using a given bit group and group size.
| image | The input image. |
| o_image | The output image. |
| bitsGroup | The bit group to encrypt. |
| groupSize | The size of the bit group. |
|
static |
Applies selective individual encryption to an image.
| image | The input image. |
| o_images | The output images. |
|
static |
Applies selective progressive encryption to an image using a given encryption direction.
| image | The input image. |
| o_images | The output images. |
| MSBtoLSB | The encryption direction (true for MSB to LSB, false for LSB to MSB). |
|
static |
Writes data to a text file.
| data | The data to write. |
| filename | The name of the output file. |