Laser Sensing Display for UI interfaces in the real world

Dependencies:   mbed

Fork of skinGames_forktest by Alvaro Cassinelli

Revision:
30:d8af03f01cd4
Parent:
25:74cb85b85fd2
Child:
32:52273c3291fe
--- a/classLaserSensingTrajectory.h	Wed Jun 20 03:25:49 2012 +0000
+++ b/classLaserSensingTrajectory.h	Fri Sep 21 10:02:35 2012 +0000
@@ -1,53 +1,53 @@
-#ifndef LSDTRAJECTORY_H
-#define LSDTRAJECTORY_H
-
-#include <vector>
-using namespace std;
-
-// CONTRAST RATIO to compute autoThreshold:
-#define MIN_CONTRAST_RATIO 1.7 // 3 seems good when lookup table does not work // This is the minimum contrast between max and min intensity necessary to "accept" a black and white zone
-#define THRESHOLD_FACTOR 0.55//0.75 // 2/3 or 1/2 are good values 
-
-struct laserSensingPoint {
-    // Position and color (after rendering)
-   unsigned short x, y; // position of the point (after rendering - its integer, because it is in "laser projector pixels")
-    // char color; // per point laser color (not used yet)
-    // Detection:
-    unsigned char intensity; // detected intensity (in fact, this will be the REFLECTIVITY RATIO if using LUT table, and it's between 0 and 1, but we will multiply by 255 to avoid using a float. 
-    signed char lightZone; // the thresholded light zone (allow for negative values for simply computing "negative" forces - although this is not necessarily the best option)
-};
-
-
-class LaserSensingTrajectory  {
-
-public:
-
-    LaserSensingTrajectory();
-    ~LaserSensingTrajectory();
-
-    // METHODS:
-    void processSensedData();
-    void setDelayMirrors(int); // in general, the delay will depend on the number of points being DISPLAYED (in other terms, on the size of lsdTrajectory).
-    void addDelayMirrors(int add_delay);
-
-    // DATA:
-    vector <laserSensingPoint> lsdTrajectory;
-    unsigned char displayColor; // per blob color
-
-    // software adjustement of mirror delay:
-    unsigned char delayMirrorSamples; // this is required because it will affect the way the blob behaves - it 
-    //could be in the laser renderer, but by putting it here we can have more per-blob fine tunning
-
-    // parameters for thresholding:
-    unsigned char autoThreshold; // 0 to 255
-    
-    // Statistics and tests:
-    //float lightRatio;
-    unsigned char maxI, minI;     // Max and Min intensity RATIOS (normalized between 0 and 255)
-    bool lightTouched;     // true if something went over the autoThreshold for the whole loop
- //   char coko;
-};
-
-#endif
-
-
+#ifndef LSDTRAJECTORY_H
+#define LSDTRAJECTORY_H
+
+#include <vector>
+using namespace std;
+
+// CONTRAST RATIO to compute autoThreshold:
+#define MIN_CONTRAST_RATIO 1.7 // 3 seems good when lookup table does not work // This is the minimum contrast between max and min intensity necessary to "accept" a black and white zone
+#define THRESHOLD_FACTOR 0.5 //0.75 // 2/3 or 1/2 are good values 
+
+struct laserSensingPoint {
+    // Position and color (after rendering)
+   unsigned short x, y; // position of the point (after rendering - its integer, because it is in "laser projector pixels")
+    // char color; // per point laser color (not used yet)
+    // Detection:
+    unsigned char intensity; // detected intensity (in fact, this will be the REFLECTIVITY RATIO if using LUT table, and it's between 0 and 1, but we will multiply by 255 to avoid using a float. 
+    signed char lightZone; // the thresholded light zone (allow for negative values for simply computing "negative" forces - although this is not necessarily the best option)
+};
+
+
+class LaserSensingTrajectory  {
+
+public:
+
+    LaserSensingTrajectory();
+    ~LaserSensingTrajectory();
+
+    // METHODS:
+    void processSensedData();
+    void setDelayMirrors(int); // in general, the delay will depend on the number of points being DISPLAYED (in other terms, on the size of lsdTrajectory).
+    void addDelayMirrors(int add_delay);
+
+    // DATA:
+    vector <laserSensingPoint> lsdTrajectory;
+    unsigned char displayColor; // per blob color
+
+    // software adjustement of mirror delay:
+    unsigned char delayMirrorSamples; // this is required because it will affect the way the blob behaves - it 
+    //could be in the laser renderer, but by putting it here we can have more per-blob fine tunning
+
+    // parameters for thresholding:
+    unsigned char autoThreshold; // 0 to 255
+    
+    // Statistics and tests:
+    //float lightRatio;
+    unsigned char maxI, minI;     // Max and Min intensity RATIOS (normalized between 0 and 255)
+    bool lightTouched;     // true if something went over the autoThreshold for the whole loop
+ //   char coko;
+};
+
+#endif
+
+