Alvaro Cassinelli
/
skinGames_forktest
just a test
Fork of scoreLight_Advanced by
Diff: classLaserSensingTrajectory.cpp
- Revision:
- 5:73cd58b58f95
- Parent:
- 4:f9d364f10335
- Child:
- 6:444859c27e78
--- a/classLaserSensingTrajectory.cpp Wed Apr 04 10:05:25 2012 +0000 +++ b/classLaserSensingTrajectory.cpp Thu Apr 05 12:29:14 2012 +0000 @@ -18,8 +18,9 @@ minI=4096; int auxSize=lsdTrajectory.size(); + // Compute minimum and maximum intensities: for (int i = 0; i < lsdTrajectory.size(); i++) { - float mesI=lsdTrajectory[(i+auxSize-delayMirrorSamples)%auxSize].intensity; // I need to do "auxSize-delay" instead of "-delay" only, because otherwise I will get negative values + float mesI=lsdTrajectory[i].intensity; if (maxI<mesI) maxI=mesI; if (minI>mesI) minI=mesI; } @@ -36,13 +37,17 @@ // This means that the loop will naturally become inside-out depending on the color of the main surface! (but will mantain its normal size). Much better and elegant solution than the // idea of the blob "constant" internal pressure... lightTouched=false; + // int counterLight=0; for (int i = 0; i < lsdTrajectory.size(); i++) { int delayedpoint=(i+auxSize-delayMirrorSamples)%auxSize; if (lsdTrajectory[delayedpoint].intensity>autoThreshold) { // this means a WHITE zone: lsdTrajectory[delayedpoint].lightZone= -1;//1; + // counterLight++; } else { // something touched: DARK ZONE lsdTrajectory[delayedpoint].lightZone= 2;//0; lightTouched=true; // (for the whole loop) } } + //coko=counterLight; +// lightRatio=1.0*counterLight/lsdTrajectory.size(); }