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

Alignment or image dimensions problem?

nrw
Beginner
489 Views

Hello,

I'm playing with the Image-Processing-MFC demo from w_ipp-sample-image_p_5.1.006. Specifically, I'm trying to changean ippiAdd call to an ippFilter* one.

IppStatus status = ippiAddC_8u_C3RSfs(
(Ipp8u*)pSrc->DataPtr(), pSrc->Step(), m_value,
(Ipp8u*)pDst->DataPtr(), pDst->Step(),pSrc->Size(),
m_scaleFactor);

This is the original call and it works great. Then I change it like so (only changing the function name and removing the m_value and m_scaleFactor arguments):

IppStatus status = ippiFilterPrewittHoriz_8u_C3R(
(Ipp8u*)pSrc->DataPtr(), pSrc->Step(),
(Ipp8u*)pDst->DataPtr(), pDst->Step(), pSrc->Size());

And it crashes at

00C89AB0 movq xmm0,mmword ptr [esi]

... where Visual C++ claims that esi is 16907621.But the image data seems to be allocatedby malloc(), so shouldn'tall databe correctly aligned?Now, I'm barely beginning to use the IPP, but this confuses me because the data type is the same and the number of channels is the same as in the Add call, so whyshouldn't it work? It gets even stranger: When I change the step size and ROI width to a low value such as 60 or 50, the filter does work!

IppiSize roiSize = { 50, 50 };

IppStatus status = ippiAddC_8u_C3RSfs(
(Ipp8u*)pSrc->DataPtr(), 50, m_value,
(Ipp8u*)pDst->DataPtr(), 50,roiSize,
m_scaleFactor);

This works and filters a tiny part of the bottom of the image.

Does this problem sound familiar to anyone? What am I missing?

Thank you

0 Kudos
4 Replies
nrw
Beginner
489 Views

Oops the last call should have read

IppStatus status = ippiFilterPrewittHoriz_8u_C3R( // Works!!!
(Ipp8u*)pSrc->DataPtr(), 50,
(Ipp8u*)pDst->DataPtr(), 50, roiSize);

0 Kudos
Vladimir_Dudnik
Employee
489 Views

Hello,

there is one step, which seems tobe missed. I mean reading IPP user manual document to learn details about 2D filters implementation in IPP. Some filters need border to be allocated caller around of image and some filters do not need it. I think your issue was related to that

Regards,
Vladimir

0 Kudos
nrw
Beginner
489 Views

Hi Vladimir,

thanks, adding a border did the trick! The manual didn't quite "clue me in" but this thread helped enormously:

http://softwareforums.intel.com/en-us/forums//topic/50286

Sorry for asking such a basic question, but I'm not just new to the IPP but also to image processing in general, and it's a lot of new information for me.

Regards

0 Kudos
Vladimir_Dudnik
Employee
489 Views

We will be glad to improve IPP documentation, but it is not clear whatwe can add to it. For example, if you'll look at IPP Reference Manual, Volume 2: Image and Video Processing, chapter 9 Filtering Functions, it starts from article named Borders, where concept of borders described.

Do you have any idea what we can improve in documenation regarding that?

Regards,
Vladimir

0 Kudos
Reply