Skip to content

Task 1: Detecting A Brightly Colored Object

Richik Pal edited this page Oct 6, 2024 · 3 revisions

Task 1 Introduction

Task 1 will provide a breakdown of a classic OpenCV task - detection of single brightly colored object in a frame. Consider, for example, a brightly colored piece of paper or a brightly colored ball. These objects may need to be tracked in robotics applications, and for objects that have an obvious and distinctive color, using OpenCV may be a great option.

Checkpoint 1A

Pick out some object you have in your room that has a very bright and distinctive color. Take a picture of it and look at the distribution of pixels in various color spaces. Did you find a color space that allows for an easy threshold?

Checkpoint 1B

Create a class that is a subclass of TaskPerceiver, along with __init__ and proper analyze methods.

Checkpoint 1C

Add code within the analyze method to threshold incoming frames for the object chosen in 1A using a color space of your choice.

Checkpoint 1D

Get the contour that best represents the object you are have chosen in frame, and return it. If any debug frames are needed, return in the format as follows: return contour, [frame_1, frame_2,..., frame_n]. In order to help set threshold values, sliders may be helpful.

Checkpoint 1E

Draw a bounding box or an enclosing circle around the object, depending on what is appropriate. Display this in vis by returning the right frames and in the right format (Hint: look at the return in Checkpoint 1D).

Next Page

Perception Subteam Intro Project

Clone this wiki locally