<?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 Hi, in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152676#M26318</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Please check following points:&lt;/P&gt;

&lt;P&gt;1. You specify with antialising in ''ippiResizeGetSize_8u" function, however you did not use initial fucntion "&lt;A href="https://software.intel.com/node/1c8a4e16-3a6c-40fe-ac06-c48de4dbc432#1C8A4E16-3A6C-40FE-AC06-C48DE4DBC432"&gt;ippiResizeLanczosInit&lt;/A&gt;" and computing function "ippiResizeAntialiasing".&amp;nbsp;&lt;/P&gt;

&lt;P&gt;2. You specify size of Dst image as 'zoomImgSize' in "ippiResizeLanczosInit_8u" fucntion. Please make sure if the zoomImgSize is same as sizeDst. You only need one parameter for describing size of Dst Img.&lt;/P&gt;

&lt;P&gt;Please follow this sample to see how to use IPP resize with antialiasing:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/ipp-dev-reference-ResizeAntialiasing.html"&gt;https://software.intel.com/en-us/ipp-dev-reference-ResizeAntialiasing.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	Fiona&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2017 04:07:47 GMT</pubDate>
    <dc:creator>Zhen_Z_Intel</dc:creator>
    <dc:date>2017-11-08T04:07:47Z</dc:date>
    <item>
      <title>Pan/Zoom image using ResizeLanczos</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152673#M26315</link>
      <description>&lt;P&gt;I am having trouble with ref function/ functionality - code below. When I increase dZoom beyond some value it crashes. It also misaligns the rows of the output image (I uploaded an image showing this). Input/Output is grayscale (8u). I&amp;nbsp;likely have an incorrect understanding of sizeSrc, sizeDst and &lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;zoomImgSize. &lt;/FONT&gt;&lt;/FONT&gt;Can someone please check what is going on?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;bool PanZoomImg(byte* pImgSrc, byte* pImgDst, int nSrcX, int nSrcY, int nDstX, int bDstY, double dZoom, double dPanX, double dPanY)
{
&amp;nbsp;IppStatus ippStatus = ippStsNoErr;
&amp;nbsp;IppiSize zoomImgSize = { static_cast&amp;lt;int&amp;gt;(nSrcX*dZoom), static_cast&amp;lt;int&amp;gt;(nSrcY*dZoom) };
&amp;nbsp;uint32_t nrLobes = 2;
&amp;nbsp;IppiResizeSpec_32f* pSpec = 0;
&amp;nbsp;int specSize = 0;
&amp;nbsp;int initSize = 0;
&amp;nbsp;int bufSize = 0;
&amp;nbsp;Ipp8u* pInitBuf = 0;
&amp;nbsp;Ipp8u* pBuffer = 0;
&amp;nbsp;IppiBorderSize *pBordersize = new IppiBorderSize();
&amp;nbsp;pBordersize-&amp;gt;borderBottom = pBordersize-&amp;gt;borderLeft = pBordersize-&amp;gt;borderRight = pBordersize-&amp;gt;borderTop = 0;
&amp;nbsp;IppiPoint dstOffset = { (int)dPanX, (int)dPanY };
&amp;nbsp;IppiBorderType borderType = ippBorderRepl;
&amp;nbsp;Ipp8u borderValue = 0;
&amp;nbsp;IppiInterpolationType interpolType = ippLanczos;
&amp;nbsp;Ipp32u antialiasing = 1;
&amp;nbsp;Ipp32u numChannels = 1;

&amp;nbsp;IppiSize *sizeSrc = new IppiSize();
&amp;nbsp;sizeSrc-&amp;gt;width = nSrcX;
&amp;nbsp;sizeSrc-&amp;gt;height = nSrcY;

&amp;nbsp;IppiSize *sizeDst = new IppiSize();
&amp;nbsp;sizeDst-&amp;gt;width = nDstX;
&amp;nbsp;sizeDst-&amp;gt;height = bDstY;

&amp;nbsp;ippStatus = ippiResizeGetSize_8u(*sizeSrc, *sizeDst, interpolType, antialiasing, &amp;amp;specSize, &amp;amp;initSize);
&amp;nbsp;if (ippStatus &amp;gt; ippStsNoErr) return ippStatus;
&amp;nbsp;pSpec = (IppiResizeSpec_32f*)ippsMalloc_8u(specSize);
&amp;nbsp;if (pSpec == 0) throw 0;
&amp;nbsp;pInitBuf = ippsMalloc_8u(initSize);
&amp;nbsp;if (pInitBuf == 0) { ippsFree(pSpec); throw 0; }
&amp;nbsp;ippStatus = ippiResizeLanczosInit_8u(*sizeSrc, zoomImgSize, nrLobes, pSpec, pInitBuf);
&amp;nbsp;if (ippStatus &amp;gt; ippStsNoErr) { ippsFree(pInitBuf); ippsFree(pSpec); throw 0; }

&amp;nbsp;ippStatus = ippiResizeGetBufferSize_8u(pSpec, *sizeDst, numChannels, &amp;amp;bufSize);
&amp;nbsp;if ((ippStatus &amp;gt; ippStsNoErr) &amp;amp;&amp;amp; (ippStatus != ippStsSizeWrn)) { ippsFree(pInitBuf); ippsFree(pSpec); throw 0; }
&amp;nbsp;pBuffer = ippsMalloc_8u(bufSize);
&amp;nbsp;if (pBuffer == 0) { ippsFree(pInitBuf); ippsFree(pSpec); throw 0; }

&amp;nbsp;ippStatus = ippiResizeGetBorderSize_8u(pSpec, pBordersize);
&amp;nbsp;if (ippStatus &amp;gt; ippStsNoErr) { ippsFree(pBuffer); ippsFree(pInitBuf); ippsFree(pSpec); throw 0; }

&amp;nbsp;ippStatus = ippiResizeLanczos_8u_C1R(pImgSrc, zoomImgSize.width, pImgDst, nDstX, dstOffset, *sizeDst, borderType, &amp;amp;borderValue, pSpec, pBuffer);
&amp;nbsp;if ((ippStatus &amp;gt; ippStsNoErr) &amp;amp;&amp;amp; (ippStatus != ippStsSizeWrn)) { ippsFree(pBuffer); ippsFree(pInitBuf); ippsFree(pSpec); throw 0; }

&amp;nbsp;ippsFree(pBuffer);
&amp;nbsp;ippsFree(pInitBuf);
&amp;nbsp;ippsFree(pSpec);

&amp;nbsp;return true;
}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 19:55:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152673#M26315</guid>
      <dc:creator>umundry</dc:creator>
      <dc:date>2017-11-06T19:55:58Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152674#M26316</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Here's a problem in your source code, in "ippiResizeLanczosInit_8u" you set size of 'zoomImgSize' as dstImg size. However, in "ippiResizeLanczos_8u_C1R", you set 'zoomImgSize.width' as srcStep. You may lead to problem.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	Fiona&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 04:05:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152674#M26316</guid>
      <dc:creator>Zhen_Z_Intel</dc:creator>
      <dc:date>2017-11-07T04:05:21Z</dc:date>
    </item>
    <item>
      <title>Thank you Fiona! I fixed that</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152675#M26317</link>
      <description>&lt;P&gt;Thank you Fiona! I fixed that in the new line&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;ippStatus = ippiResizeLanczos_8u_C1R(pImgSrc, nSrcX, pImgDst, nDstX, dstOffset, *sizeDst, borderType, &amp;amp;borderValue, pSpec, pBuffer);&lt;/PRE&gt;

&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;With that of course the row misalignment is gone. A few problems remain though:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;* I get a &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;ippStsSizeWrn error in the &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#6f008a" face="Consolas" size="2"&gt;&lt;FONT color="#6f008a" face="Consolas" size="2"&gt;&lt;FONT color="#6f008a" face="Consolas" size="2"&gt;ippiResizeGetBufferSize_8u() &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;as well as the &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#6f008a" face="Consolas" size="2"&gt;&lt;FONT color="#6f008a" face="Consolas" size="2"&gt;&lt;FONT color="#6f008a" face="Consolas" size="2"&gt;ippiResizeLanczos_8u_C1R() &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;calls. The latter crashes for certain zoom/pan values.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;&lt;FONT color="#2f4f4f" face="Consolas" size="2"&gt;* The zoom originates in the upper left corner of the image. I need it to originate in the center of the image.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;How do I fix those problems?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 14:22:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152675#M26317</guid>
      <dc:creator>umundry</dc:creator>
      <dc:date>2017-11-07T14:22:42Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152676#M26318</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Please check following points:&lt;/P&gt;

&lt;P&gt;1. You specify with antialising in ''ippiResizeGetSize_8u" function, however you did not use initial fucntion "&lt;A href="https://software.intel.com/node/1c8a4e16-3a6c-40fe-ac06-c48de4dbc432#1C8A4E16-3A6C-40FE-AC06-C48DE4DBC432"&gt;ippiResizeLanczosInit&lt;/A&gt;" and computing function "ippiResizeAntialiasing".&amp;nbsp;&lt;/P&gt;

&lt;P&gt;2. You specify size of Dst image as 'zoomImgSize' in "ippiResizeLanczosInit_8u" fucntion. Please make sure if the zoomImgSize is same as sizeDst. You only need one parameter for describing size of Dst Img.&lt;/P&gt;

&lt;P&gt;Please follow this sample to see how to use IPP resize with antialiasing:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/ipp-dev-reference-ResizeAntialiasing.html"&gt;https://software.intel.com/en-us/ipp-dev-reference-ResizeAntialiasing.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	Fiona&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 04:07:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152676#M26318</guid>
      <dc:creator>Zhen_Z_Intel</dc:creator>
      <dc:date>2017-11-08T04:07:47Z</dc:date>
    </item>
    <item>
      <title>Thank you Fiona!</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152677#M26319</link>
      <description>&lt;P&gt;Thank you Fiona!&lt;/P&gt;

&lt;P&gt;The antialiasing part I am not sure about if I need that at all. I'll only be able to tell once I can look at output images.&lt;/P&gt;

&lt;P&gt;I think the basic problem is that I am not sure which sizes to use in which of the&amp;nbsp;function calls. In my view, there are 3 sizes to deal with:&lt;/P&gt;

&lt;P&gt;* the source image size&lt;/P&gt;

&lt;P&gt;*&amp;nbsp;a "zoom" image size&lt;/P&gt;

&lt;P&gt;* a viewport size&lt;/P&gt;

&lt;P&gt;As an example, the source is 1,000 x 1,000 pixels. Zoom factor is 3, therefore the "zoom" image size is 3,000 x 3,000.&amp;nbsp;A viewport of size 600 x 300 will need to display a 600 x 300 region of interest from the 3,000 x 3,000 "zoom" image, taking into account panX and panY.&lt;/P&gt;

&lt;P&gt;Can you please look at the code in light of above example&amp;nbsp;and see what is wrong?&lt;/P&gt;

&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 14:21:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Pan-Zoom-image-using-ResizeLanczos/m-p/1152677#M26319</guid>
      <dc:creator>umundry</dc:creator>
      <dc:date>2017-11-08T14:21:08Z</dc:date>
    </item>
  </channel>
</rss>

