fractal_analysis.py 488 Bytes
Newer Older
ecofractal's avatar
ecofractal committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 10 10:31:39 2019

@author: s_tatus

"""

import numpy as np
import scipy
import fractaL.core as fractal


img = scipy.misc.imread("sample_data/img/box2.png")
img = fractal.rgb2gray(img)

#90 is the threshold that will vary accordinly to the picture
img = fractal.fracdim(img, 90)


print("Minkowski–Bouligand dimension (computed): ", img)
print("Haussdorf dimension (theoretical):        ", (np.log(3)/np.log(2)))