[Toss-devel-svn] SF.net SVN: toss:[1654] trunk/Toss
Status: Beta
Brought to you by:
lukaszkaiser
|
From: <luk...@us...> - 2012-01-24 14:44:09
|
Revision: 1654
http://toss.svn.sourceforge.net/toss/?rev=1654&view=rev
Author: lukaszkaiser
Date: 2012-01-24 14:43:58 +0000 (Tue, 24 Jan 2012)
Log Message:
-----------
Allow reco in bash mode.
Modified Paths:
--------------
trunk/Toss/Learn/Makefile
trunk/Toss/Learn/reco.cpp
trunk/Toss/www/learn.xml
Modified: trunk/Toss/Learn/Makefile
===================================================================
--- trunk/Toss/Learn/Makefile 2012-01-24 00:49:05 UTC (rev 1653)
+++ trunk/Toss/Learn/Makefile 2012-01-24 14:43:58 UTC (rev 1654)
@@ -39,11 +39,11 @@
%.reco:
if [[ $@ = Breakthrough* ]]; then \
- ./reco W B videos/$(basename $@).3gp > res.play.log; \
+ ./reco W B videos/$(basename $@).3gp n > res.play.log; \
elif [[ $@ = Pawn* ]]; then \
- ./reco W B videos/$(basename $@).3gp > res.play.log; \
+ ./reco W B videos/$(basename $@).3gp n > res.play.log; \
else \
- ./reco Q P videos/$(basename $@).3gp > res.play.log; \
+ ./reco Q P videos/$(basename $@).3gp n > res.play.log; \
fi
diff res.play.log examples/$(basename $@)
rm res.play.log
Modified: trunk/Toss/Learn/reco.cpp
===================================================================
--- trunk/Toss/Learn/reco.cpp 2012-01-24 00:49:05 UTC (rev 1653)
+++ trunk/Toss/Learn/reco.cpp 2012-01-24 14:43:58 UTC (rev 1654)
@@ -61,11 +61,13 @@
{
char res[2000];
int rnbr = -2;
+ int window = 1;
- if (argc != 4) {
- printf ("Usage: reco [letter for white] [letter for black] [filename]\n");
+ if ((argc != 4 && argc != 5) || (argc == 5 && argv[4][0] != 'n')) {
+ printf ("Usage: reco [white] [black] [filename] (n: no window) \n");
return (1);
}
+ if (argc == 5) { window = 0; }
// Print signature and set it in shapes module
printf ("[ | %c:1 {}; %c:1 {} | ]\n\n", argv[1][0], argv[2][0]);
@@ -73,7 +75,7 @@
setRedChar (argv[2][0]);
// Start recognition
- cvNamedWindow ("Reco", CV_WINDOW_AUTOSIZE);
+ if (window) { cvNamedWindow ("Reco", CV_WINDOW_AUTOSIZE); }
CvCapture* capture = cvCreateFileCapture (argv[3]);
// cvCreateCameraCapture( 0 );
IplImage *img, *col, *gray, *small, *smallpre;
@@ -154,7 +156,7 @@
from_point (p.shape[s].end), CV_RGB (200, 100, 100), 3);
}
}
- cvShowImage( "Reco", small );
+ if (window) { cvShowImage( "Reco", small ); }
if (time % timeSTEP == 0) { // wait timeSTEP frames
int ok_lines = 0;
for( i = 0; i < lines->total; i++ ) {
@@ -205,8 +207,10 @@
for (int i = 0; i < SIZEX*SIZEY*24; i++) fullsh_str[i] = 0;
}
time++;
- char c = cvWaitKey (50);
- if (c == 27) break;
+ if (window) {
+ char c = cvWaitKey (50);
+ if (c == 27) break;
+ }
}
cvReleaseCapture (&capture);
cvDestroyWindow ("Reco");
Modified: trunk/Toss/www/learn.xml
===================================================================
--- trunk/Toss/www/learn.xml 2012-01-24 00:49:05 UTC (rev 1653)
+++ trunk/Toss/www/learn.xml 2012-01-24 14:43:58 UTC (rev 1654)
@@ -14,7 +14,9 @@
<section title="Breakthrough">
<subsection>Resulting game: </subsection>
- <a href="videos/Breakthrough001.toss.txt">toss file</a> <br/>
+ <a href="videos/Breakthrough001.toss.txt">toss file</a>,
+ <a href="http://tplay.org/index.html?simple=true?game=Breakthrough"
+ >play</a> <br/>
<subsection>Illustrating plays and positions not won by anyone</subsection>
<br/>
@@ -31,7 +33,9 @@
<section title="Connect4">
<subsection>Resulting game: </subsection>
- <a href="videos/Connect4001.toss.txt">toss file</a> <br/>
+ <a href="videos/Connect4001.toss.txt">toss file</a>,
+ <a href="http://tplay.org/index.html?simple=true?game=Connect4"
+ >play</a> <br/>
<subsection>Illustrating plays and positions not won by anyone</subsection>
<br/>
@@ -71,7 +75,9 @@
<section title="Pawn-Whopping">
<subsection>Resulting game: </subsection>
- <a href="videos/Pawn-Whopping001.toss.txt">toss file</a> <br/>
+ <a href="videos/Pawn-Whopping001.toss.txt">toss file</a>,
+ <a href="http://tplay.org/index.html?simple=true?game=Pawn-Whopping"
+ >play</a> <br/>
<subsection>Illustrating plays and positions not won by anyone</subsection>
<br/>
@@ -97,7 +103,9 @@
<section title="Tic-Tac-Toe">
<subsection>Resulting game: </subsection>
- <a href="videos/Tic-Tac-Toe001.toss.txt">toss file</a> <br/>
+ <a href="videos/Tic-Tac-Toe001.toss.txt">toss file</a>,
+ <a href="http://tplay.org/index.html?simple=true?game=Tic-Tac-Toe"
+ >play</a> <br/>
<subsection>Illustrating plays and positions not won by anyone</subsection>
<br/>
@@ -134,7 +142,9 @@
<section title="Gomoku">
<subsection>Resulting game: </subsection>
- <a href="videos/Gomoku001.toss.txt">toss file</a> <br/>
+ <a href="videos/Gomoku001.toss.txt">toss file</a>,
+ <a href="http://tplay.org/index.html?simple=true?game=Gomoku"
+ >play</a> <br/>
<subsection>Illustrating plays and positions not won by anyone</subsection>
<br/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|