I need first $25 \times 25$ coefficients of DCT to encrypt an image in Matlab.
How do I obtain them ?
I used this code to compute DCT of an image :
I = imread('cameraman.tif');
I = im2double(I);
T = dctmtx(8);
dct = @(block_struct) T * block_struct.data * T';
B = blockproc(I,[8 8],dct);
mask = [1 1 1 1 0 0 0 0
1 1 1 0 0 0 0 0
1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0];
B2 = blockproc(B,[8 8],@(block_struct) mask .* block_struct.data);
invdct = @(block_struct) T' * block_struct.data * T;
I2 = blockproc(B2,[8 8],invdct);
imshow(I), figure, imshow(I2)
The statement in the paper I read is :
Basic constructions: Let $V$ be a feature space of dimension $d$ (for instance, the space $R^d$ corresponding to the entries in the top left corner of the DCT of a digital image excluding the DC component) and consider an original feature $φ = (φ_1, . . . , φ_d)$.
The paper gives also some practical details like this :
We choose as a feature space the upper left $25 \times 25$ coefficients of the DCT (excluding the DC component).