Skip to content

Commit

Permalink
Updated the RGB to HSL code to calucate correctly
Browse files Browse the repository at this point in the history
git-svn-id: https://android-motion-detection.googlecode.com/svn/trunk@8 996b93ed-3e4d-4b21-1044-74bd19560d1d
  • Loading branch information
[email protected] committed Aug 28, 2011
1 parent 8a48545 commit 7faf772
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/com/jwetherell/motion_detection/MotionDetectionActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,6 @@ public void onCreate(Bundle savedInstanceState) {
previewHolder = preview.getHolder();
previewHolder.addCallback(surfaceCallback);
previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

int r = 255;
int g = 0;
int b = 0;
float[] HSL = ImageProcessing.convertToHSL(r, g, b);
String out = "r="+r+" g="+g+" b="+b+" h="+(HSL[ImageProcessing.H])+" s="+(HSL[ImageProcessing.S])+" l="+(HSL[ImageProcessing.L]);
Log.d(TAG, out); //HSL: 0° 100% 50%

r = 0;
g = 255;
b = 0;
HSL = ImageProcessing.convertToHSL(r, g, b);
out = "r="+r+" g="+g+" b="+b+" h="+(HSL[ImageProcessing.H])+" s="+(HSL[ImageProcessing.S])+" l="+(HSL[ImageProcessing.L]);
Log.d(TAG, out); //HSL: 120° 100% 50%

r = 0;
g = 0;
b = 255;
HSL = ImageProcessing.convertToHSL(r, g, b);
out = "r="+r+" g="+g+" b="+b+" h="+(HSL[ImageProcessing.H])+" s="+(HSL[ImageProcessing.S])+" l="+(HSL[ImageProcessing.L]);
Log.d(TAG, out); //HSL: 240° 100% 50%
}

@Override
Expand Down

0 comments on commit 7faf772

Please sign in to comment.