Community
cancel
Showing results for 
Search instead for 
Did you mean: 
msjuniorc
Beginner
41 Views

dotnet-cpp ippi example issue report.

Hi all,

I am using the dotnet-cpp (C#) examples to become more familiar with the ways IPP can be used through P/Invoke in C#.

From time to time, I run into "issues" that could be the fruit either of my IPP inexperience or of a need to correct the example code. I understand the example code is not supposed to be a full application.

Issue with Filtering Functions:

The code is shipped with an "roi" definition of 3/4 width * 3/4 height. I actually liked the approach because is shows the effects of a filter on a subsection of the image that can immediately be compared with the original.

I am now in need to use a blur filter on the entire picture. Thus I resized the ROI to:

roi = new IppiSize(bmpsrc.Width, bmpsrc.Height);

Unfortunately this causes an error (System.AccessViolationException: Attempted to read or write protected memory.)

In order to successfully invoke the method, I have to reduce the ROI as follows:

roi = new IppiSize(bmpsrc.Width - 4, bmpsrc.Height - 4);

Is this correct because the "maskSize" is 2*2 or is there some other issue that doesn't allow me to address the entire ROI?

TIA,

msjuniorc

0 Kudos
2 Replies
Albert_Stepanov
New Contributor I
41 Views

Hi msjuniorc,
Yes, you are right. The filtering functions "perform neighborhood operations. They operate on assumption that for each pixel being processed, all referred neighborhood pixels necessary for the operation are also available." (See the manual for image processing, sections "ROI", "Borders")
So if you want to operate with whole image and with mask 2*2 you have to reduce the ROI (as you made) or have to create extended source image using functions ippiCopyConstBorder, ippiCopyReplicateBorder, or ippiCopyWrapBorder.
Regards,
Albert

msjuniorc
Beginner
41 Views

Thank you Albert.

msjuniorc