Automate process of creating a mask


ts@...
 

Dear Rasterios,

beeing quite new to rasterio I'm looking for help regarding the following:

I've a large amount of 1 Channel Satellite imaginary. While the data contains no-data information around the actual motif nearly black areas do exist which I'd like to cleanup.


Following the docs masking by shapefile  It perfectly works to crop my image to the desired image area:



The red shape is quite inaccurate drawn just for the purpose of testing!

My question now is, how can I automate the creation of a shapefile to mask with based on the grey value or a defined border within my data? Having a closer look  on the edge of my desired image area my problem should get clear. The border is fuzzy, further the nearly black pixel value could exists in the desired motif.



I'm thankful if you could show me a direction to automate the creation of a shape mask (or geojson which should work as well from what I read at docs)!

– Toni

Join main@rasterio.groups.io to automatically receive all group messages.