$30
/* K-SVD */
Consider images of paintings of Picasso and Bezille (provided in two zip files). Write programs for the following.
For each data set perform the following operations.
(i) Randomly sample N patches of size mxmx3. Typical values of N and
m are 1000, and 8, respectively,
(ii) Create an over-complete set of dictionary for each of them separately using K-SVD algorithm for sparse representation. Typical value of K is 256.
(iii) Derive a sparse representation with q atoms of all the images for each data set using their respective dictionaries.Typical value of q is 5. Use 4-byte floating point representation for the coefficients. Implement also reconstruction of images from their sparse representation. Find the compression ratio of the representation and also the PSNR of the reconstructed images w.r.t. original images.
(iv) Compute minimum cost bipartite matching of two dictionaries, where cost between two atoms of each dictionary is defined by the L2 norm of their differences.
(v) Transform the paintings of one artist to the other by replacing an atom with its matched partner (as computed in (iv)) and display those images and PSNR values.