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.
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
Hello Jeff,
Your suggestion worked.
Thank you.