[chronojump] kneeAngle: better calculateThresholdStart



commit 0cef4a22c1447b68c04df714f2804e07df56f0dc
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 2 12:04:50 2010 +0800

    kneeAngle: better calculateThresholdStart

 src/angle/kneeAngleFunctions.cpp |   28 ++++++++++++++++++++++++++--
 web/hardware_store.html          |   12 ++++++------
 web/hardware_store_es.html       |   12 ++++++------
 3 files changed, 38 insertions(+), 14 deletions(-)
---
diff --git a/src/angle/kneeAngleFunctions.cpp b/src/angle/kneeAngleFunctions.cpp
index ab09fa5..8fb0764 100644
--- a/src/angle/kneeAngleFunctions.cpp
+++ b/src/angle/kneeAngleFunctions.cpp
@@ -1258,8 +1258,32 @@ int calculateThresholdStart(IplImage * gray, bool pantsOrPoints)
 	//	thresholdStart = 10;
 	else if(brightness <= briMin)
 		thresholdStart = thresMin;
-	else
-		thresholdStart = brightness - briMin + thresMin;
+	else {
+		//thresholdStart = brightness - briMin + thresMin;
+
+		/*
+		   if briMin = 65, briMax = 85
+		   threshMin = 100, thresMax = 190
+		   a brightness of 82 means 85% of brightness. This will have a 85% of threshold: 176
+		*/
+
+		//85 - 65 = 20
+		int briRang = briMax - briMin;
+		//82 - 65 = 17
+		int briToMin = brightness - briMin;
+		//100 * 17 / 20 = 85
+		double briPercent = 100 * briToMin / briRang;
+
+		//190 - 100 = 90
+		int thresRang = thresMax - thresMin;
+		//100 * x / 90 = 85
+		//x = 85 * 90 /100
+		//x = 76.5
+		int thresPercentValue = briPercent * thresRang / 100;
+
+		//76,5 + 100 = (int) 176,5 = 176
+		thresholdStart = thresPercentValue + thresMin;
+	}
 
 	return thresholdStart;
 }
diff --git a/web/hardware_store.html b/web/hardware_store.html
index 4fc550d..5174bd1 100644
--- a/web/hardware_store.html
+++ b/web/hardware_store.html
@@ -50,7 +50,7 @@
 				<div id="slide1">
 					<ul>
 						<li><a href="#chronopic3"><img src="images/chronopic3.png" alt="Chronopic3"></a></li>
-						<li><a href="#platform-rigid"><img src="images/pending2.png" alt="Platform rigid"></a></li>
+						<li><a href="#platform-rigid"><img src="images/chronojump_circuit_board_platform_small.png" alt="Platform rigid"></a></li>
 						<li><a href="#platform-flexible"><img src="images/pending2.png" alt="Platform flexible"></a></li>
 						<li><a href="#photocells"><img src="images/velleman_connecting5.jpg" alt="Photocells"></a></li>
 					</ul>
@@ -82,18 +82,18 @@
 						<tr><th colspan="2"><h3>Circuit board jump platform</h3></th></tr>
 						<tr><td colspan="2" bgcolor="#6c77ab" height="1px"></td></tr>
 						<tr valign="top"><td rowspan="2">
-								<img src="images/pending2.png" alt="Chronopic3">
+								<img src="images/chronojump_circuit_board_platform_small.png" alt="Chronojump circuit board platform">
 								</td><td width="100%">
-								High quality platform. Resistant to flexion (fiberglass) and with good conductivity. All circuit area produces contact. Opossite to old rods platforms, here here are no false contacts or problems produced by the toes being placed between rods at raising or falling.
-								<br><br>Sizes:
+								High quality platform. Resistant to flexion (fiberglass) and with good conductivity. All circuit area produces contact. Opossite to old rods platforms, here here are no false contacts or problems produced by the toes being placed between rods at raising or falling. Sizes:
 								<ul>
 									<li>Din A2
 									<li>Din A3
+									<li>Din A4
 									<li>(You can ask for other sizes)
 								</ul>
 								</td></tr>
 								<tr><td valign="bottom">
-								Price: still unknown.
+								Price will be published and product available at April 4th. Thanks for waiting.
 							</td>
 					</tr></table>
 				</div>
@@ -102,7 +102,7 @@
 						<tr><th colspan="2"><h3>Flexible jump platform</h3></th></tr>
 						<tr><td colspan="2" bgcolor="#6c77ab" height="1px"></td></tr>
 						<tr valign="top"><td rowspan="2">
-								<img src="images/pending2.png" alt="Chronopic3">
+								<img src="images/pending2.png" alt="Chronojump flexible platform">
 								</td><td width="100%">
 									Flexible platform with high contact area. Best balance between price, quality, transport and storage.
 								<br><br>Sizes:
diff --git a/web/hardware_store_es.html b/web/hardware_store_es.html
index 720f49c..e2cdd23 100644
--- a/web/hardware_store_es.html
+++ b/web/hardware_store_es.html
@@ -50,7 +50,7 @@
 				<div id="slide1">
 					<ul>
 						<li><a href="#chronopic3"><img src="images/chronopic3.png" alt="Chronopic3"></a></li>
-						<li><a href="#platform-rigid"><img src="images/pending3.png" alt="Platform rigid"></a></li>
+						<li><a href="#platform-rigid"><img src="images/chronojump_circuit_board_platform_small.png" alt="Platform rigid"></a></li>
 						<li><a href="#platform-flexible"><img src="images/pending3.png" alt="Platform flexible"></a></li>
 						<li><a href="#photocells"><img src="images/velleman_connecting5.jpg" alt="Photocells"></a></li>
 					</ul>
@@ -83,18 +83,18 @@
 						<tr><th colspan="2"><h3>Plataforma de saltos circuito impreso</h3></th></tr>
 						<tr><td colspan="2" bgcolor="#6c77ab" height="1px"></td></tr>
 						<tr valign="top"><td rowspan="2">
-								<img src="images/pending3.png" alt="Chronopic3">
+								<img src="images/chronojump_circuit_board_platform_small.png" alt="Chronojump circuit board platform">
 								</td><td width="100%">
-								Plataforma de alta calidad resistente a la flexión (fibra de vidrio) y con buena conductividad. A diferencia de las plataformas de varillas, la plataforma rígida produce contacto en toda su área evitando falsos contactos o caídas en zonas muertas.
-								<br><br>Tamaños:
+								Plataforma de alta calidad resistente a la flexión (fibra de vidrio) y con buena conductividad. A diferencia de las plataformas de varillas, la plataforma rígida produce contacto en toda su área evitando falsos contactos o caídas en zonas muertas. Tamaños:
 								<ul>
 									<li>Din A2
 									<li>Din A3
+									<li>Din A4
 									<li>(Puede pedir otros tamaños)
 								</ul>
 								</td></tr>
 								<tr><td valign="bottom">
-								Precio: por determinar.
+								El precio se publicará el 4 de abril. Esa misma fecha, el producto estará disponible. Gracias por la espera.
 							</td>
 					</tr></table>
 				</div>
@@ -103,7 +103,7 @@
 						<tr><th colspan="2"><h3>Platforma de saltos flexible</h3></th></tr>
 						<tr><td colspan="2" bgcolor="#6c77ab" height="1px"></td></tr>
 						<tr valign="top"><td rowspan="2">
-								<img src="images/pending3.png" alt="Chronopic3">
+								<img src="images/pending3.png" alt="Chronojump flexible platform">
 								</td><td width="100%">
 									Plataforma flexible con elevada superfície de contacto. Muy buena relación entre precio, calidad, capacidad de transporte y almacenamiento.
 								<br><br>Tamaños:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]