Mathematical mapping gives a green view of Milwaukee County

Applied Mathematics and Computer Science major Adam Honts (left) and Mathematics major Jacob Beihoff (right) smile in front of their poster at the National Conference for Undergraduate Research conference in Oklahoma in April. Photo courtesy of Jacob Beihoff.

Visit the Google Street View (GSV) website and you’ll see panoramic photos showing every tree, shrub, and bush growing along the road. That made it the perfect tool for two UWM students trying to measure the growing things in their city.

Last summer, Mathematics major Jacob Beihoff and Applied Math and Computer Science major Adam Honts teamed up to map the green vegetation visible from the street in Milwaukee County, a so-called “green index.” They pulled images from GSV and created their own computer program to measure the amount of fauna in each photo.

“It provides data that could open up a lot of possibilities,” Beihoff said. “People have been doing this a long time for urban planning, but we came up with a nice, free way of collecting this data and providing it for others to look at.”

And that data has all sorts of practical uses. Scientists are looking at urban greenspaces to see the relationship they have with everything from neighborhood income to mental well-being to home energy costs.

The project grew out of a UWM initiative called Undergraduate Research in Biology and Mathematics. The NSF-funded program encourages biology and math students to conduct research projects focused on integrating their respective disciplines.

The project took three steps.

Step One and Two: Getting Locations and Collecting Images

To begin their mapping, they first needed to gather Google Street View photos from locations around the county. Beihoff and Honts took a regular map of Milwaukee County and overlaid a fine grid on top of it, stretching from corner to corner. In real life, the grid lines were about 6 to 10 meters apart. Then they requested GSV images for the coordinates of each intersection on the grid.

They ran into a big problem almost immediately: Honts and Beihoff had almost 1.8 million possible coordinates. GSV panoramic images are stitched together from six photographs, so the students would have had close to 8 million photographs to collect. They would have taken more than two months to download.

“We noticed from one image to the next image, you’re not really seeing anything new because the locations are so close together,” Honts said. “We developed a method of filtering out locations within close proximity to one another to give us a newer perspective.”

After trial and error, the team pared down their location collection points, and used a filter to select the newest photos from each location and eliminate photos taken during winter. They were still left with 90,000 GSV images from around the county.

Step Three: Processing Images

To measure the amount of vegetation in photographs, Honts and Beihoff wrote a computer program that detects green pixels within each image. The problem was, there are a lot of green things in Milwaukee County.

“Every street sign, every trash can, they’re all green,” said Beihoff. Green houses and cars were also swept up in the filter. “Not only do you have to distinguish green things, but you have to separate what is and isn’t vegetation.”

Beihoff and Honts focused on the trashcans and street signs that appeared in many of the images. They converted each photograph from an RGB-format (Red, Green, Blue) to Hue Saturation Value – an alternative way to look at the color in each image. They noticed that the luminescent greens of street signs and trash cans fell into a different range of hues than leaves.

“So we targeted that and said, if this image falls below this range, we assume that it’s good, and if it falls above this range, then it’s artificial and we can cut it out,” Beihoff said.

To remove objects like houses and vehicles, they looked at pixel color variation. If a color was uniform across several pixels grouped together, that part of the image was likely a uniformly-painted car or house. Pixel clusters with variation in shades of green were more likely to be part of a bush or tree, because, as Beihoff noted, “nature doesn’t paint nicely.”

Presenting their research and next steps

Using their green filter, Honts and Beihoff were able to isolate the vegetation in all 90,000 GSV images and calculate the percentage of vegetation compared to everything else in the photos, arriving at a green index number: about 23.5 percent of Milwaukee County is green vegetation.

“In addition to getting this overall green index, we were able to map how green Milwaukee County is on a very small scale,” said Beihoff. “We have data which can tell you how green your neighborhood is, or how green certain streets in Milwaukee are compared to others. We were able to physically map this, and create Milwaukee County maps that displayed how green individual blocks are around the County.”

They presented their research at several conferences around the U.S. before they gave their final presentation at the UWM Undergraduate Research Symposium in April. At every conference, Honts said, scholars were curious about the project and its possible applications.

They hope other scientists can expand on their work and improve it. For instance, the green index only measured green vegetation, and excluded colored flowers and trees. Other applications could include using pollution sensors on Google Street cars to track air quality.

“I think there’s so many ways you could push this research in new directions,” Honts said.

By Sarah Vickery, College of Letters & Science