Ask Your Question
0

How do I remove image background in Java using OpenCV?

asked 2016-12-19 11:13:49 -0500

Neel Gohel gravatar image

I want to remove background from a single image. But i cant remove background using BackgroundSubtractorMOG2.

edit retag flag offensive close merge delete

Comments

1

What do you mean with: "remove background in a image?" Is it an image or a video?

LBerger gravatar imageLBerger ( 2016-12-19 11:17:15 -0500 )edit

I have an image with white background, I want to remove that white background from image and save it to another destination.

Neel Gohel gravatar imageNeel Gohel ( 2016-12-20 01:28:24 -0500 )edit

well, wait, if your image has white background, then it is already segmentated. what do you want to replace it with ?

can it simply be, we misread your question, and you're simply asking "how to apply alpha to the bg-color ?" (which is simple image-processing, and somehow not related to opencv (computer-vision) at all !

berak gravatar imageberak ( 2016-12-20 05:39:10 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2016-12-19 22:55:12 -0500

berak gravatar image

all the BackgroundSubtractor classes need to build a model over time, and thus need many images to learn from.

if you only have a single image, the keyword is "segmentation", you could e.g. try watershed or grabCut

edit flag offensive delete link more

Comments

Can u help me with an java example?????

Neel Gohel gravatar imageNeel Gohel ( 2016-12-20 00:46:21 -0500 )edit

Thank You berak

Neel Gohel gravatar imageNeel Gohel ( 2016-12-20 05:21:30 -0500 )edit
0

answered 2016-12-20 01:15:10 -0500

hoang anh tuan gravatar image

You can refer to the following link. Section 1.7. I hope it helps you.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-12-19 11:13:49 -0500

Seen: 1,401 times

Last updated: Dec 20 '16