Пример #1
0
def on_trackbar2(position):
	global pos2 
	global pos1 
	pos2 = position
	pos1 = int(pos2/2)
	highgui.cvSetTrackbarPos("Canny1", wname, pos1)
	on_trackbar1(pos1)
Пример #2
0
	highgui.cvCreateTrackbar("Canny2", wname, 175, 250, on_trackbar2)
	highgui.cvCreateTrackbar("minDistance", wname, 40, 150, on_trackbar3)
	highgui.cvCreateTrackbar("accumThresh", wname, 55, 100, on_trackbar4)
	highgui.cvCreateTrackbar("minRadius", wname, 190, 500, on_trackbar5)
	highgui.cvCreateTrackbar("maxRadius", wname, 210, 1200, on_trackbar6)
	highgui.cvCreateTrackbar("SearchRadius", wname, 50, 100, on_trackbar7)
	pos1 = highgui.cvGetTrackbarPos("Canny1", wname)
	pos2 = highgui.cvGetTrackbarPos("Canny2", wname)
	pos3 = highgui.cvGetTrackbarPos("minDistance", wname)
	pos4 = highgui.cvGetTrackbarPos("accumThresh", wname)
	pos5 = highgui.cvGetTrackbarPos("minRadius", wname)
	pos6 = highgui.cvGetTrackbarPos("maxRadius", wname)
	pos7 = highgui.cvGetTrackbarPos("SearchRadius", wname)

	pos1 = int(pos2/2)
	highgui.cvSetTrackbarPos("Canny1", wname, pos1)
	on_trackbar1(pos1)

	#highgui.cvNamedWindow( "original",1 );
	#highgui.cvNamedWindow( "log-polar", 1 );
	#highgui.cvNamedWindow( "inverse log-polar", 1 );

	dst = cv.cvCreateImage( cv.cvSize(256,256), 8, 3 );
	src = cv.cvCloneImage(img)
	src2 = cv.cvCreateImage( cv.cvGetSize(src), 8, 3 );
        #cvShowImage( "original", src );
	highgui.cvSetMouseCallback( "original", on_mouse );
	on_mouse( CV_EVENT_LBUTTONDOWN, src.width/2, src.height/2, None, None)

	highgui.cvWaitKey()
Пример #3
0
def setHlsFilter(key, value):
    hlsFilter[key] = value
    print key
    cvSetTrackbarPos(key, "Filtred", int(value))
    print str(key) + "a"
    print hlsFilter