% compute boxdim of image in Matlab.
addpath boxcount
a = imread('pollock.jpg');
size(a)
b = squeeze(sum(a,3));  % add RGB equally
imagesc(b); colormap(gray);
c = b>400;
imagesc(c); colormap(gray);
boxcount(b>400) % choose intensity cutoff, graph (always looks straight!)
boxcount(b>400,'slope') % choose intensity cutoff, slope, more discerning
% not convincing

%a = imread('koch1.gif');
a = imread('koch2.png');
a = squeeze(sum(a,3))<400;  % add RGB equally, thresh
boxcount(a,'slope')
%hline(log(4)/log(3))
