Scanning background noise filtering
Show older comments

Hello everybody. I am an absolutly newbie at mathlab.
I am looking for a way for removal scanning background noise for this kind of noise.
I have found some works titled "Marginal noise removal of document images", but dont know how to performe it at matlab.
I'm attaching an example of the scanning background noise talking about.
The background noise is basically at the top of the scanned image.
Thanks!
1 Comment
KALYAN ACHARJYA
on 23 Jun 2018
Share one scan image (Example)
Accepted Answer
More Answers (1)
Image Analyst
on 23 Jun 2018
The image is shaded at the top. Because the image has gray scale images in it, we can't just assume that all pixels darker than a certain amount should be set to white. So what I'd do it to get the average vertical profile of the N left most columns to look for that shading:
grayImage = rgb2gray(rgbImage);
verticalProfile = sum(grayImage(:, 1:50), 2); % Sum of 50 left most columns.
% Normalize to get a percentage of the brightest line
verticalProfile = verticalProfile / max(verticalProfile);
Now divide each column in the RGB image by that percentage. Cast to double, divide each color channel, cast back to uint8. Should be simple. Give it a try.
2 Comments
Wilbert Von
on 23 Jun 2018
Edited: Image Analyst
on 23 Jun 2018
Image Analyst
on 23 Jun 2018
You need to read the image into a variable. You can't just call imread() and not accept the data into any variable. Do this:
rgbImage = imread('jpg1.jpg');
[rows, columns, numColorChannels] = size(rgbImage);
if numColorChannels == 3
grayImage = rgb2gray(rgbImage);
else
grayImage = rgbImage;
end
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!