Standard numpy array containing pixels of data points . Pixels in an image, the better its resolution. You can think of pixels as little blocks of information arranged in the form of a 2d grid, and the depth of a pixel refers to the color information present in it. To be processed by a computer, an image must be converted to a binary form . The color of an image can be calculated as follows: number of colors / shades = 2^bpp (where bpp represents bits per pixel) therefore, the more bits/pixel, the more colors possible in the images.
The following table shows this relationship more clearly: bits per pixel let us now see the representation of the different types of images: binary image a binary image consists of 1 bit/pixel and therefore can only have two possible colors , i.e. Black or white. Black is e commerce photo editing service represented by the value 0 while 1 represents white. Binary image grayscale image a grayscale image consists of 8 bits per pixel. This means you can have 256 different shades where 0 pixels will represent black while 255 denotes white. For example, the image below shows a grayscale image represented as a matrix. Grayscale image color image color images are represented as a combination of red, blue, and green , and all other colors can be achieved by mixing these primary colors in the correct proportions.
Color image a color image also consists of 8 bits per pixel. As a result, 256 different color shades can be represented with 0 denoting black and 255 white. Let's look at the famous colored image of a mandrel that has been cited in many examples of image processing . Chuck image if we were to check the shape of the image above, we would get: chuck 1 this means that we can represent the image above in the form of a three-dimensional matrix. Three-dimensional mandrel images and opencv opencv can be used to perform simple image operations such as: open and save images draw