Skip to content

Commit

Permalink
Mise à jour docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Gagnon committed Apr 20, 2017
1 parent e9fa2eb commit 53c5b30
Show file tree
Hide file tree
Showing 93 changed files with 3,851 additions and 25,969 deletions.
6 changes: 3 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ protected Bitmap doInBackground(String... params) {

value = (value * 2.55f);

// 259 is an arbitrary value used to reduce or increase the histogram range according to the value
float factor = (259 * (value + 255)) / (255 * (259 - value));

Bitmap result = src.copy(Bitmap.Config.ARGB_8888, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ protected Bitmap doInBackground(String... params) {
Color.RGBToHSV(r, g, b, hsvPixels[i]);

// Save HSV Value in a 0-255 range
int rangedHSVvalue = valueToRange(hsvPixels[i][2]);
int rangedHSVvalue = hueValueToColorRange(hsvPixels[i][2]);
valueHistogram[rangedHSVvalue]++;
}

generateCDF();

for (int i = 0; i < bitmapWidth * bitmapHeight; i++) {
float value = hsvPixels[i][2];
int range = valueToRange(value);
int range = hueValueToColorRange(value);
int histoEqualValue = histoEqual(range);
float changedValue = rangeToValue(histoEqualValue);
float changedValue = colorRangeToHueValue(histoEqualValue);
hsvPixels[i][2] = changedValue;

float[] hsv = hsvPixels[i];
Expand All @@ -84,7 +84,7 @@ protected Bitmap doInBackground(String... params) {
}

/**
* Histogram euqalization formula, calculating the new value.
* Histogram equalization formula, calculating the new value.
* @param v Original value
* @return New value
*/
Expand Down Expand Up @@ -119,7 +119,7 @@ private void generateCDF() {
* @param range Value between 0 and 255
* @return Value of HSV color between 0 and 1
*/
private float rangeToValue(int range) {
private float colorRangeToHueValue(int range) {
return range / 255f;
}

Expand All @@ -129,7 +129,7 @@ private float rangeToValue(int range) {
* @param value The HSV value
* @return Range value between 0 and 255
*/
private int valueToRange(float value) {
private int hueValueToColorRange(float value) {
return (int) Math.floor(value * 255);
}

Expand Down
1 change: 0 additions & 1 deletion codeiris/codeIrisExport.json

This file was deleted.

Loading

0 comments on commit 53c5b30

Please sign in to comment.