0

Please hold before downgrading the Question. I am not looking for a segmentation or detection algorithm/library.

I have also seen this Post

Remove background of the image using opencv Python

But the solution marked correct is again what I don't want. I want exactly

What are the ways to Subtract the BACKGROUND image from FOREGROUND?

Input:

  1. Background Image without vehicle like the above post
  2. Foreground Image with the vehicle

Output:

  1. Vehicle

Be kind and thanks for the help.

Link to the Input Images Input

Link to the Output Output

  • 2
    Doesn't make sense to me. What's specifically wrong with the result of the accepted answer? Please attach an image of YOUR desired output. maybe manually drawn. – HansHirse Feb 01 '21 at 10:44
  • updated Question, I must process the background image with the foreground image and get output. – user7657688 Feb 01 '21 at 10:54
  • 1
    Does this answer your question? [Remove background of the image using opencv Python](https://stackoverflow.com/questions/42294109/remove-background-of-the-image-using-opencv-python) – Gulzar Feb 01 '21 at 11:06
  • voted to close because your question is the same, and you made no distinction even though you were asked to. Please state what is different about your question, and attach required output (which is different, or this is a duplicate) – Gulzar Feb 01 '21 at 11:07
  • does [this](https://stackoverflow.com/a/64789446/11803249) answers you question? – Shoaib Mirzaei Feb 01 '21 at 11:35
  • Or perhaps this will help: https://docs.opencv.org/3.4/d1/dc5/tutorial_background_subtraction.html – beaker Feb 01 '21 at 16:39
  • @Gulzar The same Question I mentioned that It doesn't work according to my requirements – user7657688 Feb 03 '21 at 04:30
  • @ShoaibMirzaei dear this one is really bad considering Speed. I left because of Speed limitation. – user7657688 Feb 03 '21 at 04:32
  • @beaker No this one also didn't work but yes helped me in searching – user7657688 Feb 03 '21 at 04:33
  • @user7657688 how are your requirements different? – Gulzar Feb 03 '21 at 10:26
  • @Gulzar the problem is I tried with backgroundSubtractorKNN it didn't work but MOG works because MOG takes multiple frames to learn rather than single one. – user7657688 Feb 06 '21 at 08:41

1 Answers1

0

OpenCV background Subtractor models Documentation

After a lot of testing, Videos based MOG/MOG2 works better than single Image based background subtraction with KNN.

This article solved my problem