- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
<分区>
我现在正在尝试实现这篇论文:
Automatic Skin and Hair Masking Using Convolutional Neural Networks
我已经让 FCN 和 CRF 部分正常工作,并且在我拥有 trimap 后找到了生成 alpha 掩码的代码。
不过,我停留在 (c) 和 (d) 之间的部分。
如何在给定二进制掩码的情况下生成 trimap?论文说:
We apply morphological operators on the binary segmentation mask for hair and skin, obtaining a trimap that indicates foreground (hair/skin), background and unknown pixels. In order to deal with segmentation inaccuracies, and to best capture the appearance variance of both foreground and background, we first erode the binary mask with a small kernel, then extract the skeleton pixels as part of foreground constrain pixels. We also erode the binary mask with a larger kernel to get more foreground constrain pixels. The final foreground constrain pixels is the union of the two parts. If we only keep the second part then some thin hair regions will be gone after erosion with a large kernel. If a pixel is outside the dilated mask then we take it as background constrain pixel. All other pixels as marked as unknown, see figure 2 (d).
我是一名优秀的程序员,十分优秀!