I am working with thousands of tiled (2km x 2km) 4-band NAIP images. When I diced the images in Erdas, the program corrupted many of the tiles. The screenshot shows an example of one of the corrupted rasters. You can see there is a small strip of actual pixel values at the top that range from 0 - 255. It is likely that there could be a strip on any of the sides of the image. The larger black area contains all 0 values.
My attempts to programmatically scan the tiles for a maximum pixel value of 0 or a unique pixel count of 0 failed due to the small area of legitimate pixel values. This is a simplified approach I have been using:
import arcpy # input raster data is 8-bit unsigned integer with 4 bands (CIR) raster = r'D:\temp\4310605_ne_4_2.tif' p = arcpy.GetRasterProperties_management(raster, "MAXIMUM") if p == 0: print "there is a problem"
What fast and efficient method can I use for checking 4-band tiff files for these corrupted areas?