Highly Nonlinear Approximations for Sparse Signal Representation

Logo EPSRC

Image approximation

This example illustrates the use of the method Self Projected Matching Pursuit in 2D (SPMP2D), for approximating images. The details of the algorithm are given in the paper:

'Sparse Representations of Astronomical Images'
by L. Rebollo-Neira and J. Bowley

The example can also be realised with the technique Orthogonal Matching Pursuit in 2D (OMP2D). The dictionary used in this example is specially designed to approximate astronomical images in the categories of nebulae, galaxies and stars. It is composed of a Redundant Discrete Cosine component and a Redundant Discrete B-Spline based component.

The approximation error is set to produce a perceptually indistinguishable approximation of the image. This is achieved for PSNR = 50dB and Mean Structural Similarity Index = 1.00. The Sparsity Ratio (SR) yielded by the proposed dictionary is SR = 9.79, which represents a massive gain with respect to the result obtained if the approximation is realised by the Discrete Wavelet Transform (SR = 3.69).

All the source files for the routines to run the example in MATLAB are available in the archive SPAI.zip which demonstrates the use of the routines SPMP2D and OMP2D for approximating images. The function Example.m, which runs the example shown below, is contained within the SPAI/MATLAB/Web/SPAI/ directory. The approximation is performed on the, "Spiral Galaxy NGC 4945" image, kindly provided by European Southern Observatory (ESO) website

For decreasing the execution time compile the C++ MEX versions of SPMP2D named SPMP2D_Mex and the C++ MEX versions of OMP2D named OMP2D_Mex by calling the script SPAI/MATLAB/Web/SPAI/UseMex.m.


function Example
% Example of approximating atronomical images using OMP2D and SPMP2D.
% Use mex flag to switch between implementations.
% The execution times resulting from running this example using a laptop with 7.7GB of
% RAM and an intel Core 2 Duo P8600 CPU are shown below.
%   OMP2D (MATLAB implementation method = 1, useMex = 0): 89.81 seconds
%   OMP2D (MEX implementation method = 1, useMex = 1): 14.78 seconds
%   SPMP2D (MATLAB implementation method = 2, useMex = 0): 104.74 seconds
%   SPMP2D (MEX implementation method = 2, useMex = 1): 17.59 seconds

% Path to the image to be approximated
    imagePath = '../../../Corpus/Images/Hubble_Top_100/Web/eso0931a_sc.jpg';

% Desired method for approximation: 1 is OMP2D, 2 is SPMP2D.
    method = 1;

% Size of block partitions
    szBlock = 8;

% Use MEX file if compiled: 0 No, 1 Yes (to compile run UseMex.m)
    useMEX = 0;

% PSNR which each block is approximated to, global PSNR will be greater
% than or equal to this value
blockPSNR = 48.01;

% Add required paths
    ExamplePaths(0);

% Approximate the image
    [mImApprox,PSNR,SSIM,SR,execTime,mIm] = ImApproxGreyW(imagePath,szBlock,method,useMEX,blockPSNR);

% Remove paths
    ExamplePaths(1);

% Print the results
    fprintf('\n\nResults of approximation taking %.2f seconds\n',execTime);
    % SR
    fprintf(' Sparsity Ratio (SR) -> %.2f\n',SR);
    % PSNR
    fprintf(' Peak Signal to Noise Ratio (PSNR) -> %.2fdB\n',PSNR);
    % Mean SSIM
    fprintf(' Mean Structural Similarity Index (MSSIM) -> %.2f\n',SSIM);
    % Execution Time

% Display figures
    figure;imshow(uint8(mIm'));
    figure;imshow(uint8(mImApprox'));

Results of approximation taking 89.81 seconds
 Sparsity Ratio (SR) -> 9.79
 Peak Signal to Noise Ratio (PSNR) -> 50.00dB
 Mean Structural Similarity Index (MSSIM) -> 1.00

Original Image
Approximated Image