with envi image processing and classification tools, you can get roofs from images with some spectral value and then you can convert it some vector data for your app.

in python with OpenCV which have devoloped by Intel (has lots of Object Detection Algorithms) you can detect faces from images.

OpenCV Example:

my question is that can we detect roof or anything from coordinated or not-coordinated satellite images with opensource tools as python?

Satellite Image Example:

enter image description here


I have used OpenCV in the past to train for object detection for geo. Orfeo Toolbox is a good open source choice as Vascobnunes pointed out. For a closed-source version, you can take a look at Feature Analyst (that also has an ArcGIS extension).

At the end, it boils down to training a support vector machine. There are several libraries that you can use for this for pretty much most languages.

This is an example of a tool that I wrote a few years back that uses libsvm to do tree object detection. When found, I place a real 3D tree object where it goes.

Example of object detection using libsvm

This is a video of it in action that I posted to YouTube back then.

Any of these libraries will allow you to do stuff with python.

  • thank u for your advice.. is there any good app. doc for this. it has seemed to me like a bit complicated... – Aragon Mar 14 '12 at 14:36
  • orfeo and feature analyst (mentioned above) are apps with plenty of documentation. Envi also can do this exelisvis.com/portals/0/tutorials/envi/… By the way, orfeo (the open source option) has a qgis plugin – Ragi Yaser Burhum Mar 14 '12 at 15:31
  • And of course now, 8 years later, we have options like RasterVision, TensorFlow, PyTorch, Keras, the list goes on... – Ragi Yaser Burhum Mar 2 '20 at 20:09

I am afraid satisfying roof detection cannot be achieved with only one single satellite image. You should try to use other sources of information.

The following article describes a method using a DEM + aerial image pairs + cadastral data:

M. Durupt, F. Taillandier. Automatic Building Reconstruction from a Digital Elevation Model and Cadastral Data: An Operational Approach. International Archives of Photogrammetry, Remote Sensing and Spatial Information Sciences. Vol. 36 (Part 3), Bonn, Germany, September 2006.

See also other papers in the bibliography section (like that one).

I suspect such methods are not implemented in python opensource softwares.

  • thank u. i am searching opensource software for developing it for my purpose... – Aragon Mar 13 '12 at 15:24

have you tried the orfeo toolbox?

  • i havent seen any python binding in this tool. can you give some explanation about this toolbox. – Aragon Mar 13 '12 at 8:47
  • They say on their website: "otb-wrapping for low levelPython/Java bindings." orfeo-toolbox.org/otb/download.html – Tomek Mar 13 '12 at 11:08

Well from one image only, you can do supervised or unsupervised classification. Try a few times and see if results are good.

Better way, the way I did it, was making orthophotos from images. Then I had footprint of the building so i filtered terrain from the image. Then I did classification of the pixels and created vector objects.

If you have DEMs, or you have stereo pairs, you can create one. Then you can detect roofs.

Also, in your image, image is full of shadows. Good luck dealing with them. As such, in python, i havent seen anything. I used ArcGis for classification. But since you mentioned opensource, QGIS can be tried.

Final note, what you asked is a major topic of research and you have to enhance your database to get good results. Single images are tricky to deal with in this case.


Point Cloud Library is a new open source library, it could be used for object recognition based on DEM or Orthophoto, i wish it could help, but i have never used it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.