ESA-PhiLab / iris

Semi-automatic tool for manual segmentation of multi-spectral and geo-spatial imagery.
GNU General Public License v3.0
123 stars 39 forks source link

Rework image scaling #11

Closed aliFrancis closed 2 years ago

aliFrancis commented 2 years ago

Takes idea for image visualisation implemented by @csaybar in #6 and reduces complexity for user.

Previous behaviour:

User defined a view in segmentation.json file, and could choose to use stretch parameter, set to minmax (bands normalised to 0->1), or linear, which clipped 2% of the highest and lowest values, so that contrast was increased and extreme values were ignored. If no stretch parameter was defined in a view, then it would default to minmax.

This was problematic because of the hard-coding of 2%, and because it defined three new terms for the user to learn (stretch, minmax and linear) whilst only providing one extra piece of functionality.

New behaviour:

Each view now has an optional argument, clip, which defaults to 0 if not given (giving the behaviour of minmax before). When set to, e.g. 3, it will clip 3% of minimum and maximum values, giving the behaviour of linear, but not hard-coded to 2%.

kwarg clip removed from Project.render_image as it was unused and conflicted with these changes.