How to change a part of the histogram of an image in MATLAB
3 views (last 30 days)
Show older comments
Hi there,
I want to remove some parts(for example in 0-1 scale I want to remove 0.6 up to 0.9) in a RGB image. How can I do that?
I have a picture which background is white but there are noises there( the noises are like you have written something and cleared it with a rubber carelessly, so there are some shades or smth there remained), the written is with blue,black and red pens. I want to write a code that converts colors more than for example 0.8 to 1 so the background would be completely white.
Thanks in advance.
0 Comments
Answers (1)
Image Analyst
on 25 Nov 2020
You cannot remove pixels, you can only change them to a different value. What new value do you want to assign pixels that have original values in the range 0.6 to 0.9? Zero? One? What color is the background?
You forgot to attach your image. Please do so if you want more help.
4 Comments
Image Analyst
on 26 Nov 2020
I did the mask on a gray scale image, like you want. Here is an alternative way that will work with either type of image:
% Mask the image using bsxfun() function to multiply the mask by each channel individually.
% Works for gray scale as well as RGB Color images.
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask, 'like', rgbImage));
See Also
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!