資源簡介
文獻fractal analysis and multifractal spectra for the images 及其代碼
文獻,基于多重分形頻譜分析的圖像邊緣檢測_王耀南及其代碼

代碼片段和文件信息
%Name:multifractal_and_output
%Author:Jia?MenghanZhejiang?University?
%Date:?2013/9/3
%Description:
%?輸入灰度圖像RGB彩色圖像會自動轉換為灰度圖像
%?輸出圖像的多重分形譜
%Reference:
%?“fractal?analysis?and?multifractal?spectra?for?the?images“
%
%?Prof.?Artde?D.K.T.?Lam?Ph.D
%?Department?of?Information?Communication
%?Leader?University
%?70901?Tainan?City?Taiwan
%?e-mail:?artde.lam@gmail.com
%?
%?Asso.?Prof.?Q.?Li
%?Department?of?Digital?Media?Arts
%?Fuzhou?University
%?350108?Fuzhou?Fujian
%?e-mail:?fzuliqi@126.com
%
%%?設定q范圍
clc;close?all;
clear?all;
qmin=-50.5;
qmax=50.5;
qevery=1;
%%?讀取圖片
[filenamepathnamefilterindex]=uigetfile(‘*.*‘‘選擇要打開的圖片文件‘);
filename=[pathname?filename];
a?=?imread(filename);
%?a=a(1:641:64);
[rows?cols]?=?size(a);
if?mod(log2(rows)1)>0
????error(‘The?size?of?image?must?be?2^n‘);
end
if?size(a3)==3
????a=rgb2gray(a);
end
figure;imshow(a);title(‘原始灰度圖片‘);
npix?=?sum(sum(a));
%%??計算L*L大的盒子的nL?即Zij
%calculates?niL?which?is?the?number?of?pixels?in?the?ith?box?of?size?L?
%?ideas?from?boxcount.m?by?F.?Moisy?have?been?borrowed?here
width?=?rows;
p?=?log(width)/log(2);
max_boxes?=?power(rows2)/power(22);
nL?=?double(zeros(max_boxesp));?%nl每一列為每個分塊疊加的值,行為分的塊數邊長每次*2
for?g=(p-1):-1:0
????siz?=?2^(p-g);?%每個盒子像素點數
????sizm1?=?siz?-?1;
????index?=?log2(siz);?%為nl的列數?
????count?=?0;?%為nl的行數?count=(i-1)*每條邊盒子數+j
????for?i=1:siz:(width-siz+1)
????????for?j=1:siz:(width-siz+1)
????????????count?=?count?+?1;
????????????sums?=?sum(sum(a(i:i+sizm1j:j+sizm1)));
????????????nL(countindex)?=?sums;
????????end
????end
end
%%?計算橫坐標ln(epsilon)即logl
epsilon?=?zeros(p-11);?%eps的橫坐標
for?l=1:p-1
????epsilon(l)=power(2l)/width;
end
logl=log(epsilon);
%%?規范化質量,像素點數除以總像素點數,即Pij
%normalized?masses
pL?=?double(zeros(max_boxesp));?%pL即pij
for?l=1:p?%l=1時分成2*2的盒子
????nboxes?=?power(rows2)/power(power(2l)2);?%所有的盒子數
????norm?=?sum(nL(1:nboxesl));
????
????for?i=1:nboxes?
????????pL(il)?=?nL(il)/norm;
????end
end
%%?計算繪圖所用所用參數
%falpha?alpha
qval?=?qmin:qevery:qmax;
fql?=?zeros(p-1size(qval2));
aql?=?zeros(p-1size(qval2));
Xq?=?zeros(p-1size(qval2));?%用來儲存Xq,行數為p,列數為分形盒子的次數q
for?l=1:p-1
????
????count?=?0;
????nboxes?=?power(rows2)/power(power(2l)2);?%所有的盒子數
????
????for?q?=?qmin:qevery:qmax????
????????%denominator?of?muiql
????????qsum?=?0.0;
????????for?i=1:nboxes
????????????if(pL(il)?~=?0)
????????????????qsum?=?qsum?+?power(pL(il)q);
????????????end
????????end
?
????????fqnum?=?0.0;
????????aqnum?=?0.0;
????????smuiqL?=?0.0;
????????for?i=1:nboxes
????????????if(pL(il)?~=?0)
??????????????????muiqL?=?power(pL(il)q)/qsum;
??????????????????fqnum?=?fqnum?+?(muiqL?*?log(muiqL));
??????????????????aqnum?=?aqnum?+?(muiqL?*?log(pL(il)));
??????????????????smuiqL?=?smuiqL?+?muiqL;
????????????end?
????????end
????????if(uint8(smuiqL)~=1)
????????????display(‘error‘);
????????end
????????
????????count?=?count?+?1;
????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????126531??2017-12-13?10:36??多重分形文章與代碼\Lam\fractal?analysis?and?multifractal?spectra?for?the?images.pdf
?????文件???????4313??2017-12-13?10:37??多重分形文章與代碼\Lam\multifractal_and_output.m
?????文件?????315429??2017-12-06?22:51??多重分形文章與代碼\王耀南\1.基于多重分形頻譜分析的圖像邊緣檢測_王耀南.pdf
?????文件???????1412??2017-12-13?10:33??多重分形文章與代碼\王耀南\fractal.m
?????目錄??????????0??2017-12-13?10:37??多重分形文章與代碼\Lam
?????目錄??????????0??2017-12-13?10:34??多重分形文章與代碼\王耀南
?????目錄??????????0??2017-12-13?10:37??多重分形文章與代碼
-----------?---------??----------?-----??----
???????????????447685????????????????????7
評論
共有 條評論