Forums - Issue while using fcvChannelExtractu8

3 posts / 0 new
Last post
Issue while using fcvChannelExtractu8
sagar.kirtany
Join Date: 6 Jul 20
Posts: 7
Posted: Wed, 2020-12-09 02:32

Hello,

We have an RGB interleaved image of 1024x768 pixels.
We want to separate the Red, Green, and Blue channels from this image using FastCV library v1.7.1 for ARM.
We used the 'fcvChannelExtractu8' function for this.

The relevant code snippet is shown below.
Here, 'rbgIntBuf' is the buffer holding the RGB interleaved image.
And 'u8_R', 'u8_G', and 'u8_B' are the buffers to hold the Red, Green, and Blue channels.

fcvStatus op_status = fcvChannelExtractu8( (const uint8_t *__restrict)rgbIntBuf, 1024, 768, 0, 0, 0, 0, 0, FASTCV_CHANNEL_R, FASTCV_RGB, (uint8_t *__restrict)u8_R, 0 );
fcvStatus op_status = fcvChannelExtractu8( (const uint8_t *__restrict)rgbIntBuf, 1024, 768, 0, 0, 0, 0, 0, FASTCV_CHANNEL_G, FASTCV_RGB, (uint8_t *__restrict)u8_G, 0 );
fcvStatus op_status = fcvChannelExtractu8( (const uint8_t *__restrict)rgbIntBuf, 1024, 768, 0, 0, 0, 0, 0, FASTCV_CHANNEL_B, FASTCV_RGB, (uint8_t *__restrict)u8_B, 0 );


This program terminates abruptly at the first call to 'fcvChannelExtractu8' function with the following assertion:

src/cpu/fastcvChannelC.cpp@141: (srcStride >= srcWidth*3) && (dstStride >= srcWidth) && (((srcChannel >= FASTCV_CHANNEL_0)&&(srcChannel <= FASTCV_CHANNEL_2)) || ((srcChannel >= FASTCV_CHANNEL_R)&&(srcChannel <= FASTCV_CHANNEL_B)))

No other debug or error information is available.

We tried to specify different parameters to the 'fcvChannelExtractu8' function. But in each case, the program either terminates with the same assertion as shown above, or we get a segmentation fault.

What are we missing here?

Thanks and regards.

  • Up0
  • Down0
jeff4s Moderator
Join Date: 4 Nov 12
Posts: 106
Posted: Wed, 2020-12-09 09:25

Hi,

Please set the src/dst stride parameters to actual values (non-zero), and check if the problem goes away.

It seems there's a bug in implementing the default.

Cheers,

-Jeff

  • Up0
  • Down0
sagar.kirtany
Join Date: 6 Jul 20
Posts: 7
Posted: Thu, 2020-12-17 23:30

Hello Jeff,

Your suggestion worked.

Thank you.

  • 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.