京公网安备 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
在机器学习建模实操中,“特征选择”是提升模型性能、简化模型复杂度、解读数据逻辑的核心步骤——而随机森林(Random Forest) ...
2026-02-12在MySQL数据查询实操中,按日期分组统计是高频需求——比如统计每日用户登录量、每日订单量、每日销售额,需要按日期分组展示, ...
2026-02-12对CDA(Certified Data Analyst)数据分析师而言,描述性统计是贯穿实操全流程的核心基础,更是从“原始数据”到“初步洞察”的 ...
2026-02-12备考CDA的小伙伴,专属宠粉福利来啦! 不用拼运气抽奖,不用复杂操作,只要转发CDA真题海报到朋友圈集赞,就能免费抱走实用好礼 ...
2026-02-11在数据科学、机器学习实操中,Anaconda是必备工具——它集成了Python解释器、conda包管理器,能快速搭建独立的虚拟环境,便捷安 ...
2026-02-11在Tableau数据可视化实操中,多表连接是高频操作——无论是将“产品表”与“销量表”连接分析产品销量,还是将“用户表”与“消 ...
2026-02-11在CDA(Certified Data Analyst)数据分析师的实操体系中,统计基本概念是不可或缺的核心根基,更是连接原始数据与业务洞察的关 ...
2026-02-11在数字经济飞速发展的今天,数据已成为核心生产要素,渗透到企业运营、民生服务、科技研发等各个领域。从个人手机里的浏览记录、 ...
2026-02-10在数据分析、实验研究中,我们经常会遇到小样本配对数据的差异检验场景——比如同一组受试者用药前后的指标对比、配对分组的两组 ...
2026-02-10在结构化数据分析领域,透视分析(Pivot Analysis)是CDA(Certified Data Analyst)数据分析师最常用、最高效的核心实操方法之 ...
2026-02-10在SQL数据库实操中,字段类型的合理设置是保证数据运算、统计准确性的基础。日常开发或数据分析时,我们常会遇到这样的问题:数 ...
2026-02-09在日常办公数据分析中,Excel数据透视表是最常用的高效工具之一——它能快速对海量数据进行分类汇总、分组统计,将杂乱无章的数 ...
2026-02-09表结构数据作为结构化数据的核心载体,其“获取-加工-使用”全流程,是CDA(Certified Data Analyst)数据分析师开展专业工作的 ...
2026-02-09在互联网产品运营、用户增长的实战场景中,很多从业者都会陷入一个误区:盲目投入资源做推广、拉新,却忽视了“拉新后的用户激活 ...
2026-02-06在机器学习建模过程中,特征选择是决定模型性能的关键环节——面对动辄几十、上百个特征的数据(如用户画像的几十项维度、企业经 ...
2026-02-06在CDA(Certified Data Analyst)数据分析师的日常实操中,表格结构数据是贯穿全流程的核心载体,而对表格数据类型的精准识别、 ...
2026-02-06在日常办公数据分析中,我们经常会面对杂乱无章的批量数据——比如员工月度绩效、产品销售数据、客户消费金额、月度运营指标等。 ...
2026-02-05在分类模型(如风控反欺诈、医疗疾病诊断、客户流失预警)的实操落地中,ROC曲线是评估模型区分能力的核心工具,而阈值则是连接 ...
2026-02-05对CDA(Certified Data Analyst)数据分析师而言,数据分析的价值不仅在于挖掘数据背后的规律与洞察,更在于通过专业的报告呈现 ...
2026-02-05在数据分析实战中,我们经常会遇到“多指标冗余”的问题——比如分析企业经营状况时,需同时关注营收、利润、负债率、周转率等十 ...
2026-02-04