matlab - how to get feature of png image using 2d dct? -


could use dct extract feature of .png images? or dct jgp? because dataset using png format.

i've read several journals, , find 2d dct used extract feature based on coefficient. need features neural neutwork. i've tried basic code 2d dct (using matlab):

i = imread ('ab1.png'); b = im2double (x); d = dct2 (b, [64 64]);  

but, still not sure, code give me appropriate feature need. have recommendation of codes?

and why 'dctmtx' function give me same coefficient different image? *thanks before.

first, png not matter, long not doing alpha channel processing etc, reading png reading jpg since doing dct on matrix representation of image - instead of file.

your code:

d = dct2 (b, [64 64]);  

should give 2d-dct of 0 padded 64 64 image.

to check try like:

d = dct(dct(b.').') %//if want pad image 0 first. 

since dct2 implemented using dct @ core.

as dctmtx - should give dct matrix can apply image matrix obtain dct result of image (thus , result generated dctmtx should same image same size). matlab gives clear example:

a = im2double(imread('rice.png')); %//your image d = dctmtx(size(a,1));  %//generate dct matrix of size of image dct = d*a*d';  %//obtain 2d - dct  figure, imshow(dct)  %//result transform 

all 3 examples should give same result.

and finally, in terms of best feature extraction algorithm/transformation, depends on trying achieve - recognition/enhancement/encryption in general, dct , efficient regular images.


Comments