[Robotvision-commit] SF.net SVN: robotvision:[21] vision/src/main.cpp
Brought to you by:
phildavidson
From: <bre...@us...> - 2010-06-03 03:37:48
|
Revision: 21 http://robotvision.svn.sourceforge.net/robotvision/?rev=21&view=rev Author: brendasegal Date: 2010-06-03 03:37:42 +0000 (Thu, 03 Jun 2010) Log Message: ----------- minor change to int main() so that you never have to write the function name but just choose from 1, 2, 3 Modified Paths: -------------- vision/src/main.cpp Modified: vision/src/main.cpp =================================================================== --- vision/src/main.cpp 2010-06-02 18:34:39 UTC (rev 20) +++ vision/src/main.cpp 2010-06-03 03:37:42 UTC (rev 21) @@ -9,6 +9,7 @@ #include <stdio.h> #include <math.h> #include <string.h> +#include <conio.h> //#include "pipe.cpp" using namespace std; @@ -661,6 +662,11 @@ IplImage* image = cvLoadImage( img, CV_LOAD_IMAGE_COLOR ); + if (image == NULL) { + puts("unable to load the image"); + exit(0); + } + //display the original image cvShowImage("original", image); @@ -813,25 +819,43 @@ } else if(strcmp(readuser, "1")==0){ - printf("Function name?\n"); + printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); printf("%**>"); gets(functionName); printf("Video file? Remember: videos/...\n"); printf("%**>"); gets(fileName); - playVideo(functionName, fileName); + type = atoi(functionName); + + switch(type){ + + case(1): playVideo("findBuoy", fileName); break; + case(2): playVideo("finalFindPipe", fileName); break; + case(3): playVideo("findHedge", fileName); break; + } + + } else if(strcmp(readuser, "2")==0){ - printf("Function name?\n"); + printf("Type 1 for findBuoy, 2 for findPipe, 3 for findHedge\n"); printf("%**>"); gets(functionName); printf("Image file? Remember: images/...\n"); printf("%**>"); gets(fileName); - showImage(functionName, fileName); + type = atoi(functionName); + + switch(type){ + + case(1): showImage("findBuoy", fileName); break; + case(2): showImage("finalFindPipe", fileName); break; + case(3): showImage("findHedge", fileName); break; + } + + } else if(strcmp(readuser, "3")==0){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |