[chronojump] kneeAngle: can show stored minimum frame and delete it



commit fa9f0837577a1dca327908392c08c2b6954aa789
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Mar 29 14:55:03 2010 +0800

    kneeAngle: can show stored minimum frame and delete it

 src/angle/kneeAngle.cpp               |   29 ++++++++++++++++-----
 src/angle/kneeAngleGlobal.cpp         |    3 +-
 src/angle/kneeAngle_black_contour.png |  Bin 40297 -> 45421 bytes
 src/angle/kneeAngle_black_contour.svg |   44 ++++++++++++++++++++++++++++++---
 4 files changed, 64 insertions(+), 12 deletions(-)
---
diff --git a/src/angle/kneeAngle.cpp b/src/angle/kneeAngle.cpp
index 71666d6..cee8322 100644
--- a/src/angle/kneeAngle.cpp
+++ b/src/angle/kneeAngle.cpp
@@ -200,7 +200,6 @@ int main(int argc,char **argv)
 	IplImage *frame=0,*frame_copy=0,*gray=0,*segmented=0,*edge=0,*temp=0,*output=0;
 	IplImage *outputTemp=0, *frame_copyTemp=0;
 	IplImage *segmentedValidationHoles=0;
-	IplImage *segmentedValidationHoles2=0;
 	IplImage *foundHoles=0;
 	IplImage *result=0;
 	IplImage *resultStick=0;
@@ -218,7 +217,6 @@ int main(int argc,char **argv)
 		gui = cvLoadImage("kneeAngle_intro.png");
 		cvShowImage("gui", gui);
 		programMode = menu(gui, font);
-		//printf("programMode: %d\n", programMode);
 	}
 	
 	if(programMode == skinOnlyMarkers) {
@@ -227,7 +225,6 @@ int main(int argc,char **argv)
 	}
 	else if(programMode == blackOnlyMarkers) {	// || programMode == validation) ?
 		usingContour = true;
-		//gui = cvLoadImage("kneeAngle_black.png");
 		gui = cvLoadImage("kneeAngle_black_contour.png");
 	} 
 	else
@@ -261,7 +258,6 @@ int main(int argc,char **argv)
 		cvNamedWindow("result",1);
 	} else if (programMode == skinOnlyMarkers || programMode == blackOnlyMarkers) {
 		cvNamedWindow("threshold",1);
-		//cvNamedWindow("Holes_on_contour",1);
 	}
 	else if (programMode == blackWithoutMarkers)
 		cvNamedWindow("result",1);
@@ -438,7 +434,7 @@ int main(int argc,char **argv)
 			framesCountShowMessage ++;
 			if(framesCountShowMessage >= framesCountShowMessageAt) {
 				eraseGuiResult(gui, true);
-				sprintf(label, "frame: %d...", framesCount);
+				sprintf(label, "frame: %d... (%d%%)", framesCount, 100*framesCount/startAt);
 				imageGuiResult(gui, label, font);
 				cvWaitKey(25); //to allow gui image be shown
 				framesCountShowMessage = 0;
@@ -795,7 +791,8 @@ int main(int argc,char **argv)
 						threshold, thresholdROIH, thresholdROIK, thresholdROIT,
 						thresholdROISizeH, thresholdROISizeK, thresholdROISizeT,
 						thresholdLargestContour, usingContour);
-				
+			
+				//this stores image with above printOnScreen data	
 				if(storeResultImage) {
 					cvCopy(frame_copy,result);
 					storeResultImage = false;
@@ -1319,7 +1316,14 @@ int main(int argc,char **argv)
 			//if a threshold button is pushed, force a pause
 			forcePause = true;
 		}
-		
+		else if(key == 'm') {
+			forcePause = true;
+			mouseClicked = MINIMUMFRAMESHOW;
+		}
+		else if(key == 'd') {
+			forcePause = true;
+			mouseClicked = MINIMUMFRAMEDELETE;
+		}
 		
 		//pause is also forced on skin if a marker is not ok
 		if (mouseClicked == PLAYPAUSE || key == 'p' || forcePause) 
@@ -1384,6 +1388,17 @@ int main(int argc,char **argv)
 					done = true;
 				}
 				
+				else if(mouseClicked == MINIMUMFRAMESHOW || key == 'm') {
+					cvShowImage("Minimum Frame", result);
+					imageGuiResult(gui, "Shown minimum frame. Paused.", font);
+				}
+				else if(mouseClicked == MINIMUMFRAMEDELETE || key == 'd') { 
+					minThetaMarked = 360;
+					cvShowImage("Minimum Frame", result);
+					imageGuiResult(gui, "Deleted stored angle. Paused.", font);
+				}
+		
+				
 				else if(mouseClicked == ZOOM || key == 'z') {
 					if(zoomed) {
 						eraseGuiMark(gui, ZOOM);
diff --git a/src/angle/kneeAngleGlobal.cpp b/src/angle/kneeAngleGlobal.cpp
index bf61d56..0c6178d 100644
--- a/src/angle/kneeAngleGlobal.cpp
+++ b/src/angle/kneeAngleGlobal.cpp
@@ -100,7 +100,8 @@ enum {
 	SKNEEMORE = 23, SKNEELESS = 24, 
 	STOEMORE = 25, STOELESS = 26,
 	TCONTOURMORE = 27, TCONTOURLESS = 28,
-	BACKTOCONTOUR = 29
+	BACKTOCONTOUR = 29,
+	MINIMUMFRAMESHOW = 30, MINIMUMFRAMEDELETE = 31
 }; 
 
 enum { TOGGLENOTHING = -1, TOGGLEHIP = 0, TOGGLEKNEE = 1, TOGGLETOE = 2};
diff --git a/src/angle/kneeAngle_black_contour.png b/src/angle/kneeAngle_black_contour.png
index d4aeff4..f540d0d 100644
Binary files a/src/angle/kneeAngle_black_contour.png and b/src/angle/kneeAngle_black_contour.png differ
diff --git a/src/angle/kneeAngle_black_contour.svg b/src/angle/kneeAngle_black_contour.svg
index 9d808cf..8e2464f 100644
--- a/src/angle/kneeAngle_black_contour.svg
+++ b/src/angle/kneeAngle_black_contour.svg
@@ -4725,6 +4725,20 @@
          offset="1.0000000"
          style="stop-color:#ffffff;stop-opacity:0.34020618;" />
     </linearGradient>
+    <inkscape:perspective
+       id="perspective3697"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective3728"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
   </defs>
   <sodipodi:namedview
      id="base"
@@ -4738,7 +4752,7 @@
      inkscape:pageshadow="2"
      inkscape:zoom="1.3066933"
      inkscape:cx="250.99475"
-     inkscape:cy="146.63438"
+     inkscape:cy="147.78232"
      inkscape:document-units="px"
      inkscape:current-layer="capa1"
      showgrid="false"
@@ -4815,7 +4829,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -5493,8 +5507,9 @@
        id="text2560-9"><tspan
          sodipodi:role="line"
          x="154.60439"
-         y="164.84676"
-         id="tspan2562-8">Find the three points using contour</tspan></text>
+         y="208.45424"
+         id="tspan3716"
+         style="font-size:10px;font-family:Chandas;-inkscape-font-specification:FreeMono">Find the three points using contour.</tspan></text>
     <g
        id="g41169"
        transform="translate(-1.9946289e-4,-7.3218317)">
@@ -5711,5 +5726,26 @@
            sodipodi:nodetypes="ccccc" />
       </g>
     </g>
+    <text
+       xml:space="preserve"
+       style="font-size:10px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Chandas"
+       x="153.44901"
+       y="184.78506"
+       id="text2560-9-5"><tspan
+         sodipodi:role="line"
+         x="153.44901"
+         y="184.78506"
+         id="tspan3718-2"
+         style="font-size:12px;font-family:FreeMono;-inkscape-font-specification:FreeMono">m: See Minimum angle stored</tspan><tspan
+         sodipodi:role="line"
+         x="153.44901"
+         y="199.78506"
+         id="tspan3716-6"
+         style="font-size:12px;font-family:FreeMono;-inkscape-font-specification:FreeMono">d: delete it</tspan><tspan
+         sodipodi:role="line"
+         x="153.44901"
+         y="214.78506"
+         style="font-size:12px;font-family:FreeMono;-inkscape-font-specification:FreeMono"
+         id="tspan3769">1: help (unimplemented)</tspan></text>
   </g>
 </svg>



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