How do I remove the white background of any image?
Show older comments
I want to remove white backgrounds of the image and crop only the currency image portion.
4 Comments
Walter Roberson
on 17 Feb 2018
Removing the white background of any image is a quite difficult task; I suspect it is impossible to do.
Removing the white background of specific images has more hope of success.
Rosy
on 17 Feb 2018
Image Analyst
on 17 Feb 2018
Easy, but why? How is your algorithm harmed by the white frame?
Rosy
on 17 Feb 2018
Accepted Answer
More Answers (1)
mohd abdul wahed faisal faisal
on 31 Jul 2019
Edited: mohd abdul wahed faisal faisal
on 31 Jul 2019
0 votes
bro i want to remove outer white part(border) from image.while reading and showing it is happening like this.

3 Comments
Image Analyst
on 31 Jul 2019
Use imclearborder to get the mask
binaryImage = grayImage == 255
borderMask = binaryImage - imclearborder(binaryImage);
grayImage(borderMask) = 0; % or whatever value you want the border to be.
Malini Bakthavatchalam
on 10 Apr 2020
Sir I have a question. I have a color image , so I have to use the alpha layer remove background and find the median of the image histogram and then break them into two halfs like below and above the median and get the three images including the original color image, upper and lower rectified image and their corresponding histograms? I am able to make the code in bits and pieces but not whole thing as a script .
Walter Roberson
on 10 Apr 2020
What error do you encounter when you attempt to put the three parts together?
If you are able to get all three parts working separately, you could consider putting the parts into functions, so that the functions would not interfere with each other.
Categories
Find more on Neighborhood and Block Processing 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!