Hi I am trying to customize nvdspreprocess_lib following the example of libcustom2d_preprocess.so. after I changed the function in nvdspreprocess_conversion.cu to black out a triangular area, the results were not reflected on the downstream output. ** global void NvDsPreProcessConvert_CxToP3FloatKernelWithPolygonBlackout** is the function gets called in the nvdspreprocess_impl.cpp. I am thinking whether this is the case that libcustom2d_preprocess.so actually only modified the input but not push the updates to downstream.

Below is the code snipet for NvDsPreProcessConvert_CxToP3FloatKernelWithPolygonBlackout:

//start of code

**global** void NvDsPreProcessConvert_CxToP3FloatKernelWithPolygonBlackout(

float *outBuffer,

unsigned char *inBuffer,

unsigned int width,

unsigned int height,

unsigned int pitch,

unsigned int inputPixelSize,

float scaleFactor,

float *meanDataBuffer)

{

```
// Define the vertices of the polygon (triangle as an example)
Point a = {width / 4, height / 4};
Point b = {3 * width / 4, height / 4};
Point c = {width / 2, 3 * height / 4};
unsigned int row = blockIdx.y * blockDim.y + threadIdx.y;
unsigned int col = blockIdx.x * blockDim.x + threadIdx.x;
if (col < width && row < height)
{
Point p = {static_cast<int>(col), static_cast<int>(row)};
if (isInsideTriangle(p, a, b, c))
{
// Blackout the pixel by setting to zero
for (unsigned int k = 0; k < 3; k++)
{
outBuffer[width * height * k + row * width + col] = 0.0f;
}
}
else
{
// Normal processing
for (unsigned int k = 0; k < 3; k++)
{
float pixelValue = static_cast<float>(inBuffer[row * pitch + col * inputPixelSize + k]);
float meanValue = meanDataBuffer ? meanDataBuffer[row * width * 3 + col * 3 + k] : 0.0f;
// outBuffer[width * height * k + row * width + col] =
// scaleFactor * (pixelValue - meanValue);
outBuffer[width * height * k + row * width + col] = 128;
}
}
}
```

}