数据结构可视化

前言:

人是一种视觉动物,我们可以通过视觉来思考数据结构

Visualizing Algorithms(算法可视化)

  1. The power of the unaided mind is highly overrated… The real powers come from devising external aids that enhance cognitive abilities. —Donald Norman

独立思维的力量被高估了...... 真正的力量来自于设计提高认知能力的外部辅助手段。 - 唐纳德诺曼

  1. Algorithms are a fascinating use case for visualization. To visualize an algorithm, we don’t merely fit data to a chart; there is no primary dataset. Instead there are logical rules that describe behavior. This may be why algorithm visualizations are so unusual, as designers experiment with novel forms to better communicate. This is reason enough to study them.

算法是可视化的一个迷人用例。为了使算法可视化,我们不仅仅将数据拟合到图表中; 没有主要数据集。相反,存在描述行为的逻辑规则。这可能是算法可视化非常不寻常的原因,因为设计师尝试使用新颖的形式来更好地进行交流。这是足以研究它们的原因。

  1. But algorithms are also a reminder that visualization is more than a tool for finding patterns in data. Visualization leverages the human visual system to augment human intellect: we can use it to better understand these important abstract processes, and perhaps other things, too.

但算法也提醒人们,可视化不仅仅是一种查找数据模式的工具。可视化利用人类视觉系统来增强人类智力:我们可以用它来更好地理解这些重要的抽象过程,也可能是其他事物。

  1. Sampling
    Before I can explain the first algorithm, I first need to explain the problem it addresses.

取样
在我解释第一个算法之前,我首先需要解释它解决的问题。

Van Gogh’s The Starry Night
  1. Light — electromagnetic radiation — the light emanating from this screen, traveling through the air, focused by your lens and projected onto the retina — is a continuous signal. To be perceived, we must reduce light to discrete impulses by measuring its intensity and frequency distribution at different points in space.

光 - 电磁辐射 - 从这个屏幕发出的光,在空中传播,由你的镜头聚焦并投射到视网膜上 - 是一个连续的信号。要被察觉,我们必须通过测量空间中不同点的强度和频率分布来减少光到离散脉冲。

  1. This reduction process is called sampling, and it is essential to vision. You can think of it as a painter applying discrete strokes of color to form an image (particularly in Pointillism or Divisionism). Sampling is further a core concern of computer graphics; for example, to rasterize a 3D scene by raytracing, we must determine where to shoot rays. Even resizing an image requires sampling.

这种简化过程称为抽样,对视力至关重要。你可以把它想象成一个画家应用不连续的颜色笔画形成一个图像(特别是在点彩派或分裂主义)。采样是计算机图形学的核心问题; 例如,要通过光线追踪光栅化3D场景,我们必须确定拍摄光线的位置。即使调整图像大小也需要采样。

  1. Sampling is made difficult by competing goals. On the one hand, samples should be evenly distributed so there are no gaps. But we must also avoid repeating, regular patterns, which cause aliasing. This is why you shouldn’t wear a finely-striped shirt on camera: the stripes resonate with the grid of pixels in the camera’s sensor and cause Moiré patterns.

竞争目标使得抽样变得困难。一方面,样品应均匀分布,以便没有间隙。但我们还必须避免重复的常规模式,这会导致混叠。这就是为什么你不应该在相机上穿一件精美条纹的衬衫:条纹与相机传感器中的像素网格共振,并导致莫尔条纹。

This micrograph is of the human retina’s periphery. The larger cone cells detect color, while the smaller rod cells improve low-light vision.
  1. The human retina has a beautiful solution to sampling in its placement of photoreceptor cells. The cells cover the retina densely and evenly (with the exception of the blind spot over the optic nerve), and yet the cells’ relative positions are irregular. This is called a Poisson-disc distribution because it maintains a minimum distance between cells, avoiding occlusion and thus wasted photoreceptors.

人类视网膜有一个美丽的解决方案,采样感光细胞的位置。细胞密集均匀地覆盖视网膜(视神经上方的盲点除外),但细胞的相对位置不规则。这称为泊松圆盘分布,因为它保持了细胞之间的最小距离,避免了遮挡,从而浪费了光感受器。

  1. Unfortunately, creating a Poisson-disc distribution is hard. (More on that in a bit.) So here’s a simple approximation known as Mitchell’s best-candidate algorithm.

不幸的是,创建Poisson-disc分布很难。(稍微详细一点。)所以这是一个简单的近似,称为米切尔的最佳候选算法。

参考链接Visualizing Algorithms

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 一如明媚的江水,浩浩荡荡闯进早已平息的心。 素净如莲,白裾拂过微凉的水面,卷起尘世的泪沾染清土。 鹤唳,终...
    洛书悠南阅读 344评论 0赞 0
  • 连日阴雨,空气潮湿而闷热,天气算不上好,家里的宝贝小墩墩很不幸感冒了,连续咳了两天之后我们决定带他去隔壁县城一个很...
    o绾卿o阅读 301评论 7赞 5
  • 坦白的讲,刚刚看到这本书的标题--《活出生命的意义》,第一反应是:这又是一本鸡汤文集吗?表示很不屑。看了简介,原来...
    Karen影子阅读 662评论 5赞 8

友情链接更多精彩内容