<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting Null Pointer Error (-8) with OpenCV + ippiFilterBoxBorder in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Getting-Null-Pointer-Error-8-with-OpenCV-ippiFilterBoxBorder/m-p/1143034#M26149</link>
    <description>&lt;P&gt;Hello, I'm trying to run some initial test with Intel IPP / FilterBox operator (version 2018 3.1), starting from an image opened with OpenCV.&lt;/P&gt;

&lt;P&gt;I readed how to use it from &lt;A href="https://software.intel.com/en-us/ipp-dev-reference-filterboxborder" target="_blank"&gt;https://software.intel.com/en-us/ipp-dev-reference-filterboxborder&lt;/A&gt;, basically I do the following:&lt;/P&gt;

&lt;P&gt;- Open the image with OpenCV, grayscale&lt;BR /&gt;
	- call ippiFilterBoxBorderGetBufferSize, no errors here&lt;BR /&gt;
	- call ippsMalloc_8u to allocate buffer&lt;BR /&gt;
	- call ippiFilterBoxBorder_8u_C1R, this one returns -8 error (Null Pointer)&lt;/P&gt;

&lt;P&gt;I can't underrstand why I receive the -8 error, while there are no Null data around and sizes are ok. Is it something related to OpenCV? I used that method after reding this: &lt;A href="https://stackoverflow.com/questions/13465914/using-opencv-mat-images-with-intel-ipp" target="_blank"&gt;https://stackoverflow.com/questions/13465914/using-opencv-mat-images-with-intel-ipp&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Any ideas? Here is the code, thank you!&lt;/P&gt;

&lt;P&gt;---&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;cv::Mat a = cv::imread("test.jpg", CV_LOAD_IMAGE_GRAYSCALE);
int a_type = a.type(); // CV_8U
int a_channels = CV_MAT_CN(a.type()); // 1
cv::Mat res_ipp = a.clone(); // prepare the results starting from a copy of a

IppiSize srcSize = { a.cols, a.rows };
IppiSize kernelSize = { 51, 51 };
Ipp8u* pBuffer = NULL;
int bufSize = 0;
IppStatus s = NULL;
std::string ss;

s = ippiFilterBoxBorderGetBufferSize(srcSize, kernelSize, IppDataType::ipp8u, a_channels, &amp;amp;bufSize);
ss = ippGetStatusString(s); // no error here
pBuffer = ippsMalloc_8u(bufSize);

bool ac = a.isContinuous(); // returns TRUE
bool rc = res_ipp.isContinuous(); // returns TRUE
Ipp8u* a_p = a.ptr&amp;lt;Ipp8u&amp;gt;(); // not NULL
int a_step = (int)a.step; // equals to width of a
Ipp8u* res_p = res_ipp.ptr&amp;lt;Ipp8u&amp;gt;(); // not NULL
int res_step = (int)res_ipp.step; // equals to width of res_ipp

s = ippiFilterBoxBorder_8u_C1R(a_p, a_step, res_p, res_step, srcSize, kernelSize, IppiBorderType::ippBorderConst, 0, pBuffer);
ss = ippGetStatusString(s); // !!!! Null Pointer Error (-8)
if (pBuffer) ippsFree(pBuffer);&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;---&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 09:42:03 GMT</pubDate>
    <dc:creator>afdl</dc:creator>
    <dc:date>2018-06-20T09:42:03Z</dc:date>
    <item>
      <title>Getting Null Pointer Error (-8) with OpenCV + ippiFilterBoxBorder</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Getting-Null-Pointer-Error-8-with-OpenCV-ippiFilterBoxBorder/m-p/1143034#M26149</link>
      <description>&lt;P&gt;Hello, I'm trying to run some initial test with Intel IPP / FilterBox operator (version 2018 3.1), starting from an image opened with OpenCV.&lt;/P&gt;

&lt;P&gt;I readed how to use it from &lt;A href="https://software.intel.com/en-us/ipp-dev-reference-filterboxborder" target="_blank"&gt;https://software.intel.com/en-us/ipp-dev-reference-filterboxborder&lt;/A&gt;, basically I do the following:&lt;/P&gt;

&lt;P&gt;- Open the image with OpenCV, grayscale&lt;BR /&gt;
	- call ippiFilterBoxBorderGetBufferSize, no errors here&lt;BR /&gt;
	- call ippsMalloc_8u to allocate buffer&lt;BR /&gt;
	- call ippiFilterBoxBorder_8u_C1R, this one returns -8 error (Null Pointer)&lt;/P&gt;

&lt;P&gt;I can't underrstand why I receive the -8 error, while there are no Null data around and sizes are ok. Is it something related to OpenCV? I used that method after reding this: &lt;A href="https://stackoverflow.com/questions/13465914/using-opencv-mat-images-with-intel-ipp" target="_blank"&gt;https://stackoverflow.com/questions/13465914/using-opencv-mat-images-with-intel-ipp&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Any ideas? Here is the code, thank you!&lt;/P&gt;

&lt;P&gt;---&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;cv::Mat a = cv::imread("test.jpg", CV_LOAD_IMAGE_GRAYSCALE);
int a_type = a.type(); // CV_8U
int a_channels = CV_MAT_CN(a.type()); // 1
cv::Mat res_ipp = a.clone(); // prepare the results starting from a copy of a

IppiSize srcSize = { a.cols, a.rows };
IppiSize kernelSize = { 51, 51 };
Ipp8u* pBuffer = NULL;
int bufSize = 0;
IppStatus s = NULL;
std::string ss;

s = ippiFilterBoxBorderGetBufferSize(srcSize, kernelSize, IppDataType::ipp8u, a_channels, &amp;amp;bufSize);
ss = ippGetStatusString(s); // no error here
pBuffer = ippsMalloc_8u(bufSize);

bool ac = a.isContinuous(); // returns TRUE
bool rc = res_ipp.isContinuous(); // returns TRUE
Ipp8u* a_p = a.ptr&amp;lt;Ipp8u&amp;gt;(); // not NULL
int a_step = (int)a.step; // equals to width of a
Ipp8u* res_p = res_ipp.ptr&amp;lt;Ipp8u&amp;gt;(); // not NULL
int res_step = (int)res_ipp.step; // equals to width of res_ipp

s = ippiFilterBoxBorder_8u_C1R(a_p, a_step, res_p, res_step, srcSize, kernelSize, IppiBorderType::ippBorderConst, 0, pBuffer);
ss = ippGetStatusString(s); // !!!! Null Pointer Error (-8)
if (pBuffer) ippsFree(pBuffer);&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;---&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 09:42:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Getting-Null-Pointer-Error-8-with-OpenCV-ippiFilterBoxBorder/m-p/1143034#M26149</guid>
      <dc:creator>afdl</dc:creator>
      <dc:date>2018-06-20T09:42:03Z</dc:date>
    </item>
    <item>
      <title>Hi.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Getting-Null-Pointer-Error-8-with-OpenCV-ippiFilterBoxBorder/m-p/1143035#M26150</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;

&lt;DIV&gt;ippiFilterBoxBorder_8u_C1R has next API&lt;/DIV&gt;

&lt;DIV&gt;&lt;SPAN style="font-size: 13.008px;"&gt;IPPAPI(IppStatus, ippiFilterBoxBorder_8u_C1R,(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep,IppiSize roiSize,&lt;/SPAN&gt;&lt;/DIV&gt;

&lt;DIV&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp; &amp;nbsp; IppiSize maskSize, IppiBorderType border,const Ipp8u* borderValue, Ipp8u* pBuffer))&lt;/SPAN&gt;&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;where const Ipp8u* borderValue is pointer but not value.&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;Thanks for use of IPP library.&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Jun 2018 09:36:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Getting-Null-Pointer-Error-8-with-OpenCV-ippiFilterBoxBorder/m-p/1143035#M26150</guid>
      <dc:creator>Andrey_B_Intel</dc:creator>
      <dc:date>2018-06-21T09:36:42Z</dc:date>
    </item>
    <item>
      <title>That was easy! Thank you,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Getting-Null-Pointer-Error-8-with-OpenCV-ippiFilterBoxBorder/m-p/1143036#M26151</link>
      <description>&lt;P&gt;That was easy! Thank you, solved.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 12:52:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Getting-Null-Pointer-Error-8-with-OpenCV-ippiFilterBoxBorder/m-p/1143036#M26151</guid>
      <dc:creator>Francesconi__Alessan</dc:creator>
      <dc:date>2018-06-21T12:52:12Z</dc:date>
    </item>
  </channel>
</rss>

