Background Subtraction - OpenCV 3.4 with python 3 Tutorial 32

Поділитися
Вставка
  • Опубліковано 3 гру 2024
  • We’re going to learn in this tutorial how to subtract the background on a video.
    Instructions and source code: pysource.com/20...
    ➤ Full Videocourses:
    Object Detection: pysource.com/o...
    ➤ Follow me on:
    Instagram: / pysource7
    LinkedIn: / pysource
    ➤ For business inquiries:
    pysource.com/c...

КОМЕНТАРІ • 51

  • @Analyse_US
    @Analyse_US 5 років тому

    Thanks - Excellent demonstration & tutorial.

  • @benoitd94
    @benoitd94 Рік тому

    Good video. For you what is the best solution to extract only shadow of 2 images capture with a camera at 2 seconds of interval?

  • @GabrielAlmeida-pm5yq
    @GabrielAlmeida-pm5yq 5 років тому

    Very good video, thank you so much!

  • @tchamim
    @tchamim 4 роки тому +2

    Hi, i have some question. Is it possible after apply the background subtraction, instead of getting the output in binary image, i want to get the original colour of the extracted foreground ?

    • @rubenantonio141
      @rubenantonio141 4 роки тому

      Pass the values of the mask into 1 and 0 where all of values equals 255 pass to 1, to do this use a numpy.where. After this multiply this new mask by original frame.
      Hope can help you. :)

  • @kavuruvamsikrishna02
    @kavuruvamsikrishna02 5 років тому

    nice explanation...thanks

  • @xiaoyangma4589
    @xiaoyangma4589 5 років тому

    amazing work!

  • @yacinerouizi844
    @yacinerouizi844 2 роки тому

    thank you

  • @PARTHASARATHISAMANTARAY
    @PARTHASARATHISAMANTARAY 4 роки тому

    Thank you for explaination

  • @AI_CANISTER
    @AI_CANISTER 4 роки тому

    Sir, you have find the difference between a single frame and a looping frame,,, so some of the cars in the single frame stand still and that way the camera have to be stable if not it won't work properly...
    👇
    I think you should find difference of two frames(looping)...... Both first and second frame should be in the while loop..... It works properly....

  • @hayoungkim7010
    @hayoungkim7010 5 років тому

    Thank you. Helps me a lot. One question. Can we get background image reducing foreground image? I have an image and need to remove foreground. If you know please help me. :)

  • @jinhuacao253
    @jinhuacao253 5 років тому

    thanks for the great video

  • @rithvikrthampy
    @rithvikrthampy 5 років тому

    How do i just find the background from the video @Pysource

  • @sparklesmastiyo1642
    @sparklesmastiyo1642 3 роки тому

    How to remove shadow in the same example? Can you please help me

  • @samirakhrif3098
    @samirakhrif3098 4 роки тому

    How i can count number of the frame between 2 line,please

  • @bhimsendabby
    @bhimsendabby 6 років тому

    Thanku sir good tutorial

  • @augustomenezesbrittodossan5171
    @augustomenezesbrittodossan5171 6 років тому

    Hi, my name is Augusto.
    I really appreciate you tutorials using OpenCV, congratulations!
    Could you please post a tutorial of how to recognize and detect brazilians or other countries plates, independent of the car color?
    Thanks a lot,
    Augusto.

    • @pysource-com
      @pysource-com  6 років тому +1

      I will do it, but first I have to complete the tutorials with more technical things :)

    • @augustomenezesbrittodossan5171
      @augustomenezesbrittodossan5171 6 років тому

      Pysource thanks.
      I'll waiting for the next tutorials, congratulations.

    • @jerrychan3055
      @jerrychan3055 6 років тому

      is this what u want? arxiv.org/pdf/1802.09567.pdf

  • @trzywu
    @trzywu 6 років тому

    Great tutorials, I almost finished all of your videos. I have one question. Why do you not use this command fps = cap.get(cv2.CAP_PROP_FPS) to get proper speed of the read video? I hope to see new tutorials in close future :)

    • @pysource-com
      @pysource-com  6 років тому +3

      hi, thanks for your comment, you shared a useful function.
      I usually try to keep the video as simple as possible for beginners, so I don't use any line of code if not really necessary to reach the goal of the specific video tutorial.
      But of course using the command that you shared is the right approach :)

  • @hellilibeth2122
    @hellilibeth2122 5 років тому

    Do you have an idea, how can I save into a file the Backgroundmodel, created with BackgroundSubtractorMOG2?

    • @rubenantonio141
      @rubenantonio141 4 роки тому

      docs.opencv.org/3.4/df/d23/classcv_1_1cuda_1_1BackgroundSubtractorMOG2.html
      In this link we found a subfunction to do that, we need declare the method and after this call the method.subfunction.
      Hope can help you.

  • @camilomanrique9816
    @camilomanrique9816 5 років тому

    Thank you, amazing tutorial !!
    I am trying to save the result with the VideoWritter class like you did on another of your videos, but it does not work (creates the file, but it can't be read and is only 4kb). Do you know maybe what's going on? Btw the writter works with the original video, so technically I'm able to save videos, but just not the one with the background subtracted.

    • @zhenyutang4277
      @zhenyutang4277 4 роки тому

      see pyimagesearch, it has a detailed discussion about videowriters.

  • @remi-avec-un-i
    @remi-avec-un-i 6 років тому

    Hi dude,
    Once more, it is a good tutorial !
    I'm starting to do "big" projects on openCV and I was wondering : how do you get autocompletion when you write (for example, you type 'cv2.' and every functions appeard ? It will save a lot of time
    Cheers !

    • @pysource-com
      @pysource-com  6 років тому

      hi Remi, I use Pycharm, that function is there by default. So it depends on the idle you've got.

  • @sunil_bista_
    @sunil_bista_ 5 років тому

    What if I wanted to detect the speed of some/all of the vehicle in the video, what should I do? Can you help me out.

    • @jamshaidusman5809
      @jamshaidusman5809 5 років тому

      You can measure the distance that vehicle have traveled in the time span of frame 1 to 2. And by using simple physics formula you can find out the speed of the vehicle.

    • @sunil_bista_
      @sunil_bista_ 5 років тому

      Jamshaid usman Thanks.Can you elaborate on how to find the distance?

    • @MinecraftLetstime
      @MinecraftLetstime 5 років тому

      @@sunil_bista_ You can use something called block matching, use it to get motion vectors for objects, and using that between frames you can get vectors for each object. Then you just need to convert those vectors to real life distances or speed.

  • @caspertu8941
    @caspertu8941 6 років тому

    I have question !! If camera is dynamic , what the result is ?

    • @pysource-com
      @pysource-com  6 років тому

      With background Subtraction camera CAN'T be dynamic. This method works only with static camera. With a dynamic one it's necessary use different methods involving machine learning.

  • @kavithasekar8339
    @kavithasekar8339 6 років тому

    What is the software used ?? Please mention it

  • @wpontog
    @wpontog 6 років тому

    hi. would you please post a tutorial how to count the cars as you said?

    • @pysource-com
      @pysource-com  6 років тому

      I will do that in the future

    • @jawadnaseemkhan
      @jawadnaseemkhan 6 років тому

      plz do it fast bro i really need to work on it . i will be waiting for that

    • @WoFFeN88
      @WoFFeN88 6 років тому

      @@jawadnaseemkhan did you finally did it a counting cars project? I am interesting because im working in something similar, could you share the code if you done it!?

    • @jawadnaseemkhan
      @jawadnaseemkhan 6 років тому

      Luis S yes i have done it

    • @jawadnaseemkhan
      @jawadnaseemkhan 6 років тому

      Luis S i will share it with you soon email me

  • @briwicklab
    @briwicklab 5 років тому

    open city function???? is it by default in the opencv????

  • @mohammadaliavazpour3268
    @mohammadaliavazpour3268 5 років тому

    Thanks , That was a great tutorial

  • @abubakarsaidu7663
    @abubakarsaidu7663 5 років тому

    great tutorial!