Posts

Showing posts from February 17, 2019

Colour Detection in HSV

Image
Hi, Today, I tried detecting the puck using OpenCV's built-in algorithms to detect a specified colour within the camera frame. Methods used: 1. Applied Gaussian Blur to blur the frame to remove small noises within the camera frame. 2. Converted OpenCV's default colour format from BGR to HSV which allowed the camera to detect a range of a specified      colour e.g. from light red to dark red. 3. Used trackbars to recognise the colour of the puck in real-time. I plan on using the values found in this test script in my       final script where I don't have to change anything. 3 trackbars were moved to control Hue, Saturation and Value of the         lower range of red, whilst the other 3 trackbars is to control the higher range of red. Video of a simple red colour detection by manually finding HSV values As shown in the video above, the camera cannot detect the red puck very well. One of the main reason is the glossy finish of the puck which is difficult to pic

Circle Detection using the Hough Algorithm

Image
Hi, Today, I tried detecting the puck using OpenCV's built-in Hough Circle function to detect circles within the camera frame. Initially, this method seemed like a better idea as colour detection is dependent on environmental changes such as lighting. However after testing this algorithm, I found few problems that altered my decision of using this method. For example, the camera would pick up multiple circles that are difficult to filter such as the design of the table's surface as shown in the video below. Video showcasing the Hough Circle algorithm A possible solution is replacing the table surface to remove the circle design. However, I currently don't have any plans on modifying the table, therefore, I plan on testing colour detection in the near future. Immanuel

CAD Modelling for Camera Setup

Image
Hi, This week, I designed and 3-D printed parts to mount a camera on top of the table. Whilst waiting for extension cable for the pi camera, I will be using Logitech c270 to progress in this project. A minimum height of 1080 mm from the table surface is needed for both camera to view most of the table. Exploded View of Camera Setup 1. The air hockey table has a total dimension of 597 mm x 122 mm x 98 mm 2. 3-D printed part to mount dowel onto the right side of the table 3. 3-D printed part to connect dowels 4. Dowel with a length of 1140 mm and 16 mm diameter. 30 mm of the dowel ends are inserted into 3-D printed parts 5. 3-D printed part to hold camera 6. Dowel with a length of 206 mm and 16 mm diameter. 30 mm of the dowel ends are inserted into 3-D printed parts 7. 3-D printed part to mount dowel onto the left side of the table. The left side of the table accommodate a switch to                 power the air hockey table Video below is an exploded view of the c