Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6704 Discussions

Bug report: ippiFilterBoxBorder_32f_C1R

Rg66
Beginner
2,119 Views

Hi,

we encountered a problem with box filtering of float images.
If the image only has relevant image content in the middle and is otherwise 0, there are errors on the right and bottom, which are probably caused by the update process.
The filter response should also be 0 in these areas.
The problem causes subsequent errors in our applications with natural images.

The problem can be reproduced with the following sample code:

void main()
{
	// Boxfilter auf float-Bildern
	IppiSize maskSize = { 55, 55 };
	IppiSize imageSize = { 1000, 1000 };
	Ipp32f* psrc=nullptr;
	Ipp32f* pDst = nullptr;
	Ipp8u* pBuffer = nullptr;
	int len = imageSize.height * imageSize.width;

	// Create and fill source image
	psrc=ippsMalloc_32f(len);
	ippsZero_32f(pSrc, len);

	IppiRect fillArea = { 400, 400, 200, 200 };
	Ipp32f fillValue(1000.67);

	for (int y = fillArea.y; y <= fillArea.y + fillArea.height; y++)
	{
		ippsSet_32f(fillValue, pSrc + y * imageSize.height + fillArea.x, fillArea.width);
	}

	// Create dest image
	pDst = ippsMalloc_32f(len);

	// Get work buffer size
	int bufSize(0);
	if (ippiFilterBoxBorderGetBufferSize(imageSize, maskSize, ipp32f, 1, &bufSize))
		throw("Init failed");

	pBuffer = ippsMalloc_8u(bufSize);

	// Filter the image
	Ipp32f borderValue(0);
	int lineStep = sizeof(Ipp32f) * imageSize.width;
	if (ippiFilterBoxBorder_32f_C1R(pSrc, lineStep, pDst, lineStep, imageSize, maskSize, ippBorderRepl, &borderValue, pBuffer))
		throw("Filter failed");

	if (pBuffer) ippsFree(pBuffer);
	if (pSrc) ippsFree(pSrc);
	if (pDst) ippsFree(pDst);
}

 

Result for l9 scaled with maximum 1e-5 (Name: ippIP AVX2 (l9), version: 2021.7 (r0xa954907f), build date: Nov 4 2022, cpu: l9):

BoxfilterProbleml9.png

Result for k0 scaled with maximum 1e-5 (Name: ippIP AVX-512F/CD/BW/DQ/VL (k0), version: 2021.7 (r0xa954907f), build date: Nov 4 2022, cpu: k0):

BoxfilterProblemk0.png

We have same results with versions 2020.0.1 and 2021.7.

Kind regards, Roy

0 Kudos
13 Replies
ShanmukhS_Intel
Moderator
2,081 Views

Hi Roy,

 

Thanks for posting on Intel Communities.

 

We have tried running the sample code. However, we couldn't see any output images.

 

Could you please get back to us with more details like the environment being used (OS version, IDE, etc.), If Visual Studio IDE is been used, could you please share with us the project file? It helps us reproduce the issue at our end and assist you further.

 

Best Regards,

Shanmukh.SS

 

0 Kudos
Rg66
Beginner
2,057 Views

Hi Shanmukh,

Thank you for your quick answer.

There is a typo in my example:
    psrc should be pSrc
Your compiler should have noticed that.

The source image is pSrc and contains a rectangle in the center of the image.
The target image is pDst and contains the filter response.
I can't provide our image viewer, but I would have expected you to be able to view the images or analyze them with debugger tools.

We use Windows 10 Pro and Windows 11 Pro. The problem occurs in all OS.

The development is done with VisualStudio:

Microsoft Visual Studio Professional 2019
Version 16.9.6
VisualStudio.16.Release/16.9.6+31313.79
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Professional

Visual C++ 2019 00435-30011-32800-AA708
Microsoft Visual C++ 2019

Kind regards, Roy

 

0 Kudos
ShanmukhS_Intel
Moderator
2,044 Views

Hi Roy,


There is a typo in my example:  psrc should be pSrc Your compiler should have noticed that.

>> Yeah, during the initial run we faced this compilation error and updated the psrc with pSrc to get the error resolved.


I can't provide our image viewer, but I would have expected you to be able to view the images or analyze them with debugger tools.

>> We have executed the code and could see a blank output. Hence, it would be an immense help if you share with us the steps to generate those images as it helps us reproduce the same and escalate to the relevant team.


Best Regards,

Shanmukh.SS


0 Kudos
Rg66
Beginner
2,029 Views

Hi Shanmukh,

I have created the image views again with marking of the relevant areas.

The source image pSrc is created and filled in lines 11 to 21. This image looks like this:
MarkedSrcImage.png
After filtering I get the following image (This looks ok without scaling
MarkedDstImage.png
With scaling, however, you can see stripes outside of the expected filter response (in this picture for k0):
MarkedDstImageScaled.png
At l9, the stripes below and to the right of the valid filter response are even larger (see first image of the original query).

 

Kind regards,

Roy

0 Kudos
ShanmukhS_Intel
Moderator
1,966 Views

Hi Roy,


Thanks for sharing the images. We are discussing your issue internally. We will get back to you with an update soon.


Best Regards,

Shanmukh.SS


0 Kudos
ShanmukhS_Intel
Moderator
1,932 Views

Hi Roy,


Our team is discussing your issue internally. We will inform you as soon as we have an update from the relevant team. Regrets for the delay in response.


Best Regards,

Shanmukh.SS


0 Kudos
ShanmukhS_Intel
Moderator
1,878 Views

Hi Roy,

 

This is to kindly inform you that we are able to reproduce your issue, we have shared your issue with the concerned team and they are looking into the same internally. We will inform you as soon as we have an update from the relevant team. Regrets for the delay in response.

 

Best Regards,

Shanmukh.SS

 

0 Kudos
Rg66
Beginner
1,780 Views

Hi Shanmukh,

 

Is there any news on this subject?

 

Kind regards, Roy

0 Kudos
Rg66
Beginner
1,582 Views

Hi Shanmukh,

is it still possible to get an answer?

Kind regards, Roy

0 Kudos
Rg66
Beginner
1,444 Views

Hello everyone,

is there any information about our problem?

Kind regards, Roy

0 Kudos
ShanmukhS_Intel
Moderator
1,286 Views

Hi Roy,


Our team is looking into your issue internally based on various other factors that cause this impact. We will get back to you as soon as we have an update from the concerned team. Thank you for your patience and regret the delay in response.


Best Regards,

Shanmukh.SS


0 Kudos
ShanmukhS_Intel
Moderator
1,192 Views

Hi Roy,


Thanks a lot for your patience.


Regarding the issue mentioned, It is an artifact of the type of optimization used, and the default values that control this seem reasonably set keeping these residues vary small. In addition, if you cannot take these patterns of residuals, it is advised to use a different filter and set all coefficients in the filter kernel to 1. This is functionally equivalent to a box filter.


It is a specific optimization process with default settings that aims to minimize certain residues or errors. If this is causing a blocker, it is advised to use a different filter by setting all its coefficients to 1, which is functionally the same as using a box filter.


Kindly let us know if you have any concerns.


Best Regards,

Shanmukh.SS


0 Kudos
ShanmukhS_Intel
Moderator
1,141 Views

Hi Roy,


A gentle reminder:

Has the information provided helped? Could you please let us know if you need any other information?


Best Regards,

Shanmukh.SS


0 Kudos
Reply