MTK platform video display reversing the image cropping area

Copyright notice: reproduced please specify blog address https://blog.csdn.net/jinron10/article/details/89314235

In reverse display, set the preview resolution 1280x720 (AHD) or CVBS (720 * 576-NTSC system, 720 * 480-PAL system) is displayed on the LCD1024x600 1280x720 resolution or screen resolution, some may find the camera head right and left black side, this time to achieve a normal image can be displayed by reversing the cropping function module ATC hardware image inside the chip. TVD necessary image data output to the internal transport ISP crop before the LCD framebuffer, otherwise there will be displayed Caton phenomenon.

Methods as below:

Adb capture images using data:

电脑上执行:
adb root
adb remount
adb shell
进入机器的android运行环境执行:
xxx@xxxx/# setenforce 0
xxx@xxxx/# mkdir /data/mdp/
xxx@xxxx/# setprop dpframework.dumpbuffer.enable 1  // 开始 dump
xxx@xxxx/# setprop dpframework.dumpbuffer.enable 0 // 结束 dump
xxx@xxxx/# exit
电脑上执行:
adb pull /data/sdp .   //将抓取的sdp数据文件拷贝到本地

Use YUV viewer to open the dump  data  output * .bin (local computer XXXX / MDP / output39635_0.bin ) file format to open the YUV422 , select resolution 1024 * 600 , the specific pixel can be obtained as shown in black bars size.

yuv image tool: https://download.csdn.net/my/uploads in yuv image tool

And selecting YUV422_YUYV 1024x600 formats, the shadow can be seen around the pixel size, the principle of debugging, H is disposed above the image display size of half the width of the smaller size. Y value of zero from the left size of the shadow. After adjusting further fine-tune the size of a screen displayed.

If it still does not work, the size of the X value Y with the same value for still and then adjust the size of the W and H values, about adjustments after the final OK, and then adjust the value of the Y and H, that can display images up and down.

May use the setup menu on the main interface of the "display" -> Crop video area corresponding to set parameters verified:

It is OK.

Then the above X, Y and W, H coordinate values ​​is how to take it? ATC has said the document will need to Metazone cure parameters as follows:

Then the black border pixel format for CVBS output to the LCD screen 1024x600, YUV tool for the above obtained black side, up and down in particular how it is calculated, as follows:

 N camera system resolution is 720 * 576, the resolution of the camera is made of P * 720 480, an example of N camera system, following FIG.

Here is cropped video source resolution standard, assuming both the left and right image above CVBS 10px black bars on both sides of the screen, then the black 10px To cut edge coordinates, X value of 10, if you want to cut 10px black on the right side, the width W needs to be displayed, it should be 710-10-10 = 700 W, since no black vertical edges, without cutting, then Y is still 0, H 576.

Since the camera resolution of 720 * 576, the screen resolution of 1024 * 600, 1024 * 600 resolution so the screen is not a pixel out of the measured CVBS real camera screen pixel, but after amplification by the pixel, and this Common amplification is a linear relationship, specifically, on a screen resolution of 1024 * 600, the black pixels on the left side 17, then reduced to 720 x 576, a pixel is actually black bars: 17 * (720/1024) = 12, Similarly, W value of 720- (12-10 * (720/1024)) = 701, Y = 0, H = 576. PAL system are above the camera, for example, if the camera system is N, the calculation of 480 to 576 replace.

 

Guess you like

Origin blog.csdn.net/jinron10/article/details/89314235
Recommended