Hi everyone, I’ve been using GetHistogram but I need to support rasters with 
alpha channels and those run through nearblack. I don’t see masked 
histogramming mentioned in the docs. I do see the masked read functions, but it 
looks like numpy’s masked array histogram function is one of many ma functions 
that don't work correctly(?) (https://github.com/numpy/numpy/issues/10019)

Does anyone have any creative ideas to share?

For masked data, the simplest seems to be iteratively histogramming manually 
masked blocks.

It looks like nearblack can handle >4 bands, but I need multibyte dtypes. I was 
thinking of rasterizing a VRT that uses the new equations system to compute  A 
| (A >> 8) or maybe a two step equivalent of bool(A) -> sum(A) and running that 
through nearblack to make an alpha channel for the above method.


Appreciate everyone’s thoughts.

Will
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to