How to remove background from an image?

678 views (last 30 days)
Opencv
Opencv on 24 Sep 2014
Commented: Pallavi Rawat on 6 Jan 2022 at 20:30
I want to know how to remove background from an image and edge detection of the rest of the image

Accepted Answer

Meshooo
Meshooo on 24 Sep 2014
There are many ways do remove background. If you have a colored image, then you can try this
If you have a gray scale image, then you can try this
Hope it helps you.
Meshoo
  4 Comments
Pallavi Rawat
Pallavi Rawat on 6 Jan 2022 at 20:30
How can I remove the white background and have the hammer be displayed with ROI of its shape and could be dragged and dropped anywhere on the screen?

Sign in to comment.

More Answers (2)

Deepak Gala
Deepak Gala on 4 Aug 2017
  3 Comments
Image Analyst
Image Analyst on 4 May 2020
Try this:
% Display mask with 50% transparency over the "gray" image.
imshow(gray);
hold on;
h = image(255 * mask);
h.AlphaData = 0.5;

Sign in to comment.


ARUNKUMAR N B
ARUNKUMAR N B on 21 Feb 2018
Undefined function or variable 'background_removal'.
Error in bk11 (line 9) [bw,rgb]=background_removal(I);

Community Treasure Hunt

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

Start Hunting!