Alvaro Cassinelli
/
skinGames_forktest
just a test
Fork of scoreLight_Advanced by
Diff: classLaserSensingTrajectory.h
- Revision:
- 0:345b3bc7a0ea
- Child:
- 1:a4050fee11f7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classLaserSensingTrajectory.h Wed Mar 28 14:40:01 2012 +0000 @@ -0,0 +1,45 @@ +#ifndef LSDTRAJECTORY_H +#define LSDTRAJECTORY_H + +#include <vector> +using namespace std; + +// CONTRAST RATIO to compute autoThreshold: +#define MIN_CONTRAST_RATIO 1.3//2.4 +#define THRESHOLD_FACTOR 0.5//0.75 // 2/3 or 1/2 are good values + +struct laserSensingPoint { + // Position and color (after rendering) + int x, y; // position of the point (after rendering - its integer, because it is in "laser projector pixels") + char color; // laser color of the point (we will use the first three bits to set the RGB colors) + // Detection: + float intensity; // detected intensity + int lightZone; // the thresholded light zone +}; + + +class LaserSensingTrajectory { + +public: + + LaserSensingTrajectory(); + ~LaserSensingTrajectory(); + + // METHODS: + void processSensedData(); + + // DATA: + vector <laserSensingPoint> lsdTrajectory; + char displayColor; + + // parameters for thresholding: + float autoThreshold; + + // Statistics and tests: + float maxI, minI; // Max and Min intensity + bool lightTouched; // true if something went over the autoThreshold for the whole loop +}; + +#endif + +