ubarsc / pyshepseg

Python implementation of image segmentation algorithm of Shepherd et al (2019) Operational Large-Scale Segmentation of Imagery Based on Iterative Elimination. Remote Sensing 11(6).
https://www.pyshepseg.org
MIT License
10 stars 4 forks source link

ensure no tiles are smaller than tileSize as a simple way of avoiding slivers #1

Closed gillins closed 3 years ago

gillins commented 3 years ago

@neilflood I think this is what you had in mind?

Note that when processing our test image (l8olre_p090r079_m201909201911_dbim6.img) with the default tileSize (4096) it now does it as one tile in this PR. But seems to work well with smaller tileSizes.

Merge if you are happy...

neilflood commented 3 years ago

Yes, that's just what I had in mind, thank you.

By the way, I still think that the docstring comment about tileSize is incorrect. It seems to me that it does include the overlap - it is the total amount read in for the tile. Isn't it?

gillins commented 3 years ago

Hmmm depends how you define 'includes overlap' :smile: I don't add the overlap to the tilesize to extract tiles. I just shift the top left point each time so that there is an overlap.

But yes, there is an overlap between each tile. How would you word it?

neilflood commented 3 years ago

re: tilesize/overlap. Yes, that's my point, it is not added on, because the size already includes the size of the overlap. Perhaps a longer sentence is required, e.g. "tileSize if the min width/height of tiles (in pixels). These tiles are overlapped by pixels, both horizontally and vertically". Would that be better?

gillins commented 3 years ago

I've just pushed something based on that. What do you think?