I am looking for a way to identify missing pixels in .tifs. For example, in the attached image there is a row and a column of missing pixels across the image.
The no data/ missing pixels after some investigation appear to have the value of 0 and appear across all three bands.
Can anyone recommend a way, via a piece of software/script, that could do this in bulk, say for 400-500 .tifs at a time, rather than having to do it manually/visually for each .tif?
Ideally, I'd like something that could give me a printed output in a .txt which lists all the .tifs that have missing pixels, which I could then investigate visually.
The software I have access to is; FME, ArcMap, QGIS, Python, and excel, however I may be able to get hold of something not on that list.
I have attempted a solution using Python with numpy and gdal (shown below), however I am new to python so my script is probably trash. I've played around with using numpy array and GDAL band statistics and I've got the expected results (both methods identify 0 values when expected), however I'm struggling to find a way to loop through a folder of 400/500 images and have some sort of summary statistics for all the images rather than 400/500 individual results.
import numpy as np
from osgeo import gdal
ds = gdal.Open("single.tif)
print "[ RASTER BAND COUNT ] : ", ds.RasterCount
for band in range( ds.RasterCount ) :
band += 1
print "[ BAND ] : ", band
srcband = ds.GetRasterBand(band)
if srcband is None:
continue
stats = srcband.GetStatistics ( True, True )
if stats is None:
continue
print "[ STATS ] = Minimum=%.3f, Maximum=%.3f" % (
stats[0], stats[1])
myArray = np.array(ds.GetRasterBand(3).ReadAsArray())
print myArray
np.savetxt("Output.csv")
if 0 in myArray:
print "yes"
else:
print "no"
gdalinfo -hist -json
gives you good output to write a little script to do that.