Using images for internal calculations
In this chapter we have considered the images mainly as building blocks of a visual scene. In this last section, we will see how images can be used in another way, as the source of data for internal calculations, not displaying on the screen directly. The main examples of such usage are masks and palettes, which we'll discuss now.
An image as a mask
Color cameras and depth cameras give color and depth images that represent the scene they capture (for example, humans in front of the camera). Such images can be processed using pixel-by-pixel methods or with the computer vision library, OpenCV. The result is often a binary image, which is called mask , that contains black pixels denoting the background and white pixels denoting human silhouettes. The mask can be applied for controlling physics and changing any parameter of your interactive installation. The user never sees the mask image itself, but only perceives its effect on the interactive scene's behavior...