Coherent Line Drawing
Proc. NPAR 2007
https://github/uva-graphics/coherent_line_drawing
https://github/SSARCandy/Coherent-Line-Drawing
https://ssarcandy.tw/2017/06/26/Coherent-Line-Drawing/

所谓的 Line drawing 就是直线素描,在这里的意境就是:输入一幅图像,输出一副直线艺术风格画

本文主要是对 传统基于 difference-of-Gaussians (DoG) + binary thresholding 进行边缘检测的改进 。 传统的 difference-of-Gaussians (DoG) 使用的是 isotropic filter kernel,普通的高斯核是 各向同性的,也就是没有原来的算法在进行高斯卷积时没有考虑边缘的方向信息。 这里将边缘的梯度方向信息溶于到 difference-of-Gaussians (DoG) + binary thresholding 中。

The main idea behind our approach is to take into account the direction of the local image structure in DoG filtering, rather than looking in all directions.Especially, we apply DoG filter only in a direction perpendicular to that of the local `edge flow’, that is, the direction in which there is supposed to exist the biggest contrast. We then collect the evidence (filter response) along this flow to finally determine the edge strength

本文的主要思想就是在进行 DoG filtering 时,考虑图像局部结构的方向信息。我们只在边缘梯度方向的法线方向进行 DoG filter。 然后我们沿着边缘梯度方向综合考虑 DoG filter 的响应来最终决定其 edge strength

对于图像的梯度方向信息,我们使用 Edge Tangent Flow 来描述

这个 Edge Tangent Flow 必须满足几个条件:
1)可以描述中医边缘的流向
2)邻近的向量必须要平滑(避免邻近的向量方向差太多),除非是角落
3)重要的边缘必须要维持它原本的方向


Generate initial ETF Edge Tangent Flow的 初始化
这里使用 Sobel operator 来获取初始的 gradient map,然后归一化,接着对向量旋转90度 taking perpendicular vectors (in the counter-clockwise sense)


Refining ETF 使用 ETF construction filter 进行迭代平滑, ETF construction filter 定义如下:


w s ( x , y ) : 是 一 个 圆 形   b o x   f i l t e r   f u n c t i o n , 落 在 外 面 的 向 量 权 重 为 零 w_{s} (x,y):是一个圆形\ box \ filter \ function,落在外面的向量权重为零 ws(x,y) box filter function
w m ( x , y ) : 为   m a g n i t u d e   w e i g h t   f u n c t i o n , 用 为 确 保 重 要 的 边 缘 方 向 会 被 保 留 w_{m} (x,y): 为\ magnitude\ weight\ function,用为确保重要的边缘方向会被保留 wm(x,y) magnitude weight function
w d ( x , y ) : 为   d i r e c t i o n   w e i g h t   f u n c t i o n , 用 于 使 得 相 邻 的 向 量 方 向 不 会 差 距 过 大 w_{d} (x,y) :为\ direction\ weight\ function,用于使得相邻的向量方向不会差距过大 wd(x,y) direction weight function使
ϕ ( x , y ) : 则 是 当 两 向 量 夹 角 过 大 时 会 反 转 方 向 以 确 保 夹 角 不 大 于 90 度 \phi(x,y):则是当两向量夹角过大时会反转方向以确保夹角不大于 90 度 ϕ(x,y)90
通过以上方法,只需要输入kernal size 即可反复平滑边缘向量流场,直至够平滑为止


Flow-based Difference-of-Gaussians
根据 flow-based kernel 来进行 Difference-of-Gaussians(DoG) ,对每個像素沿着 ETF 垂直方向做一维的 DoG,亦即对上图中 -T~T 做 DoG

再沿着 -S~S 做一维的高斯加权:

最后进行二值化

Iterative FDoG filtering
有时候做一次 FDoG 效果并不够好,所以可以藉由反覆做 FDoG 来达到更良好的效果。
要反覆套用 FDoG 也很容易,只要将原图与 FDoG 的输出叠加,然后以这个新的图片当作原图再次套用一次 FDoG 即可。

更多推荐

一致性直线提取--Coherent Line Drawing