=======Making hsv_trackbar in opencv======= \\ \\ **Author:** Email: \\ **Date:** Last modified on <08/18/19> \\ **Keywords:** \\ This tutorial's motivation is to practice basic autonomous system using ROS. Readers of this tutorial assumes the reader has the following background and interests: \\ * know how to use opencv_tutorial. \\ * background of c++. \\ * This tutorial may also attract readers who want to study opencv. \\ The rest of this tutorial is presented as follows: * [[tutorialTemplate#partsListAndSources|Parts List and Sources]] * [[tutorialTemplate#construction|Construction]] * Programming * Final Words \\ \\ ===== Motivation and Audience ===== Readers of this tutorial assumes the reader has the following background and interests: \\ To run this tutorial. The following should be completed OPENCV Tutorial - [[http://www.daslhub.org/unlv/wiki/doku.php?id=open_cv_set_up|opencv_videocapture]] \\ OPENCV Detecting ball- Object recognition, Object position recognition [[http://www.daslhub.org/unlv/wiki/doku.php?id=color_detecting|Detecting ball]] \\ \\ \\ =====Step 1===== ===Moments function=== It was relatively easy to find the centers of the circle. \\ But when it came to finding the centroid of an arbitrary shape, the methods were not straightforward. Because the camera couldn't always catch the perfect circle. \\ So, We're going to modify detecting code using a moments funtion.. \\ This is guide for moments [[https://www.learnopencv.com/find-center-of-blob-centroid-using-opencv-cpp-python/|moments function]] \\ It can be more accurate than simply using stats. \\ \\ {{:moments.png?300|}} \\ We can find the center of the ball using moments in OpenCV \\ \\ =====Step 2===== ====Set up the hsv variables==== If you don't know well about HSV color, click this. [[https://www.learnopencv.com/color-spaces-in-opencv-cpp-python/|HSV_opencv]] \\ it could be easy to set up the low high value of the HSV. \\ \\ =====Step 3===== ====create trackbar==== Now you can create trackbars since you've done the above. \\ Trackbars are very useful in lots of occasions. It enables users to change various parameters while the OpenCV application is running. \\ {{:trackbar.png?400|}} \\ finally, you can make Opencv code on your own. \\ \\ This is what I did {{:opencv_trackbar.docx|opencv_trackbar_code}} \\ \\ Final Words For questions, clarifications, etc, Email: hyunduck1024@gmail.com