PXP Grayscale -> RGB or YUV (RT1052)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PXP Grayscale -> RGB or YUV (RT1052)

1,480 Views
variable_andrew
Senior Contributor I

In the input formats for the PXP for the RT1052, how could you take 12 bit grayscale data from a camera and convert it to one of the supported RGB or YUV formats, can the PXP do this in the CSC (color space conversion)?

I'm supposing there's a way to scale the 12-bit grayscale data into 8-bit Y, and then have Yuv where u & v are always 0....?

I'm planning on using the PXP to scale an image (and convert from RAW grayscale to an RGB format grayscale)

Tags (2)
5 Replies

1,237 Views
jeremyzhou
NXP Employee
NXP Employee

Hi variable_andrew,

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
It's impossible to recover an RGB or YUV figure from the grayscale data by the PXP module, as the PXP can't predict the missing information likes the chrominance, chroma, etc.

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,237 Views
variable_andrew
Senior Contributor I

jeremyzhou‌ - 

thanks for the quick response. 

So the PXP won't just set the UV to 0's if you set the input format as 

kPXP_PsPixelFormatY8

(if i were going to try it by just chopping off the 4 LSbs?)

0 Kudos

1,237 Views
jeremyzhou
NXP Employee
NXP Employee

Hi variable_andrew,

Thanks for your reply.
I'm not very clear with your question, do you want to know whether PXP will set UV to '0' when converting the gray to YUV format?
If yes, to be honest, I don't know it yet as I haven't done this kind of testing before, so I'd like to suggest you can give a try, definitely, I also will give a try too.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,237 Views
variable_andrew
Senior Contributor I

Hi jeremyzhou‌, 

Right, it looked like the kPXP_PsPixelFormatY8 is what I'd get if I just take the 8MSBits of my grayscale data. 

If that could be used as a direct input to the PXP and it could convert to RGB565 or another standard RGB format for me - that'd be very useful. 

If direct Y8 couldn't be used - I'd suppose I could zero out the 4 LSBs of my grayscale data so I have 8 bits of Y and 8 bits of UV? Is that a format supported by the PXP? 

Once we have hardware next week - I can give it a try - just trying to get a bit of direction while I'm prepping code.  

0 Kudos

1,237 Views
jeremyzhou
NXP Employee
NXP Employee

Hi variable_andrew,

Thanks for your reply.
1) Right, it looked like the kPXP_PsPixelFormatY8 is what I'd get if I just take the 8MSBits of my grayscale data.
If that could be used as a direct input to the PXP and it could convert to RGB565 or another standard RGB format for me - that'd be very useful.
-- Yes, I think the PXP is able to convert the Grayscale figure to RGB format, however, I don't believe it will add the chrominance and chroma actually.
2) If direct Y8 couldn't be used - I'd suppose I could zero out the 4 LSBs of my grayscale data so I have 8 bits of Y and 8 bits of UV? Is that a format supported by the PXP?
-- No, I'm afraid the PXP doesn't support this format and I list all formats that the PXP supports below.

/*! @brief PXP process surface buffer pixel format. */
typedef enum _pxp_ps_pixel_format
{
    kPXP_PsPixelFormatRGB888    = 0x4,  /*!< 32-bit pixels without alpha (unpacked 24-bit format) */
    kPXP_PsPixelFormatRGB555    = 0xC,  /*!< 16-bit pixels without alpha. */
    kPXP_PsPixelFormatRGB444    = 0xD,  /*!< 16-bit pixels without alpha. */
    kPXP_PsPixelFormatRGB565    = 0xE,  /*!< 16-bit pixels without alpha. */
    kPXP_PsPixelFormatYUV1P444  = 0x10, /*!< 32-bit pixels (1-plane XYUV unpacked). */
    kPXP_PsPixelFormatUYVY1P422 = 0x12, /*!< 16-bit pixels (1-plane U0,Y0,V0,Y1 interleaved bytes) */
    kPXP_PsPixelFormatVYUY1P422 = 0x13, /*!< 16-bit pixels (1-plane V0,Y0,U0,Y1 interleaved bytes) */
    kPXP_PsPixelFormatY8        = 0x14, /*!< 8-bit monochrome pixels (1-plane Y luma output) */
    kPXP_PsPixelFormatY4        = 0x15, /*!< 4-bit monochrome pixels (1-plane Y luma, 4 bit truncation) */
    kPXP_PsPixelFormatYUV2P422  = 0x18, /*!< 16-bit pixels (2-plane UV interleaved bytes) */
    kPXP_PsPixelFormatYUV2P420  = 0x19, /*!< 16-bit pixels (2-plane UV) */
    kPXP_PsPixelFormatYVU2P422  = 0x1A, /*!< 16-bit pixels (2-plane VU interleaved bytes) */
    kPXP_PsPixelFormatYVU2P420  = 0x1B, /*!< 16-bit pixels (2-plane VU) */
    kPXP_PsPixelFormatYVU422    = 0x1E, /*!< 16-bit pixels (3-plane) */
    kPXP_PsPixelFormatYVU420    = 0x1F, /*!< 16-bit pixels (3-plane) */
} pxp_ps_pixel_format_t;

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos