Skip to content

Commit

Permalink
Updated geotrellis sigmoidal contrast calculation
Browse files Browse the repository at this point in the history
Signed-off-by: Grigory Pomadchin <gr.pomadchin@gmail.com>
  • Loading branch information
JanssenBrm authored and pomadchin committed Dec 23, 2020
1 parent 30c1a43 commit b630b12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Remove explicit unused Scaffeine dependency from projects [#3314](https://github.com/locationtech/geotrellis/pull/3314)
- Remove an excessive close after the abort call in S3RangeReader [#3324](https://github.com/locationtech/geotrellis/pull/3324)
- Fix sigmoidal contrast calculation [#3328](https://github.com/locationtech/geotrellis/pull/3328)

## [3.5.1] - 2020-11-23

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ object SigmoidalContrast {
(intensity + (1<<(bits-1))) / ((1<<bits)-1)
}

val numer = 1/(1+math.exp(beta*(alpha-u))) - 1/(1+math.exp(beta))
// see https://legacy.imagemagick.org/Usage/color_mods/#sigmoidal
// and https://github.com/locationtech/geotrellis/issues/3326
val numer = 1/(1+math.exp(beta*(alpha-u))) - 1/(1+math.exp(beta*alpha))
val denom = 1/(1+math.exp(beta*(alpha-1))) - 1/(1+math.exp(beta*alpha))
val gu = math.max(0.0, math.min(1.0, numer / denom))

Expand Down

0 comments on commit b630b12

Please sign in to comment.