<?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 How to create the mask for ippiDilate? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-create-the-mask-for-ippiDilate/m-p/769640#M577</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Is there any samples to create the mask for ippiDilate?&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;If I use the API ippiDilate3x3, the result is the same as the sample shows,&lt;BR /&gt;but when try to dilate it with ippiDilate, the result is the same as input matrix without any change.&lt;BR /&gt;&lt;BR /&gt;the code:&lt;/P&gt;&lt;PRE&gt;[cpp]          	IppiSize roi = {5,5};&lt;BR /&gt;	Ipp8u kernel[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
	IppiSize kernelSize = {4,4};
	IppiPoint anchor = { 1, 1 };
	ippiDilate_8u_C1IR(x, 7, roi, kernel, kernelSize, anchor);[/cpp]&lt;/PRE&gt;&lt;P&gt;X is a 7 * 7 matrix.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Example 8-1. Dilation of a Dot&lt;/P&gt;&lt;P&gt;IppStatus dilate( void ) {&lt;/P&gt;&lt;P&gt;Ipp8u x[7*5];&lt;/P&gt;&lt;P&gt;IppiSize roi = {7,5};&lt;/P&gt;&lt;P&gt;ippiSet_8u_C1R( 0, x, 7, roi );&lt;/P&gt;&lt;P&gt;x[2*7+3] = 1;&lt;/P&gt;&lt;P&gt;roi.width = roi.width - 2;&lt;/P&gt;&lt;P&gt;roi.height = roi.height - 2;&lt;/P&gt;&lt;P&gt;return ippiDilate3x3_8u_C1IR( x+7+1, 7, roi );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;The destination image x contains:&lt;/P&gt;&lt;P&gt;00 00 00 00 00 00 00&lt;/P&gt;&lt;P&gt;00 00 01 01 01 00 00&lt;/P&gt;&lt;P&gt;00 00 01 01 01 00 00&lt;/P&gt;&lt;P&gt;00 00 01 01 01 00 00&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Xie&lt;/P&gt;</description>
    <pubDate>Mon, 02 Aug 2010 08:01:09 GMT</pubDate>
    <dc:creator>Lamp</dc:creator>
    <dc:date>2010-08-02T08:01:09Z</dc:date>
    <item>
      <title>How to create the mask for ippiDilate?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-create-the-mask-for-ippiDilate/m-p/769640#M577</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Is there any samples to create the mask for ippiDilate?&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;If I use the API ippiDilate3x3, the result is the same as the sample shows,&lt;BR /&gt;but when try to dilate it with ippiDilate, the result is the same as input matrix without any change.&lt;BR /&gt;&lt;BR /&gt;the code:&lt;/P&gt;&lt;PRE&gt;[cpp]          	IppiSize roi = {5,5};&lt;BR /&gt;	Ipp8u kernel[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
	IppiSize kernelSize = {4,4};
	IppiPoint anchor = { 1, 1 };
	ippiDilate_8u_C1IR(x, 7, roi, kernel, kernelSize, anchor);[/cpp]&lt;/PRE&gt;&lt;P&gt;X is a 7 * 7 matrix.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Example 8-1. Dilation of a Dot&lt;/P&gt;&lt;P&gt;IppStatus dilate( void ) {&lt;/P&gt;&lt;P&gt;Ipp8u x[7*5];&lt;/P&gt;&lt;P&gt;IppiSize roi = {7,5};&lt;/P&gt;&lt;P&gt;ippiSet_8u_C1R( 0, x, 7, roi );&lt;/P&gt;&lt;P&gt;x[2*7+3] = 1;&lt;/P&gt;&lt;P&gt;roi.width = roi.width - 2;&lt;/P&gt;&lt;P&gt;roi.height = roi.height - 2;&lt;/P&gt;&lt;P&gt;return ippiDilate3x3_8u_C1IR( x+7+1, 7, roi );&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;The destination image x contains:&lt;/P&gt;&lt;P&gt;00 00 00 00 00 00 00&lt;/P&gt;&lt;P&gt;00 00 01 01 01 00 00&lt;/P&gt;&lt;P&gt;00 00 01 01 01 00 00&lt;/P&gt;&lt;P&gt;00 00 01 01 01 00 00&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Xie&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2010 08:01:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-create-the-mask-for-ippiDilate/m-p/769640#M577</guid>
      <dc:creator>Lamp</dc:creator>
      <dc:date>2010-08-02T08:01:09Z</dc:date>
    </item>
    <item>
      <title>How to create the mask for ippiDilate?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-create-the-mask-for-ippiDilate/m-p/769641#M578</link>
      <description>Hi Xie, &lt;BR /&gt;&lt;BR /&gt;ippiDilate3x3_8u_C1IRuse a symmetric 3x3 mask&lt;BR /&gt;&lt;BR /&gt;If you use &lt;BR /&gt;&lt;BR /&gt;Ipp8ukernel[]={1,1,1,1,1,1,1,1,1}; //1,1,1,1,1,1,1};  &lt;LI class="alt"&gt;IppiSizekernelSize={3,3}; &lt;/LI&gt;&lt;LI&gt;IppiPointanchor={1,1};&lt;/LI&gt;&lt;P&gt;ippiDilate_8u_C1IR(x+7+1,7,roi,kernel,kernelSize,anchor);&lt;BR /&gt;&lt;BR /&gt;You will get the same result as ippiDilate3x3_8u_C1IR. &lt;BR /&gt;&lt;BR /&gt;If use IppiSizeroi={5,5} and kernelSize={4,4},anchor={1,1};you may need to consider to extend original image with the border( for example, add width=1, heigh=1,border at up and left of image, bottom +3 row) as the dicussion in &lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-processing-an-image-from-edge-to-edge/"&gt;http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-processing-an-image-from-edge-to-edge/&lt;/A&gt;&lt;BR /&gt;or use the function ippiDilateBorderReplicate, which consider the image border within function. &lt;BR /&gt;&lt;BR /&gt;a example code:&lt;/P&gt;&lt;P&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;IPP.H&gt;&lt;BR /&gt;#include &lt;WINDOWS.H&gt; &lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;/STDIO.H&gt;&lt;/WINDOWS.H&gt;&lt;/IPP.H&gt;&lt;/STRING.H&gt;&lt;/P&gt;&lt;P&gt;int main()&lt;BR /&gt;{&lt;BR /&gt; ippStaticInit();&lt;BR /&gt;&lt;BR /&gt;// Print the version of ipp being used&lt;BR /&gt; const IppLibraryVersion* lib = ippcvGetLibVersion();&lt;BR /&gt; printf("%s %s %d.%d.%d.%d\n", lib-&amp;gt;Name, lib-&amp;gt;Version,lib-&amp;gt;major, lib-&amp;gt;minor, lib-&amp;gt;majorBuild, lib-&amp;gt;build);&lt;BR /&gt;&lt;/P&gt;&lt;P&gt; IppStatus status;&lt;BR /&gt;Ipp8u x[7*5];&lt;BR /&gt;IppiSize roi = {7,5};&lt;/P&gt;&lt;P&gt;ippiSet_8u_C1R( 0, x, 7, roi );&lt;BR /&gt;x[2*7+3] = 1;&lt;/P&gt;&lt;P&gt;printf ("x\n");&lt;BR /&gt;for(int i=0; i&amp;lt;5;i++)&lt;BR /&gt;{&lt;BR /&gt;for(int j=0; j&amp;lt;7;j++)&lt;BR /&gt;printf (" %3d", x[i*7+j]);&lt;BR /&gt;printf ("\n");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Ipp8u y[7*5];&lt;BR /&gt;ippiSet_8u_C1R( 0, y, 7, roi );&lt;/P&gt;&lt;P&gt;roi.width = 5; &lt;BR /&gt;roi.height = 5;&lt;/P&gt;&lt;P&gt;IppiMorphState* ppState;&lt;BR /&gt;Ipp8u kernel[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; &lt;BR /&gt;IppiSize kernelSize = {4,4}; &lt;BR /&gt;IppiPoint anchor = { 1, 1 }; &lt;/P&gt;&lt;P&gt;status=ippiMorphologyInitAlloc_8u_C1R( roi.width, kernel, kernelSize, anchor,&lt;BR /&gt;&amp;amp;ppState);&lt;BR /&gt;printf("%s\n", ippGetStatusString(status));&lt;BR /&gt;status=ippiDilateBorderReplicate_8u_C1R( x, 7, y, 7, roi,&lt;BR /&gt;ippBorderRepl, ppState);&lt;BR /&gt;printf("%s\n", ippGetStatusString(status));&lt;BR /&gt;ippiMorphologyFree(ppState);&lt;/P&gt;&lt;P&gt;printf ("ippiDilateBorderReplicate_8u_C1R\n");&lt;BR /&gt;for(int i=0; i&amp;lt;5;i++)&lt;BR /&gt;{&lt;BR /&gt;for(int j=0; j&amp;lt;7;j++)&lt;BR /&gt;printf (" %3d", y[i*7+j]);&lt;BR /&gt;printf ("\n");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope it helps, &lt;BR /&gt;Best Regards,&lt;BR /&gt;Ying &lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2010 02:41:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-create-the-mask-for-ippiDilate/m-p/769641#M578</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2010-08-05T02:41:46Z</dc:date>
    </item>
  </channel>
</rss>

