필터 지우기
필터 지우기

remove the colored scratches from this image

조회 수: 6 (최근 30일)
lotus whit
lotus whit 2015년 5월 6일
편집: darova 2020년 6월 11일
could you please ask how i can remove the colored lines from this image ?
help me please

답변 (1개)

jmac
jmac 2020년 6월 11일
Try median filtering only on points segmented by color..
In a blunt quick pass, I was able to fade away the blue and the red lines, considerably, using:
% Read the image and make a copy
A=imread(image.jpg');
B=A;
[m,n,~]=size(A);
% Blunt color segmentation (can improve by working on the color space)
M=(A(:,:,1)>A(:,:,2))&(A(:,:,2)<A(:,:,3));
[i,j]=find(M);
mask=find((i>w)&(i<m-w)&(j>w)&(j<n-w));
% Median filtering on the segmented pixels (can fine tune the right width)
w=15;
for k=1:numel(mask)
x=i(mask(k));
y=j(mask(k));
B(x,y,1)=median(A(x-w:x+w,y-w:y+w,1),'all');
B(x,y,2)=median(A(x-w:x+w,y-w:y+w,2),'all');
B(x,y,3)=median(A(x-w:x+w,y-w:y+w,3),'all');
end
% Result in B
With some fine tuning you might get it to work better. Could also think of a vector implementation to make it quicker.
The black line is harder to segment with color, so would have to use some directional filter (which could mess up the hair).
You can also start by smoothing out the halftone.

카테고리

Help CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by