Making your own Haar Cascade Intro - OpenCV with Python for Image and Video Analysis 17

preview_player
Показать описание
Welcome to an object detection tutorial with OpenCV and Python. In this tutorial, you will be shown how to create your very own Haar Cascades, so you can track any object you want. Due to the nature and complexity of this task, this tutorial will be a bit longer than usual, but the reward is massive.

While you *can* do this in Windows, I would not suggest it. Thus, for this tutorial, I am going to be using a Linux VPS, and I recommend you do the same. You can try to use the free tier from Amazon Web Services, though it may be painfully too slow for you, and you will likely need more RAM. You can also get a VPS from Digital Ocean for as low as $5/month. I would recommend at least 2GB of RAM for what we will be doing. Most hosts nowadays charge by the hour, including Digital Ocean. Thus, you can buy a $20/mo server, use it for a day, take the files you want, and then terminate the server and pay a very small amount of money.

Рекомендации по теме
Комментарии
Автор

Successfully implemented my own haarcascade by following your videos. Along the line, I did pick up some efficiencies (using more arguments), which might enhance building haarcascades. I offer these in the spirit of sharing information.
When running the traincascade command, here's the extra parameters and arguments I added to wind up with a robust haarcascade that built faster than when I ran with just the "stock" parameters.
-mode ALL -functionType LBP -minhitrate 0.95 -maxfalsealarm 0.5.
In closing, keep up the great work! I am amazed you do not charge for your videos, as your content surpasses what I am being taught in school.

johnaskew
Автор

Small tip: in Linux, when prompted for an Yes-No input [Y/n], for yes just press enter. The letter that is capitalized is the default answer (just watch for y/N, this is when No is the default)

Mirceabogdanstanciu
Автор

Once again, my engineering degree has brought me right back to you 😓😂

kalebakeitshokile
Автор

thank you. i was so confus to create positive and negative. you explained simply and clearly

tuvipurevsuren
Автор

This Tutorial seems to be promising ! I'm going to check this out the next few days :) Thank you!

BrutalGames
Автор

Thoroughly enjoying watching this series, thank you!

pocketman
Автор

I'm just gonna say thank you sir. You saved me

urbanmeznar
Автор

Very helpful tutorials and very interesting topic. Thumbs up~

MyPlaylist-xqen
Автор

As another user comments, I would suggest using a Linux virtual machine for that. It's completely free to set up, and completely free to run. You can have your Windows PC run the Haar cascade stuff in the Linux VM running within it for as long as you want, and for free (except electricity cost).

isilanes
Автор

super explanation sentdex u r vedio is so awesome I request u to do a project which differentiate plants using the haar cascade methodology

sudharsanlee
Автор

1) I assume setting up a PaaS with linux/opencv would be as (or more) difficult as doing it on a VM.. so is the idea behind running it on cloud server that the processing time to generate the training xml file is much less than doing it on a PC?

2) Since this would be a one-time use, do you have any thoughts on using Heroku? They have a free plan so wouldn't have to mess with setting up a recurring payment account, but not sure how easy it is to use with opencv. Any pointers on working with Digital Ocean/Heroku for the first time noob?

3) Can the haar file creation be automated in any way? i.e. using vlc to save an input camera stream to a series of jpg files (scene filter).. using a green screen for easy background removal (either in vlc or ImageMagick).. then converting to grayscale and generating the description file (from within OpenCV). For example, If it's a face, couldn't detectMultiScale automatically go thru all the pictures, find the face 'object', resize/crop, save as grayscale, and then save the face coordinates for that image into the description file, without doing anything by hand?

bennguyen
Автор

great stuff, do you have any tips on finding and counting moving sperm in a video? Where would you start?

davep
Автор

Why clone the git repo if you don't do anything with it? You didn't do a build or install of the source code, you got the OpenCV version on the repositories.
So either keep the clone out, or build+install it from source.
For beginners I would recommend sticking with the repository, because it had a maintainer check it actually worked and it saves you time/effort compiling.

nextlifeonearth
Автор

Hello,
I am trying to train a classifier for Detection of Stop Sign.
I created 1000 positive images and I have around 3100 negative images.
I have created .vec file and then I was trying to start training the classifier but I am getting the following error -

command - $ - opencv_traincascade -data classifier -vec positives.v
ec -bg bg.txt -numP 800 -numNeg 400 -numStages 10 -w -h 20
error I'm getting -
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
Aborted (core dumped)

Can you please tell me the fix for the same. Thank you.

tanmaypate
Автор

What should be my approach in terms of collecting images if I intend to detect anomalies/outliers? The challenge there would be that both the positive and negative images will have a major portion similar. For ex, if it is a chest x-ray of a normal human versus that of a cancer or TB patient. Or regular sized cookie vs a defective cookie?

yttvtv
Автор

Great tutorial! How to increase the accuracy of Haar cascades? There's a lot of false positives, especially for live video :/

rithzcool
Автор

Good job, with your video. I have one question.

If your first picture (the watch) have no background and you training your cascade like he had one, can he think you want the arrow or something inside the watch?

That's why he put a square on a arrow (or close), not on the watch himself.
I have no idea :)

But great job :)

MrNolimitech
Автор

I got it!i modified bg.txt correctly, then i can get the right result

ziylofu
Автор

Thanks alot sir for this. I want to ask if i am trying to identify different faces (for attendance system) should I make a custom cascade?

taqikhan
Автор

You can either use Virtual Machine for free instead of buying a server...
If you guys searching for program to edit (resize, change color, etc) many images in one shot you can use the " david batch processor " which runs on Gimp (just google it).

amitsaroussi
visit shbcf.ru