Project

General

Profile

Revision 256

Added by Rich Hong over 16 years ago

update vision.sh to repeatly run vision

View differences:

trunk/code/projects/colonet/vision/vision.sh
1 1
#!/bin/sh
2
while [ 1 ]
3
do
2 4
wget -q http://roboclub9.frc.ri.cmu.edu/colonet.jpg -O colonet.jpg
3 5
./vision colonet.jpg > colonet.txt
6
sleep 5s
7
done
trunk/code/projects/colonet/vision/vision.c
48 48
    	cvNamedWindow("Source", 1);
49 49
    	// Show the image.
50 50
    	cvShowImage("Source", image03);
51
	}
52 51

  
53
    cvNamedWindow("Result", 1);
54
    if (DEBUG){
55
		// Create toolbars. HighGUI use.
52
    	cvNamedWindow("Result", 1);
53
	// Create toolbars. HighGUI use.
56 54
    	cvCreateTrackbar( "Threshold", "Result", &slider_pos, 255, process_image );
57 55
	}
58 56

  
59 57
	if (!DEBUG) loop_image();
60
    if (DEBUG) process_image(0);
58
	if (DEBUG) process_image(0);
61 59

  
62 60
    // Wait for a key stroke; the same function arranges events processing
63
    cvWaitKey(0);
61
    if (DEBUG) cvWaitKey(0);
64 62
    cvReleaseImage(&image02);
65 63
    cvReleaseImage(&image03);
66 64

  
67
    if (DEBUG) cvDestroyWindow("Source");
68
    cvDestroyWindow("Result");
65
    	if (DEBUG){
66
    		cvDestroyWindow("Source");
67
    		cvDestroyWindow("Result");
68
	}
69 69

  
70 70
    return 0;
71 71
}
......
162 162
	for (i=0;i<index;i++){
163 163
		if (bestc[i].count>7){
164 164
			printf("%d,%d\n",bestc[i].center.x,bestc[i].center.y);
165
			cvCircle(image04,bestc[i].center, 20, CV_RGB(0,0,0),5,8,0);
165
			//cvCircle(image04,bestc[i].center, 20, CV_RGB(0,0,0),5,8,0);
166 166
		}
167 167
	}
168 168
    // Show image. HighGUI use.
169
    cvShowImage( "Result", image04 );
169
    //cvShowImage( "Result", image04 );
170 170
}
171 171

  
172 172
// Define trackbar callback functon. This function find contours,

Also available in: Unified diff