To compute a fractal dimension, you have to know how the object is "constructed". Let's use the Koch snowflake as an example:
To compute the fractal dimension, you have to know:
1) how many new features are added at every iteration
2) what scale the new feature has at every iteration
At the 0th iteration (top left), there's 3 lines each of the same length (let's call it L).
At the first iteration, we see that there are now 4 features per old but there are all 1/3 of the previous line.
At the second iteration, we add replace with 16 new features (4 for each of the last 4) and multiply the new Length, and each of those are 1/3 of the previous 1/3.
So we see a trend, for each iteration, n:
4^n new things added
(1/3)^n is the scaling factor
So we would say N = 4 and e = 1/3 and compute the fractional dimension:
D = log(N)/log(1/e) = log(4)/log(3) ~ 1.2
There are other ways to approximate a fractal dimension, like the box dimension. They are especially useful when you don't have a nice simple shape like the Koch snowflake.
Some external links:
3.3 Fractal Dimension
Fractal Dimension
Fractals & the Fractal Dimension