image_hist.m

来自「基于图象的数据隐写和提取matlab代码」· M 代码 · 共 24 行

M
24
字号
function B=image_hist(N,bins);%Please input a square matrix that has multiple of 8 dimensions%bins should range over at least -20:20%this takes a histogram of the DCT coefficeient values[x dnk]=size(N);x1=x/8;histogram=zeros(size(bins));tiled=zeros(8,8,x1,x1);%break up the matrix into 8x8 tiles and take histogram of DCTfor i=1:x1    for j=1:x1        DCT1=round(dct2(N(8*i-7:i*8,8*j-7:j*8)));        temp=hist(reshape(DCT1, 1,[]), bins);               histogram=histogram+temp;    endendB=histogram;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?