What's new about OTB? Rotating Header Image

Counting Objects

OTB 2.8 (to be relased next week) will ship an object counting application. Object counting is one of the main features needed by the future Pléiades imagery end users. Therefore, we decided to implement object counting as a standalone application.

Object counting includes a very broad field of problems. For this first version of the application, we have narrowed the problem to the case where the objects to be counted are compact and radiometrically homogeneous. In this case, an operator can select several of the objects she wants to count as training examples and a simple algorithm can find the other objects in the image. After that, the counting step is trivial.

The OTB library offers all the building blocks needed for this kind of algorithm. Actually, 2 different algorithms have been implemented in the application by now.

The first one uses a supervised classification (a One-Class SVM) fused with the result of a Mean-Shift clustering. After that, the connected components of the classifed image are extracted and counted. This approach is not very stable and needs very pertinent examples in order to give good results. However, it can be useful in some cases.

The second approach, which is rather robust is as follows. Using the examples entered by the user, a mean spectral reference is computed (remember that we are assuming that the objects are radiometrically homogeneous). This spectral reference is used to compute a spectral angle for all the pixels in the image. The spectral angle is thresholded. After that, the algorithm is identical as the SVM one: extract the connected components and count.

The following image shows an example of use of the application.

Obect counting results
Obect counting results

The red polygons are the examples selected by the operator. As you can see, some parameters can be selected on the GUI. The resulting objects are plotted in blue on top of the image.

What is also interesting about this application is that you can load a full scene (say, 30000×30000 pixels) and tune the algorithm on a small area. The tuning and the generation of the results for the small area will take only a few seconds. Once you are happy with the results, you can run the processing on the full image by using the “File” menu. The results can be exported as a raster labeled image or in vector format (shape or kml). With the latter option, and if you are using ortho-rectified images, you can upload the results of the counting to GoogleEarth!

The source code for the application is as usual available in the Mercurial site. You will need to update both the library and the applications in order to compile the application.

0 Comments on “Counting Objects”

Leave a Comment