Digital Video BASICS (I)

Source: Internet
Author: User
Prepared by Shanghai kaishi Information Technology Co., Ltd.

All rights reserved. for reprinting and reference, please indicate the source

1. Basic Concepts 1.1 video representation 1.1.1 Image Representation

Use pixels to represent an image. Each pixel has a fixed position and a fixed brightness value (this is assumed to be a black-and-white image ). Therefore, an image is formed.



For example, the following image:

We use 0 to represent white, 1 to represent black, then the image can be expressed:


The image has two resolutions: one isSpatial ResolutionThat is, the horizontal resolution N and vertical resolution m in the graph; the other isGrayscale resolutionThat is, several BITs are used to represent the gray level. There is an extreme two-value diagram, such as the "1" Diagram just now.









1.1.2 video Representation

The video is the image sequence on the timeline. If the image is regarded as a two-dimensional (space X, Y), the video is a three-dimensional (space X, Y, plus time t, this T may sometimes be the frame number ). The mathematical expression of the video is f (x, y, T), F (, T), F (x, y, n), or F (, n)

The number of frames per second is called the video frame rate.

1.1.3 line-by-line and line-by-line videos

A row-by-row scan is a video generated by a row scan during imaging. A video is displayed on the screen.

An even number of rows is scanned during imaging to form an even field, and then an odd field is scanned to form an image. In this way, an image is divided into two categories: even and odd, which are different in space and time. When displaying, you should first display the even-Field Image in the even-row position of the monitor, and then display the odd-Field Image in the odd-row position.


Comparison of line-by-line videos and line-by-line videos:


The following are some questions:

(1) Why is there a video format such as line scan?

Assume that a video with a x576 resolution Frame Rate of 25Hz is scanned row by row, and the data volume is X pixels/second. If we use the interline scan, the data volume is x 50 pixels/second, And the interline scan is a field frequency of 50Hz. Apparently, the data volume is the same. However, the advantage of interlace scanning is that the image refresh frequency is 50Hz, which greatly reduces the display visual effect of the early imaging tube display, the video flicker will be greatly reduced.

(2) The problem of display of the video with different lines:

We are currently using a large number of LCD monitors, all of which are row-by-row scans. For the interline videos, we need to combine the two parity fields to form a one-time display, we have discussed previously that the space and time of an even field are different from that of an odd field. Therefore, if the image is static, this simple merge will not be a problem; however, if the camera is moving, or the image content is moving, the image quality may deteriorate seriously, such, this figure is not hard to understand and must be understood. To solve this problem, we need a de-barrier algorithm. We will introduce it later.



(3) The resolution of the row-separated video

If the video content is static, the resolution of the line-by-line video can be achieved for the line-by-line video. If the video content is changed, it will be displayed on the line-by-line display, and the vertical direction resolution will be reduced by half. The vertical distribution rate will be decreased slightly even if the de-discrimination algorithm is used.

1.2 Color Space 1.2.1 different color spaces are used differently

For a black-and-white image, we use brightness (or grayscale) to indicate its brightness or darkness, generally, we use 8-bit, 10-bit, or even 16-bit non-conforming Integers to represent the gray scale of a pixel.

We all know that we can use R (Red component), g (green component), and B (blue component) to represent a pixel.

It is very suitable for CCD, display, and other devices to use RGB for image processing. For example, when we want to adjust the brightness and saturation of an image, or, when you just want to adjust the brightness or analyze the brightness features of a video object, we do this in the RGB color space. As a result, we use YUV (YCbCr), HSI and other color spaces. Both RGB, YUV, and HSI can express color images. Therefore, they can be converted to each other.

HSI: h indicates the color, s indicates the saturation, And I indicates the brightness.

YUV (YCbCr): Y brightness component, U, V (or CB, Cr) color component.

1.2.2 mutual conversion of color spaces

(1) Convert RGB to HSI


(2) convert HSI to RGB:


(1) Convert RGB to YUV:


(2) convert YUV to RGB:

1.2.3 color image format

RGB Images are generally in format, that is, each pixel has its own RGB, data format r0, G0, B0, R1, G1, B1 ....

Generally, 8-bit non-conformity numbers are used to represent three RGB components. Therefore, 24-bit is required for one pixel. To save space, we have rgb444 (the three components are 4-bit ), rgb555 (each of the three components is 5bit), rgb565 (the R and B components are both 5bit, and the G component is 6bit)

The images represented by YUV are, and.

For explanations of, and:


The memory size occupied by each component of RGB and YUV data is as follows:



Color Image Bayer encoding:

Bayer encoding is a method for outputting 24-bit (RGB) color signals using 8-Bit Data Bit Width. Each pixel is assigned one of three components (R, G, and B, you can use the color information of each pixel and its adjacent pixels to obtain the pixel RGB information.

Line0: bgbgbgbg...

Line1: grgrgrgr...

Line2: bgbgbgbg...

Line3: grgrgrgr...

Assume that you want to determine the RGB value of the pixel at the position of line2 and Col 3. The color component value of the surrounding pixel is as follows:

RGR ----- 200 50 220

GBG ---- 60 100 62

RGR ---- 196 58 198

The RGB value of the pixel can be calculated as follows:

R = (200 + 220 + 196 + 198)/4

G = (50 + 80 + 62 + 58)/4 = 58

B = 100

Of course, this calculation method is relatively simple, simpler, and more complex, but it is a transaction between computing, speed, hardware, and image quality.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.