Negative Fractal dimension values in plants images After calculating lengths and angles from a plant i represented it with the help of L-system fractals (see image below).

I made that process for many plants and then i went to matlab to calculate their fractal dimension. I used the boxcount matlab's app and here are the commands i used:
RGB = imread('boxcount\plants\plant_1.png');
I = rgb2gray(RGB);
BW = im2bw(I,0.7);
[n, r] = boxcount(BW);
df = diff(log(n))./diff(log(r));
disp(['Fractal dimension, Df = ' num2str(mean(df(4:8))) ' +/' num2str(std(df(4:8)))]);

The thing is that in all plants returned me a negative value such as:

Df = -1.8973 +/0.10537

So it's seems weird to me that the value is being negative and i'm looking here for an answer on what that means. Is it my fault or its really means something.
Thank you.
 A: I think the output is reasonable, though (like all box-counting estimates) not entirely reliable.  I'd do it a bit differently:
data = 1-im2bw(imread('plant_1.png'));
[n,r] = boxcount(data, 'plot');
df = diff(log(n))./diff(log(1./r))

%%% output %%%
%df =
%  Columns 1 through 7
%   1.8479   1.7422   1.6397   1.5625   1.5747   1.4671   1.5025
%  Columns 8 through 10
%   1.5850   2.0000         0

Noting that the beginning and ending terms appear to be outliers we can proceed as you did to estimate the dimension and error estimate as
[mean(df(4:8)),std(df(4:8))]

%%% Output %%%
% ans = -1.5383    0.0511

Now, the key issue is that the box count $n$ and the box size $r$ are expected to be related to the dimension $d$ via
$$n \sim (1/r)^d$$
or
$$d \approx \frac{\log(n)}{\log(1/r)} = -\frac{\log(n)}{\log(r)}.$$
The minus sign that appears above is exactly the source of your confusion.  Often, this formula is expressed as the statement that the dimension is the negative slope of a loglog plot of $n$ versus $r$.  In fact, the call to boxcount with the 'plot' option, as I've done, generates the following image.


Note: I would still be suspicious of this computation.  The correct dimension is obviously 2, as it contains large, solid regions.  I suppose that the fractal branches must dominate somehow, but this doesn't make much sense to me.  One might analyze the fractal dimension of the very tips of the branches using an IFS to see if this is actually what the computation here is capturing.  I'm not certain.
