While printing out the raw pixel values of a GEOTIFF land cover tile I found 90 % of pixels have normal values i.e. those that the documentation describes (8 bit integers describing a land cover type). However several raw pixel values have been found to be zero. From this link - http://eoedu.belspo.be/en/guide/postclas.asp?section=3.8 I presume this means that they are unclassified.Has anyone performed these post-classification techniques such as modal filtering using their own code or other software so that these unclassified pixels do get 'attached' to some land cover type ? If necessary I can upload an image of the necessary GEOTIFF file.
There are three main reasons to flag a pixel as NoData in a classified image :
1) No input data : remote sensing dat could be missing for several reasons, including cloud, cloud shadow, temporary snow cover, darkness, sensor dysfunctionning,
2) Insufficient information : there was a valid value for the pixel, but not enough information to classify it.
3) No output class : the classification system is not complete for the area of interest, so that a pixel cannot be assigned a class (e.g. a pixel covered by solar panels might not fit into the categories of a map designed 20 years ago or sea water might not be included in a terrestrial habitat map...). Gap filling doesn't help in this case, except if you know the missing class.
As mentioned by @Chris W, gap filling is a dangerous process, especially when you cannot take advantage of spatial autocorrelation, because you simply guess some values with a very limited number of information. Your suggestion to use modal filter is not a bad one, but it was initially designed for the removal of salt and pepper effect and might smooth your data, so you should only use the filtered value where you have nodata pixel. You can design more specific decision rules based on the neighborhood if you have expert knowledge about your area of interest (e.g. river pixels must be connected, holes inside crop fields are rare...). However, the best way is to try filling the gaps with another map if available (e.g. Open street map, global forest map, lower resolution global maps, etc)