Hi again, thanks for the comments. > How well would this scale up to the whole country? (!! Not automatically > importing the results of course !!) I'm thinking about tile/batch sizes, tile > boundary issues, I was thinking about using a sliding window approach, by loading in an extra margin from surrounding tiles, selection pixels by colour, create edge fragments as before. But in this case, the step that creating polygons should only use the central region of the image for the starting point of the polygon. This should avoid any buildings getting cut in half at the tile edge.
> any necessity for porting parts to c++ for speed etc. > Converting edge fragments to polygons is the slow step at the moment - about 15 minutes a tile. I am using the approach describe in the link below. Fortunately, I know a bit of Boost.Python and C++ if we need the speed. I suspect a better algorithm in python could improve the speed issue rather than resorting to C++. http://losingfight.com/blog/2007/08/28/how-to-implement-a-magic-wand-tool/ I am also seeing the limitations of my approach. Problems arise from the lack of image resolution and the anti-aliasing of the colours in the image. Since I am using a binary classification by colour for selecting pixels, it tends to result in rounded corners (due to the colour blending into the backgound). The polygon simplification then has to descriminate between a rounded corner due to anti-aliasing and corner which is real. Given the resolution, a straight edge might only be 2 or 3 pixels long, and a rounded corner has a radius of about... 2 or 3 pixels. But then, these building shapes are also a total nightmare to manually survey. Example attached (you will probably need to zoom in): http://timsc.dev.openstreetmap.org/dev/hard-building-shapes.png I have some ideas for a better algorithm (based on active contour models), but that is pretty complex. I will give that some thought. Basically, we need to segment the shape but not by simply binary selecting pixels inside or outside the shape (and it can try to be orthogonal, if possible). The code I have does provide a good initialisation of the model, so it is hardly wasted effort. If anyone has any better ideas, you can have a copy of my python code to try things. Regards, TimSC _______________________________________________ Talk-GB mailing list [email protected] http://lists.openstreetmap.org/listinfo/talk-gb

