Refining urban area highlighting: the previous method didn’t work around the World!

18 07 2008

So the previous method with the lovely flowchart and everything proved to be great for London but when I tried to use exactly the same method in New York it took far too much urban area away leaving us with a rather dull image when it should be very bright to indicate the NYC metropolis. Take a look at the difference between New York and London! So I essentially went back to the drawing board and thought, “okay what are the main features to a LandSat image?” answer: urban areas, rural areas and water! So that means I need to distinguish between urban and rural and then distinguish between urban and water, then somehow combine the two. Thats exactly what I did.

The method is very similar to before, except I’m now using both hue and saturation from the 742 false colour image instead of simply hue. The pretty flowchart for the process is shown below and for those you you who thought the last one was a mess wait ’til you see this one!

The method essentially works due to the different properties of hue and saturation. There is a great difference between the hue value for urban and rural areas, therefore hue is used to distinguish between rural and urban. Here is the hue component of the 742 image with a colour threshold to highlight urban areas (notice that that water is also heavily highlighted).Now we apply a colour threshold to the saturation layer and take advantage of the great difference in value for land and sea here. So now we have two layers one highlighting urban and sea and one highlighting urban and rural, we need to pick out the urban. This is done by using a clever layer mode algorithm in GIMP called ‘darken only’. This compares the pixel value in the two layers (hue and saturation) and displays the lower value pixel, in this way water and rural areas are removed from the image. Result!

Here are the resulting finished images for London and New York.

You can compare the previous method and the new one here:

Old London
Old New York
New London
New New York

By the way if anyone is really interested in this stuff and would like more guidance or some high resolution images just get in touch.

Advertisements




Highlighting urban areas in LandSat

17 07 2008

The hypothesis I’m working on at the moment is that there should be more OpenStreetMap data (i.e. more nodes, more ways etc) in urban areas. To find out where these urban areas are I’m using freely available LandSat 7 data downloaded from http://www.landcover.org/data/landsat/. The data comes in the form of 8 different greyscale images corresponding to 8 different spectral bands ranging from visible blue light (0.45-0.52 µm) to thermal IR (10.40-12.5 µm).  Using bands 1,2,3 corresponding to blue, green and red a ‘true’ colour image of an area can be built, however this is not the best combination to use to highlight urban areas it turns out that the best combination is 7,4,2 for red, green and blue. Head over to my page on using LandSat imagery in GIMP to find a tutorial on all this.

What I’ve been working on over the past few days is how to use the false colour image I’ve produced using bands 7,4 and 2 to highlight the urban areas.Below is the 742 false colour image, and we can see that urban areas appear quite brown and purple, the aim is to extract that information and make everything else invisible. The problem is that some of the sea to the East is a similar sort of colour to the cities.

I decided the best way to extract the urban areas from  the image above would be to decompose the image into hue, saturation and value. The hue is the most interesting component, giving a good contrast between rural and urban areas, but as we can see there is little difference in colour still between some sea areas and some cities which could prove a problem in extracting just urban areas.

The next step is to apply a colour threshold on this image to try to pick out only urban areas and black out everything else. After a great deal of playing around with filters the urban threshold here appears to be within light levels 196-212, after applying this filter the image below is obtained.

As we can see the urban areas are nicely highlighted in white and everything else is black. Now the aim is to compare the brightness of every pixel in this image with OSM data. We know the coordinates of the image above and we kno that each pixel is (30m x 30m) so this should be easy enough using a simple bounding box query of the OSM database. Lets hope that there is a relationship now between OSM data and the brightness of the pixels above. I’ll be back with any results when I have them and then hopefully be rolling this out across the world.

Click on the image below for a nice flowchart of the whole process.





New project: Lets use LandSat

10 07 2008

Not sure about the licensing requirements for my beautiful Qgis model (which shows roughly which areas of the UK are complete and which incomplete) so I don’t think I can publish the full results from that yet. Essentially though I have found that there is a strong correlation between the length of road in a particular area and the population in that area, its good enough to accurately predict the length of road there should be in an area and compare that to OSM road length. But enough about that project for now, hopefully soon I will publish all my findings.

So instead its onwards and upwards to a new project which was inspired by the view of the Osmarender layer on OpenStreetMap, shown below. It is clear to see that there are vast areas in Asia and South America, where there is no OpenStreetMap data, the question is whether there is actually nothing there or OSM is just missing cities, roads etc. I plan to find out using open source aerial imagery.

The plan is to use LandSat and other forms of freey available imagery to work out where there should be cities and roads and where there shouldn’t be. Then take this information and compare to OSM. Easier said than done, I’m sure but it wouldn’t be a project if it wasn’t challenging. So below is a LandSat image of London and to the North, which I have applied a Yellow Contrast Gradient Map to, using GIMP. As you can see it emphases cities and rural areas quite well and I’m sure this is the starting point to predicting accurately where there should be OSM data.