Binary mask filtering application
What changes will be made and why they would make a better Orfeo ToolBox?
New application to filter binary masks (water masks, cloud masks, etc).
High level description
The application will be based on the BinaryShapeOpeningImageFilter class of ITK and more generally on the Label object representation and manipulation framework (see http://www.insight-journal.org/browse/publication/176).
An attribute is computed for each object in the binary mask, where we define an object as a set of connected pixels in the mask. This attribute can be for example the number of pixels in the image.
If the value of the attribute of an object is lower (or higher, depending on a parameter) than a threshold (parameter), the object is then removed by the filter.
For example if the attribute is the number of pixels, the application will remove all the small objects. But other attributes could be used (see Alternatives for implementations)
The connectivity of the pixels (4-connectivity or 8-connectivity) is a parameter of the application.
Risks and benefits
This application would be complementary to the BinaryMorphologicalOperation application of the OTB to do image processing on binary images.
Alternatives for implementations
The choice of the attribute could be a parameter of the application, Other attributes that could be used
- Physical Size : the size of the object in physical unit. It is equal to the Size multiplicated by the physical pixel size.
- SizeOnBorder : the number of pixels in the objects which are on the border of the image. A pixel on several borders (a pixel in a corner) is counted only one time, so the size on border can’t be greater than the size of the object. This attribute is particulary useful to remove the objects which are touching too much the border
- PhysicalSizeOnBorder : the physical size of the objects which are on the border of the image
We could also use the BinaryStatisticsOpeningImageFilter class of the ITK : in addition to the mask we provide a feature image (which is the grayscale image to be masked), and the attributes of the objects are computed using the information of the feature image. Possible attributes are :
- Minimum : minimum value in the feature image for the object
- Maximum : Maximum value in the feature image for the object
- Mean : mean of the pixel values in the object
- Sum : Sum of all the pixels values in the object
- Sigma : standard deviation of all the pixels values in the object
- Variance : variance of all the pixels values in the object
- Median : median of all the pixels values in the object
- Kurtosis : kurtosis of all the pixels values in the object
- Skewness : skewness of all the pixels values in the object
Instead of removing all objects whose attribute is inferior to a threshold, it is also possible to keep only the N objects with the highest (or lowest) attribute value. I'm not sure if this feature would be useful in remote sensing.
Who will be developing the proposed changes?