• DeepStream Version
5.1
Hello, I’m trying to understand how to use nppiHistogramEven_8u_C3R_Ctx. The documentation is not very helpful.
Let’s assume the input image is a 3-channel BGR image with 1 pixel (values: 255,0,0). Let’s also assume the NvBufSurfaces (eg. full_img_hist) are created correctly along with the scratch buffer and the associated scratch buffer size (7178).
Given the following params:
int nLevels_3ch[3] = { 3, 3, 3 };
int nLowerLevel[3] = { 0, 0, 0 };
int nUpperLevel[3] = { 256, 256, 256 };
Npp32s* pHist[3] = {
( Npp32s* ) full_img_hist->surfaceList[0].dataPtr,
( ( Npp32s* ) full_img_hist->surfaceList[0].dataPtr ) + nLevels_3ch[0],
( ( Npp32s* ) full_img_hist->surfaceList[0].dataPtr ) + nLevels_3ch[1],
};
After calling: nppiHistogramEven_8u_C3R_Ctx(…)
I want to find out the number of pixels in each bin. So I’m casting it like:
int32_t bgr[3] = { -1, -1, -1 };
memcpy( &bgr[0], pHist[0], sizeof( int32_t ) );
memcpy( &bgr[1], pHist[1], sizeof( int32_t ) );
memcpy( &bgr[2], pHist[2], sizeof( int32_t ) );
- Is this the correct way to extract the output?
- What should the 3 values in the bgr array be?
- Given that it’s a 3-channel pixel and nLevels_3ch is initialised with the number 3 (implying 3 bins), should I receive 9 values? One for each bin of each channel?