距离变换示例

已经准备了名为 canvasInputcanvasOutput 的 <canvas> 元素。
点击 Try it 按钮来查看结果。您可以选择另一张图像。
您可以更改 <textarea> 中的代码来进行更深入的研究。

canvasInput
canvasOutput