Computer Vision

Computing and Data Science

Primary Colors (optics)

Red Green Blue (RGB)


Closeup of LCD display

RGB

An image on a screen is a composite
of three color channels

Charge-Coupled Device (CCD)

A CCD is an array of sensors corresponding to pixels. The common analogy is "buckets" that collect light. A CCD may have R, G, and B color filters, or use a beam splitter with multiple CCDs.
https://commons.wikimedia.org/wiki/File:3CCD_sensors_and_separation_prism.jpg
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
A digital image is a grid of pixel values, typically with values from 0 (none of that color) to 255 (full color).

0 50 100 200
0 50 100 200
0 50 100 200
0 50 100 255
+
0 0 0 0
50 50 50 50
100 100 100 100
200 200 200 255
+
0 0 100 200
0 50 100 0
100 100 100 200
200 0 200 255
=
0,0,0 50,0,0 100,0,100 200,0,200
0,50,0 50,50,50 100,50,100 200,50,0
0,100,100 50,100,100 100,100,100 200,100,200
0,200,200 50,200,0 100,200,200 255,255,255
Red Green Blue Composite
0
0
0
35
100
100
RGB histogram
0 50 100 200
0 50 100 200
0 50 100 200
0 50 100 255
+
0 0 0 0
50 50 50 50
100 100 100 100
200 200 200 255
+
0 0 100 200
0 50 100 0
100 100 100 200
200 0 200 255
"Filters" are functions that take an image as input, operate on the pixel values, and output the new image.
Warmer


Cooler


Blur


\(+\Delta RGB\)


\(\Delta\)R: 0
\(\Delta\)G: 0
\(\Delta\)B: 0
Original RGB Histogram
Transformed RGB Histogram

A first attempt at object detection might utilize color.

Filtering pixels by RGB or HSV values can help localize objects within the image.

What colors could you isolate here?

Try isolating different objects with the filter
RGB Filter:
0 255 0 255 0 255
HSV can be more robust since it is less sensitive to lighting changes
HSV Filter:
0 360 0 100 0 100
0 255 0 255 0 255

A Classification Problem

We are given an image and want to classify it as "Apple", "Orange", "Banana", or "Blueberry"

Classifier
"Apple"

Feature Engineering a Fruit Classifier

Gather all of the "Apple" images. For each image, add up the total R values, G values, and B values.

Feature Engineering a Fruit Classifier

Gather all of the "Apple" images. For each image, add up the total R values, G values, and B values.

Feature Engineering a Fruit Classifier


Feature Engineering a Fruit Classifier



RGB sum = (2.15, 2.21, 1.8) Million ⟶ ?

Feature Engineering a Fruit Classifier

Given an input image, our Fruit Classifier Algorithm is:
  1. Add up all of the R, G, and B values
  2. If ... then ...
  3. Else if ... then ...
  4. Else if ... then ...
  5. Else ...

MNIST

Grayscale has one channel
0 = Black
255 = White

©2025 Jedediyah Williams
This work is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International License.

To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/.