一、整体Pipeline流程解析

clear all
close allsigma=10;
randn('seed', 2);
ima = double(imread('data/barbara.png'));
% 添加噪音
ima_nse = ima + sigma * randn(size(ima));figure('Position',[100 100  800 800]);
plotimage(ima_nse);
title(sprintf('Noisy: \n  PSNR %.2f', psnr(ima, ima_nse)));
set(get(gca,'Title'),'FontSize',12);%% GLOBAL VERSION: PGPCA.m
%
% 首先依据噪声大小来获取最佳参数:Patch的大小以及阈值因子
[WP factor_thr] = PGPCA_best_params(sigma);
% 最终设定的阈值 = 阈值因子 * 噪声参数sigma (可以理解为设定的阈值是以噪声sigma参数为基础的)
threshold = factor_thr * sigma;
% @(x)类似于Pythonz中的lambda匿名函数
% 此处函数的作用是将用PCA方法作用于含噪图片后的分解结构进行硬阈值处理
% 这里的func_thresholding单纯只是一个函数,还没有被调用
func_thresholding = @(ima_ppca) ...hardthresholding(ima_ppca, threshold, sigma);
% matlab使用tic和toc来统计程序运行时间
global_time=tic;
%% Patchization step
% 从含噪图片中提取大小为WP * WP的方形Patch块状结构
ima_patchs = spatial_patchization(ima_nse, WP);% 去噪的核心步骤:进行Patch的全局去噪,然后进行重建
%% Global PCA denoising step
[ima_patchs_fil ima_ppca_fil] = ...PGPCA_denoising(ima_patchs, func_thresholding);
%% Uniform reprojection step
ima_fil_PGPCA = reprojection_UWA(ima_patchs_fil);
global_time=toc(global_time);%% Display
% 展示去噪效果,并计算PSNR
figure('Position',[100 100  800 800])
plotimage(ima_fil_PGPCA);
title(sprintf('PGPCA: \n  PSNR %.2f', psnr(ima, ima_fil_PGPCA)));
sprintf('PGPCA:\n PSNR: %.2f dB \n Computing Time: %.2f s.',...psnr(ima, ima_fil_PGPCA),global_time)
set(get(gca,'Title'),'FontSize',12);%% LOCAL VERSION: PLPCA.m
[WP factor_thr hW] = PLPCA_best_params(sigma);
threshold = factor_thr * sigma;
% Shift/Redudancy  parameter for the searching zone.
delta = hW; %< 2*hW+WP;
func_thresholding = @(ima_ppca) ...hardthresholding(ima_ppca, threshold, sigma);
local_time=tic;
%% Patchization step
ima_patchs = spatial_patchization(ima_nse, WP);
%% Local PCA denoising step
ima_patchs_fil = PLPCA_denoising(ima_patchs, func_thresholding, ...hW, delta);
%% Uniform reprojection step
ima_fil_PLPCA = reprojection_UWA(ima_patchs_fil);
local_time=toc(local_time);
%% Display
figure('Position',[100 100  800 800])
plotimage(ima_fil_PLPCA);
title(sprintf('PLPCA: \n  PSNR %.2f', psnr(ima, ima_fil_PLPCA)));
set(get(gca,'Title'),'FontSize',12);
sprintf('PLPCA:\n PSNR: %.2f dB \n Computing Time: %.2f s.', ...psnr(ima, ima_fil_PLPCA),local_time)%% HIERARCHICAL VERSION:PHPCA.m
%
[WP factor_thr depth nb_axis_kept] = PHPCA_best_params(sigma);
threshold = factor_thr * sigma;
func_thresholding = @(ima_ppca) ...hardthresholding(ima_ppca, threshold, sigma);
hierarchical_time=tic;
%% Patchization step
ima_patchs = spatial_patchization(ima_nse, WP);
%% Hierarchical PCA denoising step
[ima_patchs_fil ima_ppca_fil tree] = ...PHPCA_denoising(ima_patchs, func_thresholding, ...depth, nb_axis_kept);
%% Uniform reprojection step
ima_fil_PHPCA = reprojection_UWA(ima_patchs_fil);
hierarchical_time=toc(hierarchical_time);%% Display
figure('Position',[100 100  800 800])
plotimage(ima_fil_PHPCA);
title(sprintf('PHPCA: \n  PSNR %.2f', psnr(ima, ima_fil_PHPCA)));
set(get(gca,'Title'),'FontSize',12);
sprintf('PHPCA:\n PSNR: %.2f dB \n Computing Time: %.2f s.', ...psnr(ima, ima_fil_PHPCA),hierarchical_time)

二、各类子函数代码解析

1)根据噪音参数sigma来获取最佳参数,从这里的代码来看,最佳参数的获取完全是事先预定好的:当sigma=5,10,20时,对应的patch大小都为7, 而当sigma=40时,对应的patch大小直接变成12,这其实也就是在间接说明,越大的噪音需要越大的patch来进行处理;当sigma=5,10时设置的硬阈值因子都是2.5,当sigma=20,40的时候设置的硬阈值因子直接变成2.75,这说明越大的噪音需要越大的硬阈值来进行处理(因子越大 等价于 硬阈值越大) 。

function [hP factor_thr] = PGPCA_best_params(sigma)%PGPCA_best_params        computes the parameters for PGPCA.m,
%             optimized on a small data set.
%   INPUT:
%     sigma   : standard deviation of the noise
%   OUTPUT:
%     hP          : half size of the patch
%     factor_thr  : factor in front of the variance term for
%           hardthresholding the coefficients
%
%   [hP factor_thr] = PGPCA_best_params(sigma)
%   Computes the best parameters hP and factor_thr for the using
%   PGPCA_denoising.m  for some values of noise level.
%
%   Copyright (C) 2011 GP-PCA project
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)
%
%---------------------------------------------------------------------
%
%   This file is part of GP-PCA.
%
%   GP-PCA is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as
%   published by the Free Software Foundation, either version 3 of
%   the License, or (at your option) any later version.
%
%   GP-PCA is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public
%   License along with GP-PCA.  If not, see
%   <http://www.gnu.org/licenses/>.
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)switch sigmacase 5hP = 7;factor_thr = 2.50;case 10hP = 7;factor_thr = 2.50;case 20hP = 7;factor_thr = 2.75;case 40hP = 12;factor_thr = 2.75;end

2)硬阈值处理:其实这里的sigma参数并没有用到,只是将ima_ppca.coefs中绝对值大于给定阈值的部分保留了,其余部分置0

function ima_ppca = hardthresholding(ima_ppca, threshold, sigma)%hardthresholding        Hard thresholding the PCA coefficients
%   INPUT:
%     ima_ppca    : structure of the noisy PCAs decompositions.
%     threshold   : threshold used for the hardthresholding
%     sigma   : standard deviation of the noise
%   OUTPUT:
%     ima_ppca    : sturture of of the PCAs after hardthresholding
%
%   ima_ppca = hardthresholding(ima_ppca, threshold, sigma)
%   hard thresholding of the PCA coefficients from the ima_ppca
%   structure.
%
%
%   Copyright (C) 2011 GP-PCA project
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)%---------------------------------------------------------------------
%
%   This file is part of GP-PCA.
%
%   GP-PCA is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as
%   published by the Free Software Foundation, either version 3 of
%   the License, or (at your option) any later version.
%
%   GP-PCA is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public
%   License along with GP-PCA.  If not, see
%   <http://www.gnu.org/licenses/>.
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)%   这里的维度转化感觉很奇怪,
%   貌似是因为这里的阈值计算只能使用2维来计算
%   所以得先确保coefs是2维的
%   但是为了原样还原,所以必须得记录之前的维度信息coefs = ima_ppca.coefs;if size(coefs, 3) > 1 %如果coefs第三个维度的长度大于1,其实也就是在说coefs有三个维度isimage = 1;[M,N,P] = size(coefs);MN = M*N;coefs = reshape(coefs, MN, P);elseisimage = 0;[MN,P] = size(coefs);endcoefs = coefs .* (threshold < abs(coefs)); %保留coefs中绝对值大于阈值的部分if isimageima_ppca.coefs = reshape(coefs, M, N, P);elseima_ppca.coefs = reshape(coefs, MN, P);end

3)**空间PATCH块提取:这里无需进行任何形式的padding,只需要按照从左到右、从上到下的顺序滑动来获取每一个patch, 从左到右的每个patch是紧紧相互邻接的,也可以说stride=1,;从上到下的每个patch也是同样。因为没有设置padding,所以从原始图片中提取的总的patch数目是不等于原始图像的总像素数。这里返回了两个数据,一个是提取到的每一个patch数据, 即ima_patchs(size为【每列对应的patch数,每行对应的patch数,一个patch对应的像素总数WP * WP】), 另一个是原始图像中的每个像素点出现在patch中的次数,也就是每个像素点对应多少个Patch).

function [ima_patchs, ima_normalization] = spatial_patchization(im_ini,WP)%spatial_patchization computes the collection of patches extracted from an image
%
%   INPUT:
%     im_ini             : image of interest
%     WP                  : width of the square patches to consider
%
%   OUTPUT:
%     ima_patchs         : the collection of all the patches
%     ima_normalization  : number of patches to which each pixel belongs
%
%  [ima_patchs, ima_normalization] = spatial_patchization(im_ini,WP)
%   computes the whole collecitons of  the patches of size WP x WP
%   of an image im_ini. It also provides the number of patches to
%   which each pixel belongs in the image.
%
%
%   Copyright (C) 2011 GP-PCA project
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)%---------------------------------------------------------------------
%
%   This file is part of GP-PCA.
%
%   GP-PCA is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as
%   published by the Free Software Foundation, either version 3 of
%   the License, or (at your option) any later version.
%
%   GP-PCA is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public
%   License along with GP-PCA.  If not, see
%   <http://www.gnu.org/licenses/>.
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)[m,n] = size(im_ini);
ima_patchs=zeros(m-WP+1,n-WP+1,WP^2);
ima_normalization=zeros(m,n);for i=1:(m-WP+1)for j=1:(n-WP+1)xrange = mod((i:i+WP-1)-1,m)+1; % (m:n)包括m到n的所有整数,m和n都是闭区间yrange = mod((j:j+WP-1)-1,n)+1; B = im_ini(xrange, yrange);ima_patchs(i,j,:) = B(:);ima_normalization(xrange, yrange) = ...ima_normalization(xrange, yrange) + ones(WP,WP);end
end

4)PGPCA去噪核心部分:主要是做了三件事情,首先是对从图像上提取的所有patch进行PCA分解,得到PCA分解的结果,对应于 ima_ppca = ppca(ima_patchs)部分【1】;然后是对PCA分解的结果进行一个硬阈值来过滤掉噪音,对应于 ima_ppca_fil = func_thresholding(ima_ppca)部分【2】,返回的是一个去噪后的PCA分解结果;最后是对这个去噪后的PCA分解结果进行重建,重建得到的不是完整的这个图像,而是去噪图像理论上所有的patch块, 对应于代码ima_patchs_fil = reconstruction_ppca(ima_ppca_fil)【3】部分。在完成这些之后,在主程序会调用reprojection_UWA【4】部分从所有的patch块来还原出去噪后的完整图像,这个过程也就是从所有的patch块中来计算得到完整图像中每个像素点的值。

function [ima_patchs_fil ima_ppca_fil] = ...PGPCA_denoising(ima_patchs, func_thresholding)
%PGPCA_denoising  computes the denoised patches, denoised image
%                 and tree structure using PLPCA (local PCAs)
%
%   INPUT:
%     ima_patchs     : a collection of (noisy) patches
%     func_thresholding  : function that used to threshold the coefficients
%   OUTPUT:
%     ima_patchs_fil     : structure of of the PCAs after func_thresholding
%                          reprojected in the space of patches
%     ima_ppca_fil       : structure of of the PCAs after func_thresholding
%                          but in the PCA domain
%
%   [ima_patchs_fil ima_ppca_fil] = ...
%        PGPCA_denoising(ima_patchs, func_thresholding)
%
%
%%   Copyright (C) 2011 GP-PCA project
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)%---------------------------------------------------------------------
%
%   This file is part of GP-PCA.
%
%   GP-PCA is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as
%   published by the Free Software Foundation, either version 3 of
%   the License, or (at your option) any later version.
%
%   GP-PCA is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public
%   License along with GP-PCA.  If not, see
%   <http://www.gnu.org/licenses/>.
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)ima_ppca = ppca(ima_patchs);ima_ppca_fil = func_thresholding(ima_ppca); % 还是结构体,只不过进行了噪音过滤ima_patchs_fil = reconstruction_ppca(ima_ppca_fil); %(506,506,49)

[1] 重点是将每个patch对应的49个像素点张成一维的向量,然后再进行PCA分解:

function patchs_ppca = ppca(patchs)%ppca  computes the PCA of a collection of patches
%
%   INPUT:
%     patchs       : a collection of (noisy) patches
%   OUTPUT:
%     patchs_ppca  : structure of of the PCAs (coefficients +components)
%
%
%patchs_ppca = ppca(patchs) computes the pca structures in patch_ppca of the
% collection of patches from patchs.
%
%   Copyright (C) 2011 GP-PCA project
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)
%
%---------------------------------------------------------------------
%
%   This file is part of GP-PCA.
%
%   GP-PCA is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as
%   published by the Free Software Foundation, either version 3 of
%   the License, or (at your option) any later version.
%
%   GP-PCA is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public
%   License along with GP-PCA.  If not, see
%   <http://www.gnu.org/licenses/>.
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)if size(patchs, 3) > 1isimage = 1;[M,N,P] = size(patchs);MN = M*N;patchs = reshape(patchs, MN, P);elseisimage = 0;[MN,P] = size(patchs);end% 计算平均值,patchs 256036 * 49% cst_patchs 256036 * 1cst_patchs = mean(patchs,2);% pc_axis是pca的主成分或者说新坐标轴,(49, 49)% patchs_newbasis是新坐标轴上X的新坐标系数,(256036, 49)% varaxis是每个轴上的方差或者说特征值 (49,1)% patchs - cst_patchs * ones(1, P)就是对每一行的元素减去该行元素的均值% 而前面已经知道每一行元素实际对应于一个patch,所以这里实际上是对每个patch内的元素去均值化[pc_axis,patchs_newbasis,varaxis] = ...princomp_eig(patchs - cst_patchs * ones(1, P));% 【(256036, 1), (256036, 48)】patchs_ppca.coefs = [ cst_patchs*sqrt(P) patchs_newbasis(:,1:end-1) ];patchs_ppca.iddico = ones(MN,1); % (256036,1)%patchs_ppca.score_rpjct=ones(M,N);patchs_ppca.dicos{1}.size = P;% 【(49,1)(49,48)】patchs_ppca.dicos{1}.axis = [1/sqrt(P)*ones(P,1) pc_axis(:,1:end-1)];% (1,49)所有patch在49个像素点上各自的均值patchs_ppca.dicos{1}.mean = mean(patchs - cst_patchs * ones(1, P), 1);% 【0; (48, 1)】patchs_ppca.dicos{1}.varaxis = [0; varaxis(1:end-1)];if isimagepatchs_ppca.iddico = reshape(patchs_ppca.iddico, M, N); % (506, 506)patchs_ppca.coefs = reshape(patchs_ppca.coefs, M, N, P); % (506,506,49)end


[2] 对应于2)硬阈值部分
[3] 重点是每一部分patch重建的过程

function patchs = reconstruction_ppca(patchs_pca)%reconstruction  computes the values of the patches, knowing the
%        structure (dico+coefs) of the patch_pca
%
%   INPUT:
%     patchs_pca     : structures of the patches in the PCA basis%   OUTPUT:
%     patchs             : the patches in original domain
%
%patchs = reconstruction_ppca(patchs_pca)
%   computes the patchs values knowing patchs_pca, the structure
%   of those patches in the space spanned by dicos.
%
%see also reconstruction.m and prejection.m (inverse operation)
%
%   Copyright (C) 2011 GP-PCA project
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)
%   Copyright (C) 2011 GP-PCA project
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)%---------------------------------------------------------------------
%
%   This file is part of GP-PCA.
%
%   GP-PCA is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as
%   published by the Free Software Foundation, either version 3 of
%   the License, or (at your option) any later version.
%
%   GP-PCA is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public
%   License along with GP-PCA.  If not, see
%   <http://www.gnu.org/licenses/>.
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)% 获取重建图像需要的参数,% 需要在新坐标轴上的坐标参数coefs、% 其他信息dicos(包括每个patch的像素数,每个patch去均值化后的均值,新的坐标轴、每个新坐标轴上的方差)if size(patchs_pca.coefs, 3) > 1isimage = 1;[M,N,P] = size(patchs_pca.coefs);MN = M*N;coefs = reshape(patchs_pca.coefs, MN, P);iddico = reshape(patchs_pca.iddico, MN, 1); % iddico很奇怪,其所有值全部为1而已elseisimage = 0;[MN,P] = size(patchs_pca.coefs);coefs = patchs_pca.coefs;iddico = patchs_pca.iddico;end% (49,49) -> 49P = size(patchs_pca.dicos{1}.axis, 1);% 1L = length(patchs_pca.dicos);% 初始化待重构的图片所有像素值为0patchs = zeros(MN, P);for i = 1:L% 【(256036,1)* (1,256036)的转置 】的转置= (256036,1)的转置 = (1,256036)% 这个到底在说什么意思呢% 其实就是获取有效的索引,这里的索引对应的是从原图片中提取出来的所有patchidx = ((iddico == i) .* (1:(MN))')';% ?应该都是大于0的吧idx = idx(idx > 0);K = size(idx, 2); % 有效索引的个数subK = min(K, 10000);k = 1;% 迭代重建过程:疑问的是这里为什么是从2开始的?% (1:1000) + 1 ==> (2: 1001)%  (1: 1000) + 246035(K - subK - 1) ==> (K - subK, K - 1)while k < K - subK% (1,1000)range = (1:subK) + k;% 按顺序依次获取一部分patch, 这里对coefs是进行行索引subcoefs = coefs(idx(range), :);% 个人理解应该是将新坐标变换回旧坐标 并加上相应的均值patchs(idx(range), :) = ...subcoefs * patchs_pca.dicos{i}.axis' + ... % (1000,49) * (49, 49)ones(size(range, 2), 1) * patchs_pca.dicos{i}.mean; % (1000,1) * (1,49)%repmat(patchs_pca.dicos{i}.mean, size(range, 2), 1);clear subcoefs;k = k + subK;end% 对剩下长度不足subKd的所有patch来进行重建if k <= Krange = (k:K);subcoefs = coefs(idx(range), :);patchs(idx(range), :) = ...subcoefs * patchs_pca.dicos{i}.axis' + ...ones(size(range, 2), 1) * patchs_pca.dicos{i}.mean;%repmat(patchs_pca.dicos{i}.mean, size(range, 2), 1);clear subcoefs;endendclear coefs;clear iddico;if isimagepatchs = reshape(patchs, M, N, P); % (506,506,49(end

[4]重点是叠加像素值然后求平均值

function ima = reprojection_UWA(ima_patchs,xg,yg)%reprojection_UWA  compute uniform weight reprojections from
%        patches to pixels values
%
%   INPUT:
%     ima_patchs      : values of the collection of patches
%     xg, yg          : Initial values of the image/normalization, default are
%                xg = zeros(M,N);
%                    yg = zeros(M,N);
%   OUTPUT:
%     ima             : image in the original domain
%
%ima = reprojection_UWA(ima_patchs,xg,yg)
%   computes the pixels values knowing the values of the whole collections of
%   the patches of an image. The reprojection is uniform.
%
%
%   Copyright (C) 2011 GP-PCA project
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)
%
%---------------------------------------------------------------------
%
%   This file is part of GP-PCA.
%
%   GP-PCA is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as
%   published by the Free Software Foundation, either version 3 of
%   the License, or (at your option) any later version.
%
%   GP-PCA is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public
%   License along with GP-PCA.  If not, see
%   <http://www.gnu.org/licenses/>.
%   Charles Deledalle, Joseph Salmon, Arnak S. Dalalyan
%
%   See The GNU Public License (GPL)[M, N, P] = size(ima_patchs);if nargin <= 2  %判断有几个输入参数% 感觉这里xg和yg都没有什么用,因为后面根本用不到,就算用到了值也全部是0,没有发生任何更新xg = zeros(M,N);yg = zeros(M,N);endp = sqrt(P);ima = zeros(M+p-1, N+p-1);norm = zeros(M+p-1, N+p-1);% 就是把去噪后的patch依次叠加在同原始图片一样大的图片画布上% 并且统计每个像素点的值是来自多少个patch的叠加% 然后进行一个平均就可以了for i = 1:Mfor j = 1:Nxrange = mod(round((i-1)+(1:p)+xg(i,j))-1,M+p-1)+1;%(i,i+p-1)yrange = mod(round((j-1)+(1:p)+yg(i,j))-1,N+p-1)+1;% (j, j+p-1)ima(xrange, yrange) = ...ima(xrange, yrange) + ...reshape(ima_patchs(i,j,:), p, p);norm(xrange, yrange) = ...norm(xrange, yrange) + ...1;endendima = ima ./ norm;clear norm;

PGPCA、PHPCA、PLPCA去噪代码解析相关推荐

  1. ECCV2020|图像重建(超分辨率,图像恢复,去雨,去雾等)相关论文汇总(附论文链接/代码/解析)

    转载自https://zhuanlan.zhihu.com/p/180551773 原帖地址: ECCV2020|图像重建/底层视觉(超分辨率,图像恢复,去雨,去雾,去模糊,去噪等)相关论文汇总(附论 ...

  2. matrix_multiply代码解析

    matrix_multiply代码解析 关于matrix_multiply 程序执行代码里两个矩阵的乘法,并将相乘结果打印在屏幕上. 示例的主要目的是展现怎么实现一个自定义CPU计算任务. 参考:ht ...

  3. CornerNet代码解析——损失函数

    CornerNet代码解析--损失函数 文章目录 CornerNet代码解析--损失函数 前言 总体损失 1.Heatmap的损失 2.Embedding的损失 3.Offset的损失 前言 今天要解 ...

  4. 视觉SLAM开源算法ORB-SLAM3 原理与代码解析

    来源:深蓝学院,文稿整理者:何常鑫,审核&修改:刘国庆 本文总结于上交感知与导航研究所科研助理--刘国庆关于[视觉SLAM开源算法ORB-SLAM3 原理与代码解析]的公开课. ORB-SLA ...

  5. java获取object属性值_java反射获取一个object属性值代码解析

    有些时候你明明知道这个object里面是什么,但是因为种种原因,你不能将它转化成一个对象,只是想单纯地提取出这个object里的一些东西,这个时候就需要用反射了. 假如你这个类是这样的: privat ...

  6. python中的doc_基于Python获取docx/doc文件内容代码解析

    这篇文章主要介绍了基于Python获取docx/doc文件内容代码解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 整体思路: 下载文件并修改后缀 ...

  7. mongoose框架示例代码解析(一)

    mongoose框架示例代码解析(一) 参考: Mongoose Networking Library Documentation(Server) Mongoose Networking Librar ...

  8. ViBe算法原理和代码解析

    ViBe - a powerful technique for background detection and subtraction in video sequences 算法官网:http:// ...

  9. 【Android 逆向】使用 Python 代码解析 ELF 文件 ( PyCharm 中进行断点调试 | ELFFile 实例对象分析 )

    文章目录 一.PyCharm 中进行断点调试 二.ELFFile 实例对象分析 一.PyCharm 中进行断点调试 在上一篇博客 [Android 逆向]使用 Python 代码解析 ELF 文件 ( ...

最新文章

  1. component-scan和annotation-driven
  2. python画树叶-手把手|如何用Python绘制JS地图?
  3. Java中的对象序列化操作
  4. VMware View 与 Citrix Xendesktop 管理大比拼
  5. iPhone设备分辨率及尺寸
  6. 【leetcode】16 3Sum Closest
  7. 不使用资源文件动态创建对话框的做法
  8. 麦克纳姆轮全向移动机器人速度空间分析
  9. JavaScript学习笔记(3)——JavaScript与HTML的组合方式
  10. GIS 矢量切片(Vector Tile)-地图定制化的时代
  11. Unity3D mac版汉化教程
  12. 机器人学笔记之——空间描述和变换:位置、姿态与坐标系
  13. for循环实现质数python_少儿编程Python第4课-for循环语句(质数判断)
  14. 【算法设计与分析】三个博弈论算法分析
  15. Rafy 开源贡献中心 - 组织成立,并试运行一月小结
  16. 如何开发微信第三方小程序组件
  17. html5 商品分类页面效果zepto
  18. 毛概(毛中特)期末/考研复习笔记——导论
  19. css和php区别,「php」css与html的区别是什么?css与html区别比照
  20. 思科系统命令行输入快捷键

热门文章

  1. TI RTOS Kernel
  2. 未雨绸缪 美十余家车企开始共享安全数据
  3. 细思极恐,原来12306架构这么牛逼
  4. LeetCode - 环形链表
  5. 手机扫描银行卡的技术
  6. python输入直角三角形_如何使用python打印直角三角形,等边三角形,菱形,正方形...
  7. 书籍集锦——关于深度学习
  8. mongoDB大数据查询坑
  9. 2005年日语一级听力原文
  10. CargoWise One认证考试介绍