Advertisement
rabirajkhadka

Threshold effect

Feb 6th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import gohai.glvideo.*;
  2. GLCapture video;
  3.  
  4. void setup() {
  5. size(640, 480, P2D);
  6.  
  7. // this will use the first recognized camera by default
  8. video = new GLCapture(this);
  9. video.start();
  10. }
  11.  
  12. void draw() {
  13. background(0);
  14. if (video.available()) {
  15. video.read();
  16. }
  17. image(video, 0, 0, width, height);
  18. // Apply a threshold filter with parameter level 0.5
  19. filter(THRESHOLD, 0.5);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement