Forums - Image formats in scaling functions

9 posts / 0 new
Last post
Image formats in scaling functions
BishGada
Join Date: 21 May 12
Posts: 4
Posted: Thu, 2012-05-31 03:19

Hi all,

 I'd like to scale up and down images. The reference of the functions doesn't explain if there are specific formats of images in the input and the output. The only place it is mentions is in the scale up by 2 which says it should be a gray image.

I've looked in the example "fast corners" and I saw there that scaling down the image is performed on YUV420sp. The output buffer was allocated at the size of w*h which eludes me, since YUV420sp is at size of w*h*1.5.

So does anyone knows if there are restrictions and also how can I scale up/down RGB888 or YUV422 images?

Thanks,

 Guy.

  • Up0
  • Down0
jeff4s Moderator
Join Date: 14 Mar 12
Posts: 54
Posted: Fri, 2012-06-15 19:22

Hi,

As you have observed, the restriction for up/down scaling functions is that the functions operate on grayscale image. If the image is YUV format the Y component needs to be planar but not to be interleaved with U&V. So to do up/down scaling on RGB888 or YUV422, you will have to convert the image to grayscale or YUV420 first. The current APIs cannot support such conversion, but the next release will.

Cheers,

-Jeff

  • Up0
  • Down0
nanaklinton
Join Date: 21 Oct 13
Posts: 2
Posted: Tue, 2013-10-22 00:03

HI there

Have you tried to scale up/down RGB888 or YUV422 images using an image program?I usually scale the image using a third party program.But i also want to know is there any image tool which supportst to scale a batch of image?Thanks in advance.

  • Up0
  • Down0
jeff4s Moderator
Join Date: 4 Nov 12
Posts: 106
Posted: Tue, 2013-10-22 13:40

Hi,

In FastCV most of image scaling APIs apply to greyscale images, however if the color images are in pseudo-planar YUV format, then there are these fcvScaleDownMNu8/fcvScaleDownMNInterleaveu8 and fcvScaleUpPolyu8/fcvScaleUpPolyInterleaveu8  combinations. You can accomplish color image scaling with two function calls.

In the fast corner sample app, the color image is stored in psedo-planar format (YUV420) and scaling is applied to Y channel only.

There are many APIs to convert between RGB and YUV. You can use combination of image color conversion and image scaling APIs to scale most color images.

Cheers,

-Jeff

  • Up0
  • Down0
hitesh.patel
Join Date: 15 Dec 16
Posts: 4
Posted: Wed, 2018-05-16 14:59

Hi Jeff,

Your input on format is very useful. 

I tried the fcvScaleDownMNu8() API and able to down scale YUV420 pseudo-planar image.

But I see it is doing with Y plane only. It is not working with U/V plance. 

Would you please suggest me whta I need to add to resize entire YUV420 pseudo-planar image ?

Thank you in advace..!!

Regards,

Hitesh

 

  • Up0
  • Down0
jeff4s Moderator
Join Date: 4 Nov 12
Posts: 106
Posted: Wed, 2018-05-16 16:22

Hi,

You cannot scale color image in one call. Instead you can try to scale the Y plane and UV (CbCr) plane separately.

Cheers,

-Jeff

  • Up0
  • Down0
hitesh.patel
Join Date: 15 Dec 16
Posts: 4
Posted: Wed, 2018-05-16 16:27

Hi Jeff,

Thank you for reply...!!

I did same and able to resize entire YUV420 image.

Regards,

Hitesh

  • Up0
  • Down0
hitesh.patel
Join Date: 15 Dec 16
Posts: 4
Posted: Wed, 2018-05-16 17:40

Hi Jeff,

I see after doing resize on UV plane. It is not showing color as original image.

I am not sure is it because of I am doing seperate plane or API. Is there any other API which work on direct 420SP(NV21) image.

Regards,

Hitesh

  • Up0
  • Down0
andyleeqd
Join Date: 25 Feb 19
Posts: 1
Posted: Mon, 2019-02-25 17:07

is there any API can support  YUV resize? In my project , I use preview_callback ,get the date is 640*480 , and I should resize to 1920*1080 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.