处理过的图像中的文物 [英] artifacts in processed images
问题描述
这个问题与我之前发布的 Matlab中的图像处理算法有关。 ,我已经得到了我想要的结果。
但现在我面临另一个问题,并在过程映像中获取一些文物。在我的原始图像(600张图像的堆栈)中,我看不到任何文物,请从指甲中看到原始图像:
但在我的10个处理结果中,我可以看到这些行:
/ p>
我真的不知道他们从哪里来?如果他们属于相机的传感器,为什么我不能看到他们在我的原始图像?任何想法?
编辑:
我已经添加了以下代码@Jonas。
%图像的平均值
im = D {1} (:,:);
for i = 2:100
im = imadd(im,D {i}(:, :));
end
im = im / 100;
imshow(im,[]);
为i = 1:100
SD {i}(:,:)= imsubtract(D {i}(:, :),im(:, :))
结束
@belisarius要求更多图片,所以我要从手指上传4张图片(1280x1024):
这里是黑色背景:
这里是一个答案,意见将比上述方法更温和地删除线:
im = imread('image.png'); %原始图片
pre>
imFiltered = im; %过滤的图像将在这里结束
imChanged = false(size(im));%记录过滤器性能
%1)
%计算每列的分数在图像
%(其中列最清晰)的下部,计算直方图中每个
%bin的均值和标准差。
histograms = hist(double(im(501:520,:)),0:255);
colMean =均值(直方图,2);
colStd = std(直方图,0,2);
%2)
%现在循环虽然每个灰度高于零和...
greyLevel = 1:255
%找到列其中灰度级像素的数量大于
%mean_n_graylevel + 3 * std_n_graylevel)。 - 这是包含
%统计许多像素与当前graylevel的列。
lineColumns = find(直方图(grayLevel + 1,:))colMean(grayLevel + 1)+ 3 * colStd(grayLevel + 1));
现在删除原始图像中lineColumns中的所有灰度像素
if(〜isempty(lineColumns))
for col = lineColumns
imFiltered(:,col) = im(:,col)。* uint8(〜(im(:,col)== grayLevel));
imChanged(:,col)= im(:col)== grayLevel;
end
end
end
imshow(imChanged)
figure,imshow(imFiltered)
以下是过滤后的图片
这显示了过滤器所影响的像素
This question is related to my previous post Image Processing Algorithm in Matlab in stackoverflow, which I already got the results that I wanted to.
But now I am facing another problem, and getting some artefacts in the process images. In my original images (stack of 600 images) I can't see any artefacts, please see the original image from finger nail:
But in my 10 processed results I can see these lines:
I really don't know where they come from?
Also if they belong to the camera's sensor why can't I see them in my original images? Any idea?
Edit:
I have added the following code suggested by @Jonas. It reduces the artefact, but does not completely remove them.
%averaging of images im = D{1}(:,:); for i = 2:100 im = imadd(im,D{i}(:,:)); end im = im/100; imshow(im,[]); for i=1:100 SD{i}(:,:)=imsubtract(D{i}(:,:),im(:,:)) end
@belisarius has asked for more images, so I am going to upload 4 images from my finger with speckle pattern and 4 images from black background size( 1280x1024 ):
And here is the black background:
解决方案Here is an answer that in opinion will remove the lines more gently than the above mentioned methods:
im = imread('image.png'); % Original image imFiltered = im; % The filtered image will end up here imChanged = false(size(im));% To document the filter performance % 1) % Compute the histgrams for each column in the lower part of the image % (where the columns are most clear) and compute the mean and std each % bin in the histogram. histograms = hist(double(im(501:520,:)),0:255); colMean = mean(histograms,2); colStd = std(histograms,0,2); % 2) % Now loop though each gray level above zero and... for grayLevel = 1:255 % Find the columns where the number of 'graylevel' pixels is larger than % mean_n_graylevel + 3*std_n_graylevel). - That is columns that contains % statistically 'many' pixel with the current 'graylevel'. lineColumns = find(histograms(grayLevel+1,:)>colMean(grayLevel+1)+3*colStd(grayLevel+1)); % Now remove all graylevel pixels in lineColumns in the original image if(~isempty(lineColumns)) for col = lineColumns imFiltered(:,col) = im(:,col).*uint8(~(im(:,col)==grayLevel)); imChanged(:,col) = im(:,col)==grayLevel; end end end imshow(imChanged) figure,imshow(imFiltered)
Here is the image after filtering
And this shows the pixels affected by the filter
这篇关于处理过的图像中的文物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!