京公网安备 11010802034615号
经营许可证编号:京B2-20210330
Hilbert空间递归演示_数据分析师
Hilbert空间填充曲线在图像采样等方面十分有用关于什么希尔伯特
空间填充曲线看这里:http://en.wikipedia.org/wiki/Hilbert_curve
程序效果:
模拟Hilbert空间填充曲线效果,点击鼠标自动叠加!运行效果截图
Hilbert源程序代码:
|
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
package com.gloomyfish.image.hilbert;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
public class Hilbert {
public static final int WHEELSIZE = 1024;
// four edges
public static final int NORTH = 0;
public static final int EAST = 90;
public static final int SOUTH = 180;
public static final int WEST = 270;
// four corners
public static final int NE = 45;
public static final int SE = 135;
public static final int SW = 225;
public static final int NW = 315;
// attributes
private Point location;
private Color[] colorWheel;
private int colorIdx;
public Hilbert() {
// build color lookup table
this.colorWheel = new Color[1024];
for (int i = 0; i < 128; ++i)
this.colorWheel[i] = new Color(0, 255 - i, i);
for (int j = 128; j < 256; ++j)
this.colorWheel[j] = new Color(0, j, j);
for (int k = 0; k < 256; ++k)
this.colorWheel[(k + 256)] = new Color(0, 255 - k, 255);
for (int l = 0; l < 128; ++l)
this.colorWheel[(l + 512)] = new Color(0, l, 255 - l);
for (int i1 = 0; i1 < 128; ++i1)
this.colorWheel[(i1 + 640)] = new Color(0, 127 - i1, 127 - i1);
for (int i2 = 0; i2 < 256; ++i2)
this.colorWheel[(i2 + 768)] = new Color(0, i2, 0);
this.colorIdx = 0;
}
public void process(Graphics graphic, int level, int width, int height) {
this.location = null;
if(level > 32 )
{
graphic.drawString("could get max depth is 32!", 40, 40);
return;
}
hilbert(graphic, level, 0, 0, width, height, 0, 225);
}
public void hilbert(Graphics g, int depth, int startx, int starty, int width, int height, int startgray, int endgray) {
int centerX = width / 2;
int centerY = height / 2;
if (depth == 0) {
if (this.location != null) {
g.setColor(this.colorWheel[this.colorIdx]);
g.drawLine(this.location.x, this.location.y,
startx + centerX, starty + centerY);
if (++this.colorIdx >= 1024)
this.colorIdx = 0;
}
this.location = new Point(startx + centerX, starty + centerY);
return;
}
switch (startgray) {
|
数据分析咨询请扫描二维码
若不方便扫码,搜微信号:CDAshujufenxi
在自动化办公、数据采集、定时统计、日志清理、系统监控等场景中,程序往往需要按照固定时间间隔重复执行指定任务,这种运行机制 ...
2026-08-12在数据分析日常工作中,Excel数据筛选是数据清洗、数据提取、样本筛选的核心基础操作。传统Excel手动筛选、函数筛选方式,面对多 ...
2026-08-12 很多数据分析师精通Excel函数和数据透视表,但当被问到“数据从哪里来”“表和视图有什么区别”“数据库管理系统和SQL是什么 ...
2026-08-12在数据分析、统计建模、数据挖掘与商业调研过程中,原始数据往往无法做到绝对干净规整。受系统故障、人工录入失误、设备误差、突 ...
2026-08-11在数据分析工作中,聚类分析是典型的无监督学习方法,核心作用是依据数据自身的多维特征,将相似样本自动划分为若干类别,实现“ ...
2026-08-11 很多企业团队并非缺乏指标,而是陷入“指标失控”:仪表盘上堆满实时跳动的数据,却无法回答“当前瓶颈在哪、下一步该做什么 ...
2026-08-11AB实验是互联网产品迭代、营销优化、功能升级的核心科学验证手段,通过流量随机分组、对照组与实验组对比,科学验证策略、功能、 ...
2026-08-10在MySQL数据库优化中,索引是提升查询效率、降低数据库IO开销、优化系统性能的核心手段。普通单列索引仅适配简单查询场景,面对 ...
2026-08-10 很多数据分析师每天盯着几十个指标,但当被问到“这套指标要支撑什么业务目标”“指标之间是什么逻辑关系”“业务变化时如何 ...
2026-08-10在数字化市场调研体系中,大数据与小数据是两类核心调研数据形态,分别对应海量行为统计与精准样本深度调研。行业普遍存在认知误 ...
2026-08-07数据透视表是Excel、WPS中最核心的数据分析工具,凭借快速汇总、分组统计、动态筛选的优势,被广泛应用于销量统计、业绩复盘、数 ...
2026-08-07 很多数据分析师每天盯着GMV、DAU、转化率,但当被问到“哪些指标在所有行业都适用”“哪些指标只对电商有意义”“二者如何搭 ...
2026-08-07在商品销量、市场需求、营收规模等业务数据中,季节性波动是最普遍、最核心的数据特征。零售快消、食品餐饮、家电服饰、电商行业 ...
2026-08-06在流量红利消退、市场竞争白热化的商业环境中,传统依托经验、跟风投放、广撒网式的营销模式,逐渐暴露出成本高、精准度低、转化 ...
2026-08-06 很多数据分析师每天盯着GMV、DAU、转化率,但当被问到“什么是指标”“指标和维度有什么区别”“如何定义指标值的计算规则和 ...
2026-08-06【核心关键词】知识、设备、工程师、数字化、建模、算法、工业大数据、数据分析、控制算法、机器学习、深度学习、业务目标、工 ...
2026-08-05增长率是数据分析、业务报表、可视化看板中最核心的指标之一,常用于衡量营收、销量、用户量、流量等业务数据的涨跌幅度与发展趋 ...
2026-08-05小陈是某电商平台的数据分析师。老板交给他一个任务:“我们平台的注册用户已经突破1000万了,想了解一下用户的平均月消费金额。 ...
2026-08-05在机器学习建模、数据预处理、抽样划分、模型初始化训练的全流程中,随机种子是控制实验随机性、保证结果可复现、提升模型稳定性 ...
2026-08-04Python作为面向对象的主流编程语言,核心编程体系由变量、方法、类三大基础要素构成。三者层层递进、相互协作,支撑起所有基础代 ...
2026-08-04