What you need to know when processing camera

Source: Internet
Author: User

Turn: http://blog.csdn.net/hhygcy/article/details/3339214

List of supported formats obtained using videocapture and iamstreamconfig.

The two formats are supported: yv12 and nv12.
The specific memory distribution is unknown. I checked some documents. You have modified several graphs. We can see some clues.

Yv12
First look at the definition of the standard on the http://www.fourcc.org/yuv.php:

Yv12

This is the format of choice for your software MPEG codecs. It comprises an nxm Y plane followed by (n/2) x (M/2) V and U planes.

  Horizontal Vertical
Y sample period 1 1
V sample period 2 2
U sample period 2 2

Positive biheight implies top-down image (top line first)

This kind of image is not very clear.

The image example above this Wiki is very clear. The first image marks the true pixel representation of the image.

We can see that the four physically close pixels Y1, Y2, y7, and Y8 share the same U1 and V1, similar Y3, Y4, y9, y10 uses U2 and V2. Different colors present this feature very clearly. Impressive !! I have always felt that education, or basic education, must be explained in this way so that we can know why, the type of textbooks that blindly copy a foreign textbook or combine a few cracked books is not a teacher or a broken person. Let's get down to the truth. Previously, we talked about the representation of physical pixels. The distribution in memory is an array, and the order is YUV. Therefore, if you know the desired pleasing size, you can easily find the specific YUV position in the array.

Nv12
Nv12 and yv12 are slightly different. The difference lies in the UV position. Now let's look at a picture!


In yv12, U and V are arranged consecutively, while in nv12, U and V are arranged in a staggered manner. It is clear that the layout in the memory is Y in the first place, and then the layout is a staggered layout of u1v1u2v2. The effect of pixel compression is the same. However, it may be the support of hardware acceleration.

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.