Skip to content

Commit

Permalink
- updated gradle to snapshot
Browse files Browse the repository at this point in the history
- Comments in ColorHsv
  • Loading branch information
lessthanoptimal committed Oct 1, 2014
1 parent e673767 commit 2b7cd09
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ allprojects {
apply plugin: 'eclipse'

group = 'org.boofcv'
version = '0.18'
version = '0.19-SNAPSHOT'
}

subprojects {
Expand Down Expand Up @@ -54,7 +54,7 @@ subprojects {
// compile files("$libpath/lib/DDogleg.jar")
// compile files("$libpath/lib/GeoRegression.jar")

compile group: 'org.georegression', name: 'georegression', version: '0.7'
compile group: 'org.georegression', name: 'georegression', version: '0.8-SNAPSHOT'

testCompile group: 'junit', name: 'junit', version: '4.11'
}
Expand Down
13 changes: 13 additions & 0 deletions change.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ Change Log

Date Format: year/month/day

---------------------------------------------
Date : 2014
Version : Alpha 0.19

TODO
* Square Detector. Create set of images in validation boof with hand selected corners
Improve performance across a range of distances and orientations
* Square Image: Better example image than the dog, which can have ambiguous orientation
* Hough - investigate bug report
* Template with transparent pixels
* Android Demo: Automatic Threshold. Dim slider for global
* Look at Sandreas's NewWarp

---------------------------------------------
Date : 2014/9/22
Version : Alpha 0.18
Expand Down
37 changes: 35 additions & 2 deletions main/ip/src/boofcv/alg/color/ColorHsv.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,45 @@
* <p>
* Color conversion between RGB and HSV color spaces. HSV stands for Hue-Saturation-Value. "Hue" has a range of [0,2*PI]
* and "Saturation" has a range of [0,1], the two together represent the color. While "Value" has the same range as the
* input pixels and represents how light/dark the color is.
* input pixels and represents how light/dark the color is. Original algorithm taken from [1] and modified slightly.
* </p>
*
* <p>
* NOTE: The hue is represented in radians instead of degrees, as is often done.
* NOTE: Hue will be set to NaN if it is undefined. It is undefined when chroma is zero, which happens when the input
* color is a pure gray (e.g. same value across all color bands).
* </p>
*
* <p>
* RGB to HSV:<br>
* <pre>
* min = min(r,g,b)
* max = max(r,g,b)
* delta = max-min // this is the chroma
* value = max
*
* if( max != 0 )
* saturation = delta/max
* else
* saturation = 0;
* hue = NaN
*
* if( r == max )
* hue = (g-b)/delta
* else if( g == max )
* hue = 2 + (b-r)/delta
* else
* hue = 4 + (r-g)/delta
*
* hue *= 60.0*PI/180.0
* if( hue < 0 )
* hue += 2.0*PI
*
* </pre>
* </p>
*
* <p>
* [1] http://www.cs.rit.edu/~ncs/color/t_convert.html
* </p>
*
* @author Peter Abeles
Expand All @@ -53,7 +87,6 @@
This doesn't seem to improve the runtime noticeably and makes the code uglier.
*/

public class ColorHsv {

// 60 degrees in radians
Expand Down
4 changes: 4 additions & 0 deletions main/ip/test/boofcv/alg/color/TestColorHsv.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public void backAndForth_F64_and_F32() {
check(0.25, 0.5, 0.75);
check(0.8, 0.1, 0.75);
check(151, 151, 151);
check(151, 120, 120);
check(120, 151, 120);
check(120, 120, 151);


for( int i = 0; i < 50; i++ ) {
double r = rand.nextDouble();
Expand Down

0 comments on commit 2b7cd09

Please sign in to comment.