PROJECT · SOFTWARE

A camera colour inspector

Test a repeatable image pipeline before adding a live camera.

The outcome

Test a repeatable image pipeline before adding a live camera.

Known imageHSV conversionThreshold maskPixel fraction
An original overview of the information or commissioning sequence.
Verification boundary

Documented target: Ubuntu 24.04 · ROS 2 Jazzy · Gazebo Harmonic where used. Browser labs tested; ROS/Ubuntu/hardware execution not performed here.

Before you begin

  • Python 3 virtual environment
  • OpenCV 4.x
  • No camera needed for initial test

Prepare with Find a colour region with OpenCV.

Download project files →

Build, observe, explain.

1

Create known input

Download the complete colour-mask script or use the lesson code.

Expected: A 100×100 image with a 50×50 green region.

2

Verify the mask

Run the script and inspect mask.png.

camera-colour-inspector-2.txt
python colour_mask.py

Expected: 2500 selected pixels.

3

Vary inputs

Change brightness and thresholds; record inputs and selected fractions.

Expected: A table explaining selection changes.

Troubleshooting

Camera inaccessible
Prove the synthetic case first, then inspect device permissions.
Background triggers
Colour is not unique object identification.

Take it further

  • Measure contour area/centroid.
  • Add a calibrated ROS image pipeline.

Documentation and next steps

Explore another project · Return to learning · Report a project issue