Question
I am having trouble with a C++ coding problem. The problem has to do with object tracking. The color thresholding technique will be used to
I am having trouble with a C++ coding problem. The problem has to do with object tracking. The color thresholding technique will be used to track an air hockey puck. Any help is appreciated and if you have any questions let me know. The problem details are described below:
Remember that images are just a grid of pixels (think width and height) where each pixel has a red, green, and blue color component adding a third dimension. By locating all the pixels that fall into the RGB color range of the blue puck, we can identify its location in every image! This process is known as thresholding and results in a binary image (black and white only). After thresholding, you can identify the center of the puck and determine its outer edges.
Puck Tracking Algorithm
Use the following steps to track your hockey puck:
Process all 80 images provided in a loop
Create a string to open one particular image based on the loop iteration Threshold the current image for the blue puck and calculate the pucks center
Youll need to identify the RGB values of the puck using Microsoft Pain or Macs Data Cursor Tool
Create a binary image based on the good RGB values
The center is the average of all the matching rows and matching columns
Find the pucks outline using the Erosion algorithm
More info: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/
py_morphological_ops/py_morphological_ops.html
Perform erosion on the original binary image to create an eroded binary image. The algorithm states that a 1 in the binary changes to a 0 if any of its four neighbors are also a zero. (The four neighbors are the pixel values that are above, below, left, and right of the current pixel). When checking neighbors, make sure to only look at the neighbors from the original binary image!
The outline is then the pixels where the original binary has a 1 and the eroded binary has a 0
Overlay a small red square (3 pixels by 3 pixels) over the pucks center Overlay the pucks outline as a white line Save the new image by adding outline to the filename
For example, if processing image 1.png, save the new one as 1_outline.png
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started