- Mastering OpenCV 4 with Python
- Alberto Fernández Villán
- 321字
- 2021-07-02 12:07:13
Images formulation
An image can be described as a 2D function, f(x,y), where (x,y) are the spatial coordinates and the value of f at any point, (x,y), is proportional to the brightness or gray levels of the image. Additionally, when both (x,y) and brightness values of f are all finite discrete quantities, the image is called a digital image. Therefore, f(x,y) takes the following values:
- x ∈ [0, h-1], where h is the height of the image
- y ∈ [0, w-1], where w is the width of the image
- f(x,y) ∈ [0, L-1], where L = 256 (for an 8-bit image)
A color image can be represented in the same way, but we need to define three functions to represent the red, green, and blue values, respectively. Each of these three individual functions follows the same formulation as the f(x,y) function that was defined for grayscale images. We will denote these three functions subindex R, G and B for the three formulations (for the color images) as fR(x,y), fG(x,y), and fB(x,y).
A black and white image follows the same approximation in the way that only one function is required to represent the image. However, one key point is that f(x,y) can only take two values. Usually, these values are 0 (black) and 255 (white).
The following screenshot shows the three types of images (a color image, a grayscale image, and a black and white image):

- 前端跨界開發(fā)指南:JavaScript工具庫原理解析與實戰(zhàn)
- HTML5+CSS3基礎(chǔ)開發(fā)教程(第2版)
- Python從入門到精通(精粹版)
- RTC程序設(shè)計:實時音視頻權(quán)威指南
- Learning SQLite for iOS
- GitLab Repository Management
- 小程序,巧運營:微信小程序運營招式大全
- Kotlin開發(fā)教程(全2冊)
- Spring+Spring MVC+MyBatis從零開始學(xué)
- Android Studio開發(fā)實戰(zhàn):從零基礎(chǔ)到App上線 (移動開發(fā)叢書)
- Java EE項目應(yīng)用開發(fā)
- Pandas 1.x Cookbook
- Visual C++ 開發(fā)從入門到精通
- Scratch 3.0少兒積木式編程(6~10歲)
- HTML 5與CSS 3權(quán)威指南(第3版·下冊)