CSCI 235 - Intelligent Robotics
Spring 2017
Project #3: Color Filters
Color Filtering
For this assignment, we will use a computer vision library that includes
a color filter. To use a color filter, we specify the following:
- What are the boundaries for our target color?
- How much of the color must be present?
- Where in the image is the color concentrated?
Library
The library files are in vision.zip. Create a vision
package within your modeselection
package, and
place the files there. You will also need subpackages vision.color
,
vision.config
, and vision.config.color
.
Here are some key programs to use when exploring different colors. All are
in the package modeselection.vision.config.color
:
- ColorPicker.java: This program shows the current view from the camera. In the middle is
a square. When the ENTER button is pressed, a ColorFilter is built from the
pixels in the square. Pressing ENTER multiple times will broaden the set of
pixel values accepted by the filter. Pressing ESCAPE will display the filter
values. Press ESCAPE again to exit the program.
- ColorFilterViewer.java: In the
main()
method, this program can be configured with a specific color filter. When executed, the program will darken pixels that pass its color filter, while leaving other pixels clear.
- ColorConcentrationViewer.java: Again, this program can be configured with a specific color filter. When executed, the program will draw a vertical line
corresponding to the part of the image where the targeted color is densest.
Sample Programs
The sample programs are in proj3.zip.
Assignment
Implement two programs that use a color filter. Each program can control
the robot to perform any task you would like, subject to the following
constraints:
- Each program must have at least one mode transition attributable to
color.
- At least one program should employ two distinct colors.
- Each task should, in some way, be something that was not possible to
undertake using only the sonar and bump sensors.
Questions
- For each program, devise a metric for its performance on its task. How
well did each program perform? Feel free to experiment with different
parameter settings to optimize performance.
- In what way was each task not possible without the use of the camera?
- What challenges did you encounter when attempting to employ the color
filters? How did you overcome (or compensate for) those challenges?