资源简介
盒维计算的matlab 程序,很清晰,附有示例图片,有助于理解盒维
代码片段和文件信息
function [nr] = boxcount(cvarargin)
%BOXCOUNT Box-Counting of a D-dimensional array (with D=123).
% [N R] = BOXCOUNT(C) where C is a D-dimensional array (with D=123)
% counts the number N of D-dimensional boxes of size R needed to cover
% the nonzero elements of C. The box sizes are powers of two i.e.
% R = 1 2 4 ... 2^P where P is the smallest integer such that
% MAX(SIZE(C)) <= 2^P. If the sizes of C over each dimension are smaller
% than 2^P C is padded with zeros to size 2^P over each dimension (e.g.
% a 320-by-200 image is padded to 512-by-512). The output vectors N and R
% are of size P+1. For a RGB color image (m-by-n-by-3 array) a summation
% over the 3 RGB planes is done first.
%
% The Box-counting method is useful to determine fractal properties of a
% 1D segment a 2D image or a 3D array. If C is a fractal set with
% fractal dimension DF < D then N scales as R^(-DF). DF is known as the
% Minkowski-Bouligand dimension or Kolmogorov capacity or Kolmogorov
% dimension or simply box-counting dimension.
%
% BOXCOUNT(C‘plot‘) also shows the log-log plot of N as a function of R
% (if no output argument this option is selected by default).
%
% BOXCOUNT(C‘slope‘) also shows the semi-log plot of the local slope
% DF = - dlnN/dlnR as a function of R. If DF is contant in a certain
% range of R then DF is the fractal dimension of the set C. The
% derivative is computed as a 2nd order finite difference (see GRADIENT).
%
% The execution time depends on the sizes of C. It is fastest for powers
% of two over each dimension.
%
% Examples:
%
% % Plots the box-count of a vector containing randomly-distributed
% % 0 and 1. This set is not fractal: one has N = R^-2 at large R
% % and N = cste at small R.
% c = (rand(12048)<0.2);
% boxcount(c);
%
% % Plots the box-count and the fractal dimension of a 2D fractal set
% % of size 512^2 (obtained by RANDCANTOR) with fractal dimension
% % DF = 2 + log(P) / log(2) = 1.68 (with P=0.8).
% c = randcantor(0.8 512 2);
% boxcount(c);
% figure boxcount(c ‘slope‘);
%
% F. Moisy
% Revision: 2.10 Date: 2008/07/09
% History:
% 2006/11/22: v2.00 joined into a single file boxcountn (n=123).
% 2008/07/09: v2.10 minor improvements
% control input argument
error(nargchk(12nargin));
% check for true color image (m-by-n-by-3 array)
if ndims(c)==3
if size(c3)==3 && size(c1)>=8 && size(c2)>=8
c = sum(c3);
end
end
warning off
c = logical(squeeze(c));
warning on
dim = ndims(c); % dim is 2 for a vector or a matrix 3 for a cube
if dim>3
error(‘Maximum dimension is 3.‘);
end
% transpose the vector to a 1-by-n vector
if length(c)==numel(c)
dim=1;
if size(c1)~=1
c = c‘;
end
end
width = max(size(c)); % largest size of the box
p = log(width)/log(2); % nbre of generations
% remap the array if the sizes are not all equal
% or if they
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 37254 2006-11-14 14:04 Apollonian_gasket.gif
文件 5693 2008-07-09 09:42 boxcount.m
文件 276 2008-07-09 15:56 Contents.m
文件 5763 2008-07-09 16:15 demo.m
文件 30608 2006-11-21 01:00 dla.gif
文件 1125602 2006-11-20 18:03 fractal_tree.jpg
文件 5221 2006-11-21 13:42 randcantor.m
文件 20039 2008-07-09 16:17 html\demo.html
文件 1638 2008-07-09 16:17 html\demo.png
文件 17927 2008-07-09 16:16 html\demo_01.png
文件 4913 2008-07-09 16:16 html\demo_02.png
文件 5947 2008-07-09 16:16 html\demo_03.png
文件 4560 2008-07-09 16:16 html\demo_04.png
文件 8783 2008-07-09 16:16 html\demo_05.png
文件 5058 2008-07-09 16:16 html\demo_06.png
文件 4648 2008-07-09 16:16 html\demo_07.png
文件 347480 2008-07-09 16:16 html\demo_08.png
文件 19070 2008-07-09 16:16 html\demo_09.png
文件 4724 2008-07-09 16:16 html\demo_10.png
文件 19154 2008-07-09 16:16 html\demo_11.png
文件 5312 2008-07-09 16:16 html\demo_12.png
文件 4436 2008-07-09 16:16 html\demo_13.png
文件 2336 2008-07-09 16:16 html\demo_14.png
文件 4635 2008-07-09 16:16 html\demo_15.png
文件 3765 2008-07-09 16:17 html\demo_16.png
..A.SH. 49664 2010-08-02 21:55 html\Thumbs.db
目录 0 2010-08-12 13:21 html
----------- --------- ---------- ----- ----
1744506 27
............此处省略0个文件信息
相关资源
- MATLAB智能算法30个案例分析第2版源代
- 基于matlab的斜抛运动轨迹分析(考虑
- mimo ofdm的MATLAB仿真
- 掺铒光纤放大器数值计算matlab.zip
- 车牌识别Matlab代码61833
- 基于MATLAB的车牌识别代码
- 802.11a_simulation with matlab
- 图像处理基础算法源代码MATLAB集合
- 图片二维小波变换的分解与重构_mat
- 13位巴克码产生波形及其模糊图 matl
- matlab量化投资基础知识
- 人工神经网络MATLAB程序代码
- MATLAB实现曼切斯特编码,密勒编码,
- matlab海明编码,crc校验 带gui
- Matlab EMD工具箱+时频分析TFTB工具箱
-
用Matlab中的Simuli
nk对AM波进行调制解 - 基于MATLAB的运动控制系统的仿真软件
- 基于matlab的车牌识别内含matlab代码以
- 基于matlab的图像拼接含matlab代码以及
- 薛定宇--MATLAB代码
- 《精通MATLAB GUI设计(第2版)》
- Matlab短学期作业报告
- 遗传退火算法法MATLAB程序设计
- PESQ与LSD评价
- 一个社团发现的MATLAB工具箱
- 基于MATLAB的Harris角点检测并精确到亚
- 变化检测MATLAB代码
- Matlab车道线检测46119
- 基于无线通信基站的室内三维定位问
- NS方程MATLAB
评论
共有 条评论