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...
Thanks - Excellent demonstration & tutorial.
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?
Very good video, thank you so much!
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 ?
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. :)
nice explanation...thanks
amazing work!
thank you
Thank you for explaination
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....
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. :)
thanks for the great video
How do i just find the background from the video @Pysource
How to remove shadow in the same example? Can you please help me
How i can count number of the frame between 2 line,please
Thanku sir good tutorial
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.
I will do it, but first I have to complete the tutorials with more technical things :)
Pysource thanks.
I'll waiting for the next tutorials, congratulations.
is this what u want? arxiv.org/pdf/1802.09567.pdf
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 :)
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 :)
Do you have an idea, how can I save into a file the Backgroundmodel, created with BackgroundSubtractorMOG2?
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.
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.
see pyimagesearch, it has a detailed discussion about videowriters.
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 !
hi Remi, I use Pycharm, that function is there by default. So it depends on the idle you've got.
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.
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.
Jamshaid usman Thanks.Can you elaborate on how to find the distance?
@@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.
I have question !! If camera is dynamic , what the result is ?
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.
What is the software used ?? Please mention it
pycharm
hi. would you please post a tutorial how to count the cars as you said?
I will do that in the future
plz do it fast bro i really need to work on it . i will be waiting for that
@@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!?
Luis S yes i have done it
Luis S i will share it with you soon email me
open city function???? is it by default in the opencv????
Thanks , That was a great tutorial
great tutorial!