我有3D矩阵,我想删除一些discntinuities,我想改变统计属性。我的意思是,我不想改变全球统计属性。
任何解决方案?
答案 0 :(得分:2)
我使用自制算法得到以下结果:
这个想法如下:
以下是代码:
% Load and treat image
im = imread('...');
im = im2double(im);
im = rgb2gray(im);
% Compute edges of the image
bw = edge(im);
% We want to find the positions of the strong lines in the image :
% Since they go through the whole image, we sum among x and y directions
% and then threshold.
xedges = sum(bw);
xedges = xedges > 1/3*max(xedges(:));
yedges = sum(bw,2);
yedges = yedges > 1/3*max(yedges(:));
% We create images of the same size that the original one and containing
% the horizontal and vertical lines
[xedges, yedges] = meshgrid(xedges, yedges);
% We create a 1D gaussian filter
gaussian = gausswin(12);
gaussian = gaussian / sum(gaussian);
% We filter the image among both directions
imfy = imfilter(im, gaussian);
imfx = imfilter(im, gaussian');
% We also filter the images with the lines to get the weights
xedges = im2double(xedges);
xedges = imfilter(xedges, gaussian');
xedges = xedges / max(xedges(:));
yedges = im2double(yedges);
yedges = imfilter(yedges, gaussian);
yedges = yedges / max(yedges(:));
% We use the filtered versions of the images with lines as weights between
% the original image and the filtered images
imfinal = xedges.*imfx + (1-xedges).*im;
imfinal = yedges.*imfy + (1-yedges).*imfinal;
imshow(imfinal);
答案 1 :(得分:0)
也许,您可以使用Efros等人提出的纹理合成算法:
http://graphics.cs.cmu.edu/people/efros/research/EfrosLeung.html