Ngày tải lên :
14/12/2013, 15:15
... DCTMatrix[[#1]],DCTMatrix[[#2]]]&,
{8,8}];
img={{0,1,0,1,0,1,0,1},{0,1,0,1,0,1,0,1},
{0,1,0,1,0,1,0,1},{0,1,0,1,0,1,0,1},{0,1,0,1,0,1,0,1},
{0,1,0,1,0,1,0,1},{0,1,0,1,0,1,0,1},{0,1,0,1,0,1,0,1}};
ShowImage[Reverse[img]]
dctcoeff=Array[(Plus @@ Flatten[DCTTensor[[#1,#2]] img])&,{8,8}];
dctcoeff=SetAccuracy[dctcoeff,4];
dctcoeff=Chop[dctcoeff,.001];
MatrixForm[dctcoeff]
ShowImage[Reverse[dctcoeff]]
Code ... block of n×m DCT coefficients G
ij
for each
block of pixels. The top-left coefficient (the DC) is large, and the AC coefficients become
smaller as we move from the top-left to the bottom-right corner. ... again indicating the correct frequency.
These examples are not very realistic because the vectors being tested are short,
simple, and contain a single frequency each. Most vectors are more complex...