Merged
Merge Request #30
·
created by
changes in stretch function
stretch function in image.h has been changed. It needed to be added by desired minimum.
From
stretch_function
into
master
-
Status changed to merged
-
mentioned in commit d05dd2b7d1a334ccb0c08a2dc5f61577af226a4c
Showing
2 changed files
Show diff stats
stim/image/image.h
@@ -403,7 +403,7 @@ public: | @@ -403,7 +403,7 @@ public: | ||
403 | double range = maxval - minval; //calculate the current range of the image | 403 | double range = maxval - minval; //calculate the current range of the image |
404 | double desired_range = high - low; //calculate the desired range of the image | 404 | double desired_range = high - low; //calculate the desired range of the image |
405 | for (size_t n = 0; n < N; n++) { //for each element in the image | 405 | for (size_t n = 0; n < N; n++) { //for each element in the image |
406 | - result.data()[n] = desired_range * (img[n] - minval) / range; | 406 | + result.data()[n] = desired_range * (img[n] - minval) / range + low; |
407 | } | 407 | } |
408 | return result; | 408 | return result; |
409 | } | 409 | } |