一、matlab下图像添加噪声
clear all;
close all;
pt = '.\jp2k\';
ext = '*.bmp';
dis = dir([pt ext]);
nms = {dis.name};
for k = 1:1:length(nms)
nm = [pt nms{k}];
image = imread(nm);
g=imnoise(image,'gaussian',0.1,0.02); %加入高斯噪声
imwrite(g, strcat('./noise/pic_',num2str(k),'.bmp'));
% 对图像image进行相关操作
% G[nm]=imnoise(t,'gaussian',0.1,0.002); %加入高斯噪声
end
二、待训练图像预处理
here are four common forms of data preprocessing a data matrix X
, where we will assume that X
is of size [N x D]
(N
is the number of data, D
is their dimensionality).
1、Mean subtraction is the most common form of preprocessing. It involves subtracting the mean across every individual feature in the data, and has the geometric interpretation of centering the cl