Design a rectangle that can catch the color that you want to utilize in the program. Then, you can use this color to draw a picture in the window captured by WebCam.
HW05-2: Virtual Mouse
Extend the above program such that it can move a logo image by using the selected color. The x value of the virtual mouse can be obtained by the average value of all x values of points with selected color. Similarly, the y value of the virtual mouse can be obtained by the average value of all y values of points with selected color.

HW05-3: Sound Generation
Extend the above program such that a warning sound is generated when the virtual mouse is in an ill legal state.
HW05-4: DoRaMi
沒有留言:
張貼留言