Raspberry pi OpenCV C++ Tracking object Trained Cascade Tutorial Updated with github souces code смотреть онлайн
Here I show my own trained cascade using OpenCV C++ and the tools for trained cascade. I was made all things on the Raspberry pi training took about 20 minuter from 2000 positive picture and 1000 negative picture. Using the Raspicam library and the in build camera. I made also some picture sample tools for both generate the positive and negative samples and also a info.txt and bg.txt files generator. Here is a text tutorial below:
New complete Raspberry pi 3 installation log OpenCV and other tools on see
Installation giude raspberry pi 3 :
https://gist.github.com/ollewelin/b74d7a5e1081cf96df8d2900ed396581
Then some more tools to make your own trained cascade but here is the code I run:
Updated here put this files in directory /home/pi/OlleOpenCV2_3/
https://gist.github.com/ollewelin/9cfbc0dbebaff1644b5baef4a1cc65e8
https://gist.github.com/ollewelin/dff23bc942a4c64d191c203e9efa285f
https://gist.github.com/ollewelin/9f948c054b0c5fe4ef6f77561274a111
https://gist.github.com/ollewelin/051242b10d1927c59256bc88aed1cd2a
https://gist.github.com/ollewelin/3f142b6115dd31a857414c87d8ee2e58
the ..e58 file should be named
cascade_obj.xml
all other files above should be named with my File: comment I show at top of the text
compile and run:
$ sudo cmake CMakeLists.txt
$ sudo make
$ sudo ./simpletest_raspicam_cv
in directory /home/pi/OlleOpenCV2_3
Test to make a similar object like in this video with white (or gray work even better) and black symbol with included cascade: https://gist.github.com/ollewelin/3f142b6115dd31a857414c87d8ee2e58
Note: bcm2835 is installed to make it possible to control the GPIO pin list to then controll a home made BB-8 robot by tracking object on Ray
Now you could start do your own cascade symbol:
Next video will contain my made tools for make 1000 and 2000 samples and then instruction how to made your own cascade_obj.xml
https://www.youtube.com/watch?v=Z3jwzL-o4nM
https://www.youtube.com/watch?v=V3eCYBViVp8
Place this in directory /home/pi/pos_neg
https://gist.github.com/ollewelin/23a20fc49901a69aaf88790d66e0be6a
https://gist.github.com/ollewelin/f3a00f4980f9064a60dd501834bf45f7
create a directory with name /positive_data in /home/pi/pos_neg dir so you have
/home/pi/pos_neg/positive_data
compile and run:
$ sudo cmake CMakeLists.txt
$ sudo make
$ sudo ./test_prog
in directory /home/pi/pos_neg
Then a similar tool for generate 1000 negative pictures:
Place this in directory /home/pi/negative
https://gist.github.com/ollewelin/c00ddd31618f1c21c93114593586a5d4
https://gist.github.com/ollewelin/045eed63a934420acff7e1de9dfc31bf
create a directory with name /negative_data in this directory /home/pi/negative
so you have a directory like this
/home/pi/negative/negative_data
compile and run:
$ sudo cmake CMakeLists.txt
$ sudo make
$ sudo ./test_prog
in directory /home/pi/negative
Also here is the cascade command's I use:
Updated: I use 8-stages for this example of cascade_obj.xml I was produced
https://gist.github.com/ollewelin/4670a232de09aea8749305d7542c8c94
http://pastie.org/10803888
Also tools to make bg.txt and info.txt files:
https://gist.github.com/ollewelin/fe721f2c45764fa3c552105b9db1c67b
https://gist.github.com/ollewelin/be26aafde008ac341f49e167e6e64380
Or use prepared info and bg file below
https://gist.github.com/ollewelin/2dc7d1ce00096f5dd47f2ddfaac82364
https://gist.github.com/ollewelin/8033bf215d041868429b4264df272bf2
When you done all above take all the positive and negative image with name 0.JPG... 999.JPG and pos0.JPG... pos1999.JPG and the bg.txt and info.txt file to a cascade directory. You also copy 2 of the cascade tools how have been installed when you install raspicam API with OpenCV with name:
opencv_createsamples
and
opencv_traincascade
in to your cascade directory
I think maybee you find this 2 OpenCV tools in directory:
/usr/local/bin
Then you have in your cascade directory:
bg.txt
info.txt
0.JPG... 999.JPG
pos0.JPG... 1999.JPG
opencv_createsamples
opencv_traincascade
Add also the command example
https://gist.github.com/ollewelin/417ec84a7e7743cd3639ae9e7cd0b7f1
http://pastie.org/10803888
You also need to make a directory with name:
data
into your cascade directory.
Then run the first command to produce a vec file
check that the vec file have all the pos0..1999 samples by enter the second command.
Then finally start the trained cascade by the command nr 3 it take time to produce the cascade.xml
copy and rename the cascade.xml file to
cascade_obj.xml
into dir:
/home/pi/OlleOpenCV2_3
start the program by enter
./simpletest_raspicam_cv
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Raspberry pi OpenCV C++ Tracking object Trained Cascade Tutorial Updated with github souces code» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.