User Tools

Site Tools


processing:video_capture

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
processing:video_capture [2013/04/12 18:46] mithatprocessing:video_capture [2013/08/03 04:44] – [Video capture examples] mithat
Line 1: Line 1:
 ====== Video capture examples ====== ====== Video capture examples ======
  
-Examples below have been adapted from the [[http://www.processing.org/reference/libraries/video/Capture.html|Processing 2.0 library reference]] and from examples at [[http://www.learningprocessing.com/|Learning Processing]].+The examples below are based on documentation and code from the [[http://www.processing.org/reference/libraries/video/Capture.html|Processing 2.0 library reference]] and at [[http://www.learningprocessing.com/|Learning Processing]].
  
 ===== List available capture devices ===== ===== List available capture devices =====
Line 115: Line 115:
 ===== Capture is a PImage ===== ===== Capture is a PImage =====
  
-Something the documentation on the ''Capture'' class doesn’t mention is that ''[[http://processing.org/reference/libraries/video/Capture.html|Capture]]'' is derived from ''[[http://processing.org/reference/PImage.html|PImage]]''. You need to dig into the ''Capture'' source code to figure that out:+Something the [[http://processing.org/reference/libraries/video/Capture.html|documentation]] on the ''Capture'' class doesn’t mention is that ''Capture'' is derived from ''[[http://processing.org/reference/PImage.html|PImage]]''. You need to dig into the ''Capture'' source code to figure that out:
  
 <code java>public class Capture extends PImage implements PConstants { ...</code> <code java>public class Capture extends PImage implements PConstants { ...</code>
Line 186: Line 186:
 </file> </file>
  
-This version walks through each pixel in the reduced image and renders the value of that pixel as NxN blocks. (N is called OUTPUT_SCALE in the code below.)+This version walks through each pixel in the reduced image and renders its value as an NxN block. (N is called OUTPUT_SCALE in the code below.)
  
 <file java capture_reduce_res-2.pde> <file java capture_reduce_res-2.pde>
Line 262: Line 262:
 </file> </file>
  
 +You can render grayscale instead of color above by replacing the line <code java>color c = img.pixels[col + row*img.width];</code> with <code java>float c = brightness(img.pixels[col + row*img.width]);</code>
processing/video_capture.txt · Last modified: 2013/08/23 04:10 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki