Friday, August 18, 2023

OpenCV basics continued...Image Fundamentals

Pixels

Pixels (short for "picture elements") are the smallest units of a digital image. Each pixel represents a tiny point of color that, when combined with other pixels, forms the complete image.

Pixels are typically arranged in a grid within a rectangle or square, with each pixel having a specific location within the image. The color of each pixel is represented by a combination of numerical values that represent the intensity of the three primary colors of blue, green, and red (BGR).

The resolution refers to the number of pixels in the image, usually expressed in terms of the width and height of the image in pixels. The higher the resolution, the more detail the image can contain, as there are more pixels available to represent the image. However, higher resolution images also require more storage space and processing power.

Typically, a digital image is made of thousands or millions of pixels, which are organized in rows and columns. For example, for an image of 640 x 480, there are a total of 307,200 pixels, and they are located in 480 rows and 640 columns. The coordinates of a pixel specify the location of the pixel, say a pixel with coordinates of (100, 100) means it is in column number of 100 and row number of 100.

Unlike a mathematics coordinate system, the digital image’s coordinate of the origin (0,0) is located at the top left corner of the image. x-axis represents the columns and y-axis represents the rows.

As a color image shown in Figure below, x-axis is the horizontal arrow at the top facing right, and y-axis is the vertical arrow at the very left and facing down. A pixel can be identified by a pair of integers specifying a x value (in column number) and a y value (in row number). In below Figure, the pixel at (100, 100) is identified and highlighted.




For a 24-bit image, each pixel has 24 bits, it is made of blue, green and red values, each has 8 bits, which value is from 0 to 255. For example, the pixel at (100, 100) in above Figure has blue value of 151, green of 82 and red of 234. The color of this pixel, shown as pink, is determined by these three values.






Share:

0 comments:

Post a Comment