This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

VLIB_extractLumaFromUYUV的疑问

用DM6437实现图像采集与处理,在仿真时用image显示采集到的图像数据,原图像为YUC422格式,分辨率为720*576,显示图像及设置参数如下:

对原图像进行灰度化,用VLIB_extractLumaFromUYUV函数,图像大小应该为720*576,得到图像与设置参数如下:

问题:1、原图像width=720,pitch=1440,height=576,灰度化后width应该为720,pitch为720,height应该为576的。为何灰度化处理后,在720*576区域内显示有两幅图像,图像大小变为720*288,请问为何图像会高度减半呢?请释疑!

  • 你好,

      你的输入参数格式不对。

      请注意一下该函数的描述,这里的输入为UYVY的图像格式,而从你第一张图片来看,你的输入源应该是YUV SP格式的(CCS中,你的图像选择YUV源为同一地址0x800D3D00,都是Y的数据,而你的UV 使用的是Y的数据,所以显示的时候出现了严重的颜色失真,背景还有一段2x的ERROR CODE)。

    Introduction and Use Cases:
    When the image data is stored in the YUV422 format but the processing needs to be done on its luminance component only, it is often desirable to extract the Y component and store it in a separate buffer. This is particularly useful when data needs to be contiguous.
    Description:
    This function extracts the luminance data from the YUV422 interleaved image. This is done by extracting every other byte and copying it to the buffer pointed to by pOutY.
    Parameters:
    [in]  *pInUYVY  Input YUV422 image (UQ8.0)
    [in]  inCols  Width of input image (in pixels)
    [in]  inPitch  Pitch of input image (in pixels)
    [in]  inRows  Height of input image (in pixels)
    [out]  *pOutY  Luma-only output image (UQ8.0)
  • 你好!

    我存储的图像是UYVY格式的(参见SPRU977 2.3.2节),采用自己编写的函数提取Y分量后,灰度图正常,如下所示:

    图像为720*576。但是在image显示时,为何图像的左侧和右侧均出现黑条部分,但是输出到显示器显示时却没有这个黑条。

  • 你好:

          请问你最后怎么解决这个问题了?我也遇到了