图像阴影修复

去模糊算法笔记:

去模糊算法笔记_AI视觉网奇的博客-CSDN博客

知乎图像修复:

CVPR 2021 论文大盘点-图像修复篇 - 知乎

Generating Diverse Structure for Image Inpainting With Hierarchical VQ-VAE

提出一种基于分层 VQ-VAE 的 multiple-solution 图像修复方法。该方法与以前的方法相比有两个区别:首先,该模型在离散的隐变量上学习自回归分布。第二,该模型将结构和纹理特征分开。提出为结构特征的分布学习一个条件自回归网络。该网络能够产生具有高度多样性的合理结构。对于纹理生成,提出一个结构注意力模块,用来捕捉结构特征的远距离相关性。还提出两个新的特征损失,以改善结构的一致性和纹理的真实性。

在三个基准数据集(包括CelebA-HQ、Places2和ImageNet)上进行的广泛实验表明,所提出的方法在质量和多样性方面都有优势。

作者 | Jialun Peng, Dong Liu, Songcen Xu, Houqiang Li

单位 | 中国科学技术大学;诺亚方舟实验室

论文 | https://arxiv.org/abs/2103.10022

代码 | https://github.com/USTC-JialunPeng/Diverse-Structure-Inpainting

图像输入是256*256 

TransFill: Reference-guided Image Inpainting by Merging Multiple Color and Spatial Transformations

文中提出 TransFill,一种多同域转换的融合方法,通过参考与目标图像共享场景内容的另一个源图像来填补这个洞。首先通过估计由不同深度级引导的多个同构图,将源图像与目标图像对齐。然后,学习调整颜色,并对每个同传扭曲的源图像应用像素级的扭曲,使其与目标图像更加一致。最后,学习一个像素级的融合模块来选择性地合并不同的方案。所提出方法在各种宽基线和颜色差异的图像对上实现了最先进的性能,并可泛化到用户提供的图像对。

作者 | Yuqian Zhou, Connelly Barnes, Eli Shechtman, Sohrab Amirghodsi

单位 | 伊利诺伊大学厄巴纳-香槟分校;Adobe Research

论文 | https://arxiv.org/abs/2103.15982

代码 | https://github.com/yzhouas/TransFill-Reference-Inpainting

主页 | https://yzhouas.github.io/projects/TransFill/index.html

Image Inpainting with External-internal Learning and Monochromic Bottleneck

作者称这是首个将 external-internal 学习方法用于深度图像修复的工作,通过在大型数据集上进行训练,从外部学习语义知识,同时充分利用单幅测试图像的内部统计数据。设计一个渐进式的内部色彩复原网络,可实现出色的色彩化性能。将所提出的方法推广到多个深度修复模型,并在多个数据集上观察到视觉质量和模型泛化能力的明显改善。

作者 | Tengfei Wang, Hao Ouyang, Qifeng Chen

单位 | 香港科技大学

论文 | https://arxiv.org/abs/2104.09068

代码 | https://github.com/Tengfei-Wang/external-internal-inpainting

PD-GAN: Probabilistic Diverse GAN for Image Inpainting

基于 vanilla GAN,提出 PD-GAN 通过所提出的 SPDNorm 对随机噪声向量的深度特征进行调制,以纳入上下文约束。以及提出一种感知上的多样性损失,以增强网络多样性。

在基准数据集上的实验表明,PD-GAN 能够有效地生成多样的、视觉上真实的图像修补内容。

作者 | Hongyu Liu, Ziyu Wan, Wei Huang, Yibing Song, Xintong Han, Jing Liao

单位 | 虎牙;香港城市大学;湖南大学;腾讯

论文 | https://arxiv.org/abs/2105.02201

代码 | https://github.com/KumapowerLIU/PD-GAN

Image Inpainting Guided by Coherence Priors of Semantics and Textures

本文提出一个新的语义分割和图像修复的联合优化框架,利用语义和纹理之间存在的一致性先验来解决复杂的 holes inpainting 问题。为了解决不相关的纹理填充问题,提出一个语义上的注意力传播模块,以优化来自同一语义区域的预测纹理,以及两个一致性损失来约束同一图像中语义和纹理的一致性。

实验结果表明,所提出方法可以有效地生成有细致的语义结构和纹理细节。

作者 | Liang Liao, Jing Xiao, Zheng Wang, Chia-Wen Lin, Shin'ichi Satoh

单位 | National Institute of Informatics;武汉大学;台湾清华大学

论文 | https://arxiv.org/abs/2012.08054

图像恢复(Image Restoration )

改进数据合成方法用于真实图像恢复

[8].CycleISP: Real Image Restoration via Improved Data Synthesis

作者 | Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, Ming-Hsuan Yang, Ling Shao

单位 | IIAI;加州大学美熹德分校;谷歌

代码 | https://github.com/swz30/CycleISP

备注 | CVPR 2020 Oral

深度学习进修阴影检测

https://github.com/jacke121/DSC

matlab能修复:

https://github.com/kittenish/Image-Shadow-Detection-and-Removal

效果不好:

https://github.com/zyr17/ShadowRemoval

python的:

https://github.com/srijan-mishra/Shadow-Removal

shadowRemoval

没图:

https://github.com/cjc96/shadowRemoval

https://github.com/sbbug/Researching-Image-Shadow-Removal

https://github.com/abhiishekpal/Shadow-Removal

https://github.com/Orcuslc/ShadowRemoval

https://github.com/mykhailomostipan/shadow-removal

https://github.com/Rakosi/shadow-removal

这个代码还需再看:

https://codeday.me/bug/20190322/804326.html

#!/usr/bin/env python
# -*- coding: utf-8 -*-

#############
# LIBRARIES
#############
import numpy as np
import cv2
import os
import sys
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
from PIL import Image
import scipy
from scipy.optimize import leastsq
from scipy.stats.mstats import gmean
from scipy.signal import argrelextrema
from scipy.stats import entropy

if __name__ == '__main__':

    # Get Image
    img = cv2.imread("d:/shudong.jpg")
    img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
    h, w = img.shape[:2]

    plt.imshow(img)
    plt.title('Original')
    plt.show()

    img = cv2.GaussianBlur(img, (5,5), 0)

    # Separate Channels
    r, g, b = cv2.split(img)

    im_sum = np.sum(img, axis=2)
    im_mean = gmean(img, axis=2)

    # Create "normalized", mean, and rg chromaticity vectors
    #  We use mean (works better than norm). rg Chromaticity is
    #  for visualization
    n_r = np.ma.divide( 1.*r, g )
    n_b = np.ma.divide( 1.*b, g )

    mean_r = np.ma.divide(1.*r, im_mean)
    mean_g = np.ma.divide(1.*g, im_mean)
    mean_b = np.ma.divide(1.*b, im_mean)

    rg_chrom_r = np.ma.divide(1.*r, im_sum)
    rg_chrom_g = np.ma.divide(1.*g, im_sum)
    rg_chrom_b = np.ma.divide(1.*b, im_sum)

    # Visualize rg Chromaticity --> DEBUGGING
    rg_chrom = np.zeros_like(img)

    rg_chrom[:,:,0] = np.clip(np.uint8(rg_chrom_r*255), 0, 255)
    rg_chrom[:,:,1] = np.clip(np.uint8(rg_chrom_g*255), 0, 255)
    rg_chrom[:,:,2] = np.clip(np.uint8(rg_chrom_b*255), 0, 255)

    plt.imshow(rg_chrom)
    plt.title('rg Chromaticity')
    plt.show()

    #-----------------------
    ## 2. Take Logarithms ##
    #-----------------------

    l_rg = np.ma.log(n_r)
    l_bg = np.ma.log(n_b)

    log_r = np.ma.log(mean_r)
    log_g = np.ma.log(mean_g)
    log_b = np.ma.log(mean_b)

    ##  rho = np.zeros_like(img, dtype=np.float64)
    ##
    ##  rho[:,:,0] = log_r
    ##  rho[:,:,1] = log_g
    ##  rho[:,:,2] = log_b

    rho = cv2.merge((log_r, log_g, log_b))

    # Visualize Logarithms --> DEBUGGING
    plt.scatter(l_rg, l_bg, s = 2)
    plt.xlabel('Log(R/G)')
    plt.ylabel('Log(B/G)')
    plt.title('Log Chromaticities')
    plt.show()

    plt.scatter(log_r, log_b, s = 2)
    plt.xlabel('Log( R / 3root(R*G*B) )')
    plt.ylabel('Log( B / 3root(R*G*B) )')
    plt.title('Geometric Mean Log Chromaticities')
    plt.show()

    #----------------------------
    ## 3. Rotate through Theta ##
    #----------------------------
    u = 1./np.sqrt(3)*np.array([[1,1,1]]).T
    I = np.eye(3)

    tol = 1e-15

    P_u_norm = I - u.dot(u.T)
    U_, s, V_ = np.linalg.svd(P_u_norm, full_matrices = False)

    s[ np.where( s <= tol ) ] = 0.

    U = np.dot(np.eye(3)*np.sqrt(s), V_)
    U = U[ ~np.all( U == 0, axis = 1) ].T

    # Columns are upside down and column 2 is negated...?
    U = U[::-1,:]
    U[:,1] *= -1.

    ##  TRUE ARRAY:
    ##
    ##  U = np.array([[ 0.70710678,  0.40824829],
    ##                [-0.70710678,  0.40824829],
    ##                [ 0.        , -0.81649658]])

    chi = rho.dot(U)

    # Visualize chi --> DEBUGGING
    plt.scatter(chi[:,:,0], chi[:,:,1], s = 2)
    plt.xlabel('chi1')
    plt.ylabel('chi2')
    plt.title('2D Log Chromaticities')
    plt.show()

    e = np.array([[np.cos(np.radians(np.linspace(1, 180, 180))), \
                   np.sin(np.radians(np.linspace(1, 180, 180)))]])

    gs = chi.dot(e)

    prob = np.array([np.histogram(gs[...,i], bins='scott', density=True)[0]
                      for i in range(np.size(gs, axis=3))])

    eta = np.array([entropy(p, base=2) for p in prob])

    plt.plot(eta)
    plt.xlabel('Angle (deg)')
    plt.ylabel('Entropy, eta')
    plt.title('Entropy Minimization')
    plt.show()

    theta_min = np.radians(np.argmin(eta))

    print('Min Angle: ', np.degrees(theta_min))

    e = np.array([[-1.*np.sin(theta_min)],
                  [np.cos(theta_min)]])

    gs_approx = chi.dot(e)

    # Visualize Grayscale Approximation --> DEBUGGING
    plt.imshow(gs_approx.squeeze(), cmap='gray')
    plt.title('Grayscale Approximation')
    plt.show()

    P_theta = np.ma.divide( np.dot(e, e.T), np.linalg.norm(e) )

    chi_theta = chi.dot(P_theta)
    rho_estim = chi_theta.dot(U.T)
    mean_estim = np.ma.exp(rho_estim)

    estim = np.zeros_like(mean_estim, dtype=np.float64)

    estim[:,:,0] = np.divide(mean_estim[:,:,0], np.sum(mean_estim, axis=2))
    estim[:,:,1] = np.divide(mean_estim[:,:,1], np.sum(mean_estim, axis=2))
    estim[:,:,2] = np.divide(mean_estim[:,:,2], np.sum(mean_estim, axis=2))

    plt.imshow(estim)
    plt.title('Invariant rg Chromaticity')
    plt.show()

  • 1
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI算法网奇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值