230 likes | 326 Views
COMP1610/DGC1330. Laboratory 6. COMP1610/DGC1330. Learning Outcomes. In this laboratory section, you will Understand the principles of using webcam in Processing and apply webcam as new input modality;
E N D
COMP1610/DGC1330 Laboratory 6
COMP1610/DGC1330 Learning Outcomes In this laboratory section, you will Understand the principles of using webcam in Processing and apply webcam as new input modality; Able to integrate live video feeding and computer generated imagery in real-time and develop simply Augmented-Reality visual application; Make use of the concepts of Looping and Repetition in Processing to develop visually rich interactive application.
COMP1610/DGC1330 Tasks In this laboratory section, you have to complete the following task: Design your own pattern from live captured video.
COMP1610/DGC1330 Download file Download the file from: http://www.comp.hkbu.edu.hk/~comp1610/lab/WinVDIG_105.exe Double click to open it
COMP1610/DGC1330 Download file
COMP1610/DGC1330 Download file
COMP1610/DGC1330 Download file If you can see video from webcam, close the program
COMP1610/DGC1330 Download file Download the file from: http://www.comp.hkbu.edu.hk/~comp1610/lab/lab6.zip Extract the Zip file and open “lab6.pde”. Extract the zip file Open lab6.ped
COMP1610/DGC1330 Open file There are two tabs, you only have to edit the first tab, “lab6”. Tab “lab6”
COMP1610/DGC1330 Open file In this lab, same as lab5, you are asked to fill in the missing codes.
COMP1610/DGC1330 Task 1 Design your own pattern from live captured videos. Design your patterns. I have done this for you.
COMP1610/DGC1330 Task 1 Example: Can you find this?
COMP1610/DGC1330 Task 1 Example: X coordinate Y coordinate 1/size (735 , 435)
COMP1610/DGC1330 Task 1 Different sizes! Example:
COMP1610/DGC1330 Task 1 Example: How to put four frames here?
COMP1610/DGC1330 Task 1 Example: How to use a for loop instead? small_frame( 42, 59, 4 ); small_frame( 202, 59, 4 ); small_frame( 362, 59, 4 ); small_frame( 522, 59, 4 );
COMP1610/DGC1330 Task 1 Example: cam.width = width of original video width small_frame( 42, 59, 4 ); small_frame( 202, 59, 4 ); small_frame( 362, 59, 4 ); small_frame( 522, 59, 4 ); for (int x=0; x<4 ; x=x+1) { small_frame(x*cam.width/4 +42, 59, 4); }
COMP1610/DGC1330 Task 1 How about 5 frames? Example: for (int x=0; x<4 ; x=x+1) { small_frame(x*cam.width/4 +42, 59, 4); } for (int x=0; x<5 ; x=x+1) { small_frame(x*cam.width/5 +42, 59, 5); }
COMP1610/DGC1330 Task 1 More information: Similar to mousePressed() Space bar is pressed Save the current frame as a jpg picture
COMP1610/DGC1330 More example: Download the file from: http://www.comp.hkbu.edu.hk/~comp1610/lab/lab6_funny.zip Extract the Zip file and open “lab6_funny.pde”.
COMP1610/DGC1330 More example: Frames will be shown up sequentially.
COMP1610/DGC1330 Hand-in Submission steps: Save your files and zip all of them, including “data” folder Rename the zip file into “xxxxxxxx-lab6.zip” (where xxxxxxxx is your Student ID.) Upload to BU e-Learning. Deadline: 19/10/2011 23:59
COMP1610/DGC1330 More information Some useful websites about Processing: Reference of functions: http://www.processing.org/reference/ Online tutorial: http://www.learningprocessing.com/ Others work: http://www.openprocessing.org/