<?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 Problem with BoxFilter and NAN values in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Problem-with-BoxFilter-and-NAN-values/m-p/884404#M10529</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;we're using ipp for blurring arbitrary float data fields. The problem we encounter is that if there are NAN values inside the source data field, the result is a data field with only NAN values. Can anyone explain why this happens when applying a simple box filter ? As far as I understand it, the filter is not applied incrementally, so the worst that should happen is that the "border values" become NAN.&lt;/P&gt;
&lt;P&gt;The code looks as follows :&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;PRE&gt;[cpp]void blur(float* data, int width, int height, int radius)&lt;BR /&gt;{&lt;BR /&gt;  if(radius &amp;lt; 1 || data == 0)&lt;BR /&gt;    return;&lt;BR /&gt;&lt;BR /&gt;  // first make sure we have an image big enough for our filter operation&lt;BR /&gt;&lt;BR /&gt;  unsigned int radius2 = radius*2;&lt;BR /&gt;&lt;BR /&gt;  float* tmpData = new float[(width+radius2)*(height+radius2)];&lt;BR /&gt;&lt;BR /&gt;  IppiSize srcRoi = { width, height };&lt;BR /&gt;  IppiSize dstRoi = { width+radius2, height+radius2 };&lt;BR /&gt;&lt;BR /&gt;  IppStatus result;&lt;BR /&gt;&lt;BR /&gt;  result = ippiCopyReplicateBorder_32f_C3R( data, width*3*4, srcRoi, tmpData, (width+radius2)*3*4, dstRoi, radius, radius );&lt;BR /&gt;&lt;BR /&gt;  int offset = ((width+radius2)*radius + radius);&lt;BR /&gt;&lt;BR /&gt;  IppiSize  mask   = { radius2+1, radius2+1 };&lt;BR /&gt;  IppiPoint anchor = { radius, radius };&lt;BR /&gt;&lt;BR /&gt;  result = ippiFilterBox_32f_C3R( tmpData+offset*3, (width+radius2)*3*4, data, width*3*4, srcRoi, mask, anchor );&lt;BR /&gt;&lt;BR /&gt;  delete [] tmpData;&lt;BR /&gt;}&lt;BR /&gt;[/cpp]&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Help is greatly appreciated :-)&lt;/P&gt;
&lt;P&gt;ALex&lt;/P&gt;</description>
    <pubDate>Fri, 12 Dec 2008 11:23:04 GMT</pubDate>
    <dc:creator>benz__alexander</dc:creator>
    <dc:date>2008-12-12T11:23:04Z</dc:date>
    <item>
      <title>Problem with BoxFilter and NAN values</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Problem-with-BoxFilter-and-NAN-values/m-p/884404#M10529</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;we're using ipp for blurring arbitrary float data fields. The problem we encounter is that if there are NAN values inside the source data field, the result is a data field with only NAN values. Can anyone explain why this happens when applying a simple box filter ? As far as I understand it, the filter is not applied incrementally, so the worst that should happen is that the "border values" become NAN.&lt;/P&gt;
&lt;P&gt;The code looks as follows :&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;PRE&gt;[cpp]void blur(float* data, int width, int height, int radius)&lt;BR /&gt;{&lt;BR /&gt;  if(radius &amp;lt; 1 || data == 0)&lt;BR /&gt;    return;&lt;BR /&gt;&lt;BR /&gt;  // first make sure we have an image big enough for our filter operation&lt;BR /&gt;&lt;BR /&gt;  unsigned int radius2 = radius*2;&lt;BR /&gt;&lt;BR /&gt;  float* tmpData = new float[(width+radius2)*(height+radius2)];&lt;BR /&gt;&lt;BR /&gt;  IppiSize srcRoi = { width, height };&lt;BR /&gt;  IppiSize dstRoi = { width+radius2, height+radius2 };&lt;BR /&gt;&lt;BR /&gt;  IppStatus result;&lt;BR /&gt;&lt;BR /&gt;  result = ippiCopyReplicateBorder_32f_C3R( data, width*3*4, srcRoi, tmpData, (width+radius2)*3*4, dstRoi, radius, radius );&lt;BR /&gt;&lt;BR /&gt;  int offset = ((width+radius2)*radius + radius);&lt;BR /&gt;&lt;BR /&gt;  IppiSize  mask   = { radius2+1, radius2+1 };&lt;BR /&gt;  IppiPoint anchor = { radius, radius };&lt;BR /&gt;&lt;BR /&gt;  result = ippiFilterBox_32f_C3R( tmpData+offset*3, (width+radius2)*3*4, data, width*3*4, srcRoi, mask, anchor );&lt;BR /&gt;&lt;BR /&gt;  delete [] tmpData;&lt;BR /&gt;}&lt;BR /&gt;[/cpp]&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Help is greatly appreciated :-)&lt;/P&gt;
&lt;P&gt;ALex&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2008 11:23:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Problem-with-BoxFilter-and-NAN-values/m-p/884404#M10529</guid>
      <dc:creator>benz__alexander</dc:creator>
      <dc:date>2008-12-12T11:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BoxFilter and NAN values</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Problem-with-BoxFilter-and-NAN-values/m-p/884405#M10530</link>
      <description>&lt;P&gt;Example Data :&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;PRE&gt;[cpp]Source Data:

nan nan nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan nan nan
nan nan nan nan 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 87.00 87.00 87.00
0.00 0.00 84.00 84.00 84.00 85.00 85.00 87.00 88.00 90.00 92.00 92.00
87.00 87.00 88.00 90.00 91.00 94.00 95.00 97.00 98.00 100.00 101.00 101.00
100.00 100.00 101.00 102.00 102.00 102.00 102.00 102.00 101.00 102.00 102.00 102.00
100.00 100.00 101.00 102.00 102.00 102.00 102.00 102.00 101.00 102.00 102.00 102.00

Result Data:

nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan
nan nan nan nan nan nan nan nan nan nan

[/cpp]&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2008 11:25:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Problem-with-BoxFilter-and-NAN-values/m-p/884405#M10530</guid>
      <dc:creator>benz__alexander</dc:creator>
      <dc:date>2008-12-12T11:25:44Z</dc:date>
    </item>
  </channel>
</rss>

