Image fractal dimension value

17 ビュー (過去 30 日間)
Jane Bat
Jane Bat 2022 年 2 月 15 日
コメント済み: yanqi liu 2022 年 2 月 16 日
I have interest in fractal dimension (FD) as I was reading this paper https://translational-medicine.biomedcentral.com/track/pdf/10.1186/1479-5876-8-140.pdf
I run the code below on the right figure (Koch snowflake) https://translational-medicine.biomedcentral.com/articles/10.1186/1479-5876-8-140/figures/1 but I get different results, any idea why? Any recommendation of introductory book covering this issue with matlab?
clc;
clear all;
close all;
fileName='E:/fd126.png'
I = (imread(fileName));
I = imfill(I,'holes');
figure
imshow(I);
BW = imbinarize(I);
BoxCountfracDim(BW) %using Hausdorff (Box-Counting) Fractal Dimension with multi-resolution calculation version 1.0.0.0 by Tan Nguyen
hausDim(BW) %using Hausdorff (Box-Counting) Fractal Dimension version 1.2.0.0 by Alceu Costa
  2 件のコメント
John D'Errico
John D'Errico 2022 年 2 月 15 日
What result do you get? How far is it off? Do you accept that this computation could some some degree of error in it? How can we know what you think is the wrong number?
Image Analyst
Image Analyst 2022 年 2 月 16 日
If you want us to run the code you should attach BoxCountfracDim and hausDim. Otherwise I'm not doing anything.

サインインしてコメントする。

採用された回答

yanqi liu
yanqi liu 2022 年 2 月 16 日
yes,sir,may be should use image as same,such as
clc; clear all; close all;
fileName='12967_2010_Article_2115_Fig1_HTML.webp.jpg';
[I,map] = imread(fileName,'jpg');
if ~isempty(map)
I = ind2rgb(I,map);
end
figure
imshow(I);
BW = im2bw(I,0.9);
bws = imfill(~BW,'holes');
bw1 = bwperim(bwareafilt(bws,1));
[r,c] = find(bw1);
bw1 = bw1(min(r):max(r),min(c):max(c));
bw2 = bwperim(bwareafilt(bws,1,'smallest'));
[r,c] = find(bw2);
bw2 = bw2(min(r):max(r),min(c):max(c));
figure;
subplot(1,2,1); imshow(bw1);
subplot(1,2,2); imshow(bw2);
BoxCountfracDim(bw1) %using Hausdorff (Box-Counting) Fractal Dimension with multi-resolution calculation version 1.0.0.0 by Tan Nguyen
hausDim(bw1) %using Hausdorff (Box-Counting) Fractal Dimension version 1.2.0.0 by Alceu Costa
BoxCountfracDim(bw2) %using Hausdorff (Box-Counting) Fractal Dimension with multi-resolution calculation version 1.0.0.0 by Tan Nguyen
hausDim(bw2) %using Hausdorff (Box-Counting) Fractal Dimension version 1.2.0.0 by Alceu Costa
ans =
1.0495
ans =
1.0495
ans =
1.2097
ans =
1.2097
>>
now,we can see
first, 1.0495
second, 1.2097
as similar with 1 and 1.26
  2 件のコメント
Image Analyst
Image Analyst 2022 年 2 月 16 日
Can you attach BoxCountfracDim() and hausDim()?
yanqi liu
yanqi liu 2022 年 2 月 16 日
yes,sir,here is 2 functions,get them by file exchange platform

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFractals についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by