Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program Inputs Enter image numbers to process in []: The user will always enter two whole numbers (lowest number first) corresponding to the puck images

Program Inputs Enter image numbers to process in []: The user will always enter two whole numbers (lowest number first) corresponding to the puck images Program Outputs Estimated fastest puck speed (pixels/second): XXX Replace XXX with the highest calculated p

Object Tracking Implement the color thresholding technique to track an air hockey puck across multiple images Key programming concepts: images, thresholding Approximate lines of code: 30 (does not include comments or white space) Note: You may not use any fancy image processing routines (rectangle,imerode,circle,etc...

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 edge. Finally, you can estimate the pucks velocity from two consecutive images. For example given the puck image on the left, we can outline the puck in white and draw a red line showing the direction of travel:

Puck Tracking Algorithm Process the desired images in a loop Open and threshold the images for the blue puck and calculate the pucks center Find the pucks outline using the Erosion algorithm ? The outline of the puck is any pixel in the binary image that has a value of 1 but at least one of its four neighboring pixels is a zero. (The four neighbors are the pixel values that are above, below, left, and right of the current pixel. You can safely skip the pixels on the edge of the image!). ? More info: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_morphological_ ops/py_morphological_ops.html Update the current image to show how the puck is moving ? Overlay a pure red line from the center of the puck that is 15 pixels long ? Overlay the pucks outline as a white line Save the new image by adding outline to the filename before the .png ? For example, if processing image 2.png, save the new one as 2 outline.png ? You can safely skip the first image! Calculate the pucks velocity based on this image and the previous image ? The images were taken with a PlayStation Eye camera at 120 frames per second (fps) Display the pucks fastest velocity in pixels per second from all images processed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

A room with four walls may need four separate elevation drawings

Answered: 1 week ago

Question

What attracts you about this role?

Answered: 1 week ago

Question

How many states in India?

Answered: 1 week ago

Question

HOW IS MARKETING CHANGING WITH ARTIFITIAL INTELIGENCE

Answered: 1 week ago