Closed wkearn closed 6 months ago
The fillsinks code only fills sinks that are 1 pixel in size. So as of right now i would say it does not work at all.
Yes, filling sinks is not trivial...
I have something that replicates the MATLAB imreconstruct
functionality in C. I'll try to get a pull request together today so we can have a look. Even if we ultimately decide to implement sink filling in a different way, I think it will be a good point to start iterating on the library interface and to start building some frameworks for testing, benchmarking and documentation.
A replication of imreconstruct
would be perfect as morphological image reconstruction is much more flexible than most sink-filling algorithms. For example, it is relatively straight forward to fill only smaller sinks (see the fillsinks
function). This is important for handling endorheic basins, for example.
The MATLAB code uses morphological reconstruction as implemented by the Image Processing Toolbox (
imreconstruct
) to fill sinks in the DEM.@Teschl: you have some sink filling C code, right? How confident are you that it works?