Ejemplo n.º 1
0
	blue = cv.cvCreateImage(frame_size, 8, 1)

	while 1:
		# 1. capture the current image
		frame = highgui.cvQueryFrame (capture)
		if frame is None:
			# no image captured... end the processing
			break

		# compute the hsv version of the image 
		cv.cvCvtColor(frame, hsv, cv.CV_BGR2HSV)

		# compute the hue/sat/value from the hsv image
		cv.cvSplit(hsv, hue, saturation, value, None)
		cv.cvSplit(frame, blue, green, red, None);
		cv.cvCvtScale(value, val_scale, 1/100.);
		cv.cvCvtScale(val_scale, value, 1);

		# handle events

		k = highgui.cvWaitKey (10)

		# we can now display the images
		highgui.cvShowImage('Camera', frame)
		highgui.cvShowImage('HUE', hue)
		highgui.cvShowImage('SATURATION', saturation)
		highgui.cvShowImage('VALUE', value)
		highgui.cvShowImage('RED', red)
		highgui.cvShowImage('GREEN', green)
		highgui.cvShowImage('BLUE', blue)