1Basics of Machine Vision

1.1 Digital Images

1.1.1 Grayscale Image

The basic digital image is composed of a two-dimensional array of numbers. Each number in the array represents a value of the smallest visual element, a pixel. The indexed location of the pixel value in the array corresponds to the X and Y locations of the pixel within the image, as measured from the top-left corner. The values of a pixel in an X and a Y location in the digital grayscale image, f(x,y), represent the brightness of the pixel in a range from black to white, as seen in Figure 1.1. Let us assume that total number of pixels are 300 (0–299) and 250 (0–249) in the X and Y locations, respectively. Each image can be represented by the array of size 300 × 250 that has a value for each pixel.

img

Figure 1.1 Grayscale image.

Each image pixel value is related to the brightness of the image at that specific location. For a given camera device, the maximum value recorded for the image pixels is generally related to a characteristic of the camera referred to as the bit depth. For example, if bit depth is k, then there will be as much as 2k levels of brightness that can be defined. For example, if the bit depth is 8 bits, then a pixel can have 256 values (28) in the range between 0 and 255.

A grayscale image pixel most often only has brightness information that can be represented in 8 bit values and as such the ...

Get Practical Guide to Machine Vision Software: An Introduction with LabVIEW now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.