90 likes | 102 Vues
Ball Recognition for RoboCup’s black and white ball using OpenCV. W.I.B. Technical University of Crete. Karageorgiadis Anastasios. Introduction.
E N D
Ball Recognition for RoboCup’s black and white ball using OpenCV W.I.B Technical University of Crete Karageorgiadis Anastasios
Introduction • What is W.I.B? W.I.B (aka Where Is Ball) is a project for ball recognition, using OpenCV. More precisely is a program that uses classification methods of OpenCV, to train and detect black and white ball. This type of ball is used at Robocup(SPL) the last years. Ball Since 2016 SPL Ball till 2015 SPL
HoughCircles Approach • We tried to detect circles with specific center and radius (that will match to the ball size) using the sample file houghcircles.cpp of OpenCV. • What do we do? We simply adjust the threshold for ball’s color and for its center, and we also set the size of the circle in a range. • Example code: • HoughCircles(img, circles, HOUGH_GRADIENT, 1, 10,210, 30, 1, 50 ); • // change the last two parameters • // (min_radius & max_radius) to detect larger circles • “210” : circle’s max threshold • “30”: circle center’s max threshold
HoughCircles Results Change threshold of ball Perfect Threshold and circle size Keep threshold and increase circle’s size-range
Cascade Classifier Approach • We chose LBP(Local Binary Pattern) features cascade classifier. • We use opencv_createsamples to get .vec file with all positive samples. • Then we use opencv_trainscade with input .vec and bg.txt(negative images) to create and train our cascade-classifier. Abstract view of whole project
Cascade Classifier Results False Detection Ball Dedected *Note: Ignore drawn circles-error drawing outline
Results(2) Detection These images are showing detection happens for 500 positve images and 1000 negative images.
Conclusion • We saw that HoughCircles is a very good approach for simple application on object detection.But, it’s not such an accurate method. • OpenCV cascade-classifier is an easy way to detect objects, once we have trained our classifier. Also, we can adjust the size of the detected object by resizing the detection window. • But most important is that our results are independent of light conditions and image quailty. • The only restriction is collecting a satisfactory dataset (could be thousands of one object images). • More specific we tried for 50 positive images and 110 negative. With cascade’s number of stages equal to 20 and we detected the ball (roi). (partial) SUCCESS!! • We achieved full success of ball detection with a dataset of 500 positive images and 1000 negatives.
Usefull Links • https://github.com/soylisK/W-I-B • https://docs.opencv.org/2.4.13/doc/user_guide/ug_traincascade.html • http://answers.opencv.org/question/39160/opencv_traincascade-parameters-explanation-image-sizes-etc/ • http://profs.scienze.univr.it/~bloisi/tutorial/balldetection.html • https://www.youtube.com/watch?v=WEzm7L5zoZE Some intresting : • http://www.cs.utexas.edu/users/AustinVilla/papers/LNAI17-jmenashe.slides.pdf • https://www.robocup2017.org/file/symposium/RoboCup_Symposium_2017_paper_20.pdf • Visit also www.github.com/AnonKour Kouretes Team 2018 Techical University of Crete