Source Code

This page intends to provide various softwares regarding quality assessment, digital watermarking, lossless compression, selective encryption, HVS models, as well as some subjective experiments.

Please note: There is no warranty or support for the applications below. They are supplied free of charge. We cannot be held responsible for damage caused to your computer. If you are unsure about any aspect of installing this software then please do not proceed.

Quick access:
Objective Quality Metrics
Mojette related code
JND masks for watermarking
Watermark detection
Subjective Experiments
Video Processing

Quality metrics

  • Download the Komparator quality metric (provided by Pierre Evenou).

  • Download the cpa1 metric (check this paper for explanations of the metric)

  • Download the cpa2 metric (check this paper for details on the metric, or this one for a particular use of the metric)

Many thanks to Vinod Pankajakshan for his source code of both cpa1 and cpa2.

Mojette stuff

  • Some code for the Mojette (provided by Pierre Evenou).
also available as a sourceforge project

  • Some more code for the Mojette Transform, for lossless compression and Selective  Encryption purpose. (Many thanks to Andrew Kingston who wrote this code). This code is further to the preliminary study on the Mojette compression.

JND Masks for digital watermarking

- Chou-Hsien Chou, Yun-Chin Li, "A Perceptually Tunned Subband Image Coder Based on the Measure of Just-Noticeable-Distortion Profile", IEEE Trans on Circuits and Systems for Video Technology, Vol. 5, Dec. 1995.

- A. B.Watson, "DCTune: A Technique For Visual Optimization of DCT Quantization Matrices for Individual Images", Society for Information Display Digest of Technical Papers XXIV,1993.

- Xiaohui Zhang, Weisi Lin, Ping Xue, "Just-noticeable difference estimation with pixels in images", Journal of visual Communication &Image Representation., June 2007.

Many thanks to Chen Wei, who provided this code.

  •  A piece of Octave code to compute the JND mask we used in the paper entitled: 
"A robust image watermarking technique based on quantization noise visibility thresholds"

  • Towards a JND mask in the Wavelet domain, refers to the following papers 
- "A perceptually driven hybrid additive-multiplicative watermarking technique in the wavelet domain", Electronic Imaging 2011.
- "A Subjective Study of Visibility Thresholds for wavelet domain watermarking", ICIP 2010.

Note: this is part of an ongoing study, the subjective experiment is available in  the above link.

 Watermark detection

  • Some source code for the Grubbs' test (see te paper entitled "Application of Grubbs' test for outliers do the detection of watermarks", ACM IH&MMsec 2014).

To use this code, you will need the libit, gsl and mpfit libraries.

Command line:

./Grubbs_test <Data.txt> <width> <height> <alpha_value>


./Grubbs_test xcorr.txt 127 127 0.00001

The distribution of the data is obtained, and a Gaussian fit is performed, in order to ensure that the data follows a normal distribution.

This code is based on this Matlab implementation.

It is C code, but the archive also includes a python script.

Subjective experiments

  • Download various subjective quality assessment databases here.

  • Ongoing works on JND computation in the wavelet domain. (the link includes a subjective experiment, feel free to give it a try and send me the log file).

  • Download a DSIS subjective experiment right here. The original and distorted images are successively displayed in the center of the screen for about 5 seconds each, and then, the observer has to vote, using the F1 to F5 keys.

  • Some source code for a "2AFC" experiment is there. 2AFC stands for "Two Alternative Forced Choice", basically, an original image is displayed on the upper part of the screen, and two images are displayed in the lower half. Among these two images, one is the original, and one is a distorted version. The observer is asked to select the image he believe is the distorted image. The selection is done with the right/left arrows (pointing towards the distorted image).

  • Download a Pair comparison subjective experiment right here. This experiment basically displays two images side by side on a monitor, the reference image location is known (left hand side of the screen), and the distorted image is displayed on the right hand side. The observers are asked to evaluate the quality of the distorted image using the F1 to F5 keys on the keyboard (please read the README.txt file included in the zip archive for more details).
Note that you will need to have both SDL and SDL_Image installed (using ./configure; make; make install).

Video Processing

  • Check out a H.264 watermarking DEMO.

  • Download a YUV player for Windows or Mac/Linux (only reads 4:2:0 format).

2 versions are available here:
- An SDL based player (cross-platform)
- An AquaTerm based player (Mac-only)

The arguments for this program are as follows:
1) the yuv video filename, 2) the frames height and 3) the frames width:

./SDL_YUVplayer foreman_qcif.yuv 144 176

Please read this file for more details.

Sourceforge project:
You can access the sourceforge project here.
Note that the sourceforge project may include new features.

Some YUV videos can be downloaded from
Graphical User Interface:

I made a first attempt to create a GUI to the YUV player.
This interface allows to read 4:4:4, 4:2:2 & 4:2:0 planar YUV files.

You will need to have Python installed to run the Graphical User Interface.
If you want to compile this code, you'll need:
     - SDL
     - SDL_Image
     - Python
     - wxPython

Please, read the README.txt file.

Misc Stuff

  • A 2D normalized cross correlation function in C: normxcorr2.

  • 2D csf (Contrast Sensitivity Function) in C: 2Dcsf.

Edit the .m files, and set the 'cmd' variable to the path of your "ij.jar" or "Plot" file.
Note: The the "getimage" function should be cross-platform, whereas the "getplot" function is Mac only.