Created
February 19, 2018 08:11
-
-
Save midibyte/57d1be56bcbb2f71a393420f4b4b16b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//transforms a range of [iMin, iMax] to [outMin, outMax] | |
//returns the transformed value | |
int range_transform(int input, int iMax, int iMin, int outMax, int outMin) | |
{ | |
//transform range for histogram operation | |
int output = (((input - iMin) * (outMax - outMin)) / (iMax - iMin)) + outMin; | |
return output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment