It is important to note that this is a definitive scoring system and represents a first iteration of this process.

Detecting Color Features

According to \cite{national_association_of_city_transportation_officials_urban_2017}, the best bike lanes are painted green. The green paint allows the bike lane to be more conspicuous and implies a separation from cars, and thus hopefully leading to greater space and safe space between bicyclists and automobiles.A first step in evaluating bike lane quality is classifying bike lane color.
When reading an image into openCV, they are stored as a color matrix using an RGB model. This is convenient, as it makes it possible to treat the image as a matrix of numbers to build a function that returns a numeric "color score". Our goal for this color score therefore is to calculate how “green” the bike lane image is. The hard part in this process is how to define this "bike lane green", since the bike lane green is a very specific color.
However, we should include a range of green colors in order to account for variations in the lighting of the images captured. In this step, we use image processing software (photoshop and gimp) to find the RGB components for the color of a sample bike lane and set lower and upper bound according to the RGB components. With lower and upper bounds in place, we can create a mask and perform a color filtering, leaving only the target green color behind. Which means that the resulting image's matrix after filtering will have non-green values set to 0, thus we can calculate the difference between original image and the resulting image. The more green kept, the more components kept and the higher the sum will be. The sum of the number of green pixels is our color score.
To summarize:
  1. Convert image to HSV color model matrix.
  2. Create color bound for "bike lane green".
  3. Filter out colors that are not in the range.
  4. Calculate color score based on total sum of green pixels after filtering