<?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 copy the image border efficiently ? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-copy-the-image-border-efficiently/m-p/1106562#M25304</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Suppose I have a imageA, now I want it have the duplicate border, for example, copy the data&amp;nbsp;from the&amp;nbsp;second row to the&amp;nbsp;first row, copy the data&amp;nbsp;from the&amp;nbsp;last but one row to the last row, copy the second column to the first colum, copy the last but one column to the last colum.&lt;/P&gt;

&lt;P&gt;In opencv, it is very simple&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.row(1).copyTo(image.row(0));//copy 2nd row to first row&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.row(nx).copyTo(image.row(nx+1));//copy last but one row to the last row&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.col(1).copyTo(image.col(0)); //copy last but one column to the last column&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.col(ny).copyTo(image.col(ny+1));//copy last but one column to the last column&lt;/P&gt;

&lt;P&gt;So I dont knwo if there is a efficient way to do same thing using IPP ?&lt;/P&gt;

&lt;P&gt;Thanks !&lt;/P&gt;

&lt;P&gt;Stella&lt;/P&gt;</description>
    <pubDate>Mon, 15 May 2017 11:39:29 GMT</pubDate>
    <dc:creator>Stella_Y_</dc:creator>
    <dc:date>2017-05-15T11:39:29Z</dc:date>
    <item>
      <title>How to copy the image border efficiently ?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-copy-the-image-border-efficiently/m-p/1106562#M25304</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Suppose I have a imageA, now I want it have the duplicate border, for example, copy the data&amp;nbsp;from the&amp;nbsp;second row to the&amp;nbsp;first row, copy the data&amp;nbsp;from the&amp;nbsp;last but one row to the last row, copy the second column to the first colum, copy the last but one column to the last colum.&lt;/P&gt;

&lt;P&gt;In opencv, it is very simple&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.row(1).copyTo(image.row(0));//copy 2nd row to first row&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.row(nx).copyTo(image.row(nx+1));//copy last but one row to the last row&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.col(1).copyTo(image.col(0)); //copy last but one column to the last column&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.col(ny).copyTo(image.col(ny+1));//copy last but one column to the last column&lt;/P&gt;

&lt;P&gt;So I dont knwo if there is a efficient way to do same thing using IPP ?&lt;/P&gt;

&lt;P&gt;Thanks !&lt;/P&gt;

&lt;P&gt;Stella&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 11:39:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-copy-the-image-border-efficiently/m-p/1106562#M25304</guid>
      <dc:creator>Stella_Y_</dc:creator>
      <dc:date>2017-05-15T11:39:29Z</dc:date>
    </item>
    <item>
      <title>Hi Stella,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-copy-the-image-border-efficiently/m-p/1106563#M25305</link>
      <description>&lt;P&gt;Hi Stella,&lt;/P&gt;

&lt;P&gt;I believe more proper way to make border in OpenCV is like this:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;    cv::Mat srcSub = cv::Mat(src, cv::Rect(1, 1, src.size().width - 2, src.size().height - 2)); // Create submatrix which points to image inside border
    cv::copyMakeBorder(srcSub, src, 1, 1, 1, 1, BORDER_REPLICATE);&lt;/PRE&gt;

&lt;P&gt;In IPP there are similar functions, e.g.:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;    IppiSize srcSize = {width-2, height-2}; // Size of image inside border
    IppiSize dstSize = {width, height}; // Full size with border
    pSrc = (Ipp8u*)pSrc + srcDstStep + elemSize; // Shift pointer to be inside border
    ippiCopyReplicateBorder_8u_C1IR_L(pSrc, srcDstStep, srcSize, dstSize, 1, 1);&lt;/PRE&gt;

&lt;P&gt;This will replicate border rows/columns in the same image. This example is for 8u C1 data with 1px border for every side.&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 12:00:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-copy-the-image-border-efficiently/m-p/1106563#M25305</guid>
      <dc:creator>Pavel_V_Intel</dc:creator>
      <dc:date>2017-05-15T12:00:00Z</dc:date>
    </item>
    <item>
      <title>Hi Pavel,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-copy-the-image-border-efficiently/m-p/1106564#M25306</link>
      <description>&lt;P&gt;Hi Pavel,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. I believe you give me the correct answer.&lt;/P&gt;

&lt;P&gt;I will try then.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Stella&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Pavel V. (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Hi Stella,&lt;/P&gt;

&lt;P&gt;I believe more proper way to make border in OpenCV is like this:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;    cv::Mat srcSub = cv::Mat(src, cv::Rect(1, 1, src.size().width - 2, src.size().height - 2)); // Create submatrix which points to image inside border
    cv::copyMakeBorder(srcSub, src, 1, 1, 1, 1, BORDER_REPLICATE);&lt;/PRE&gt;

&lt;P&gt;In IPP there are similar functions, e.g.:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;    IppiSize srcSize = {width-2, height-2}; // Size of image inside border
    IppiSize dstSize = {width, height}; // Full size with border
    pSrc = (Ipp8u*)pSrc + srcDstStep + elemSize; // Shift pointer to be inside border
    ippiCopyReplicateBorder_8u_C1IR_L(pSrc, srcDstStep, srcSize, dstSize, 1, 1);&lt;/PRE&gt;

&lt;P&gt;This will replicate border rows/columns in the same image. This example is for 8u C1 data with 1px border for every side.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 12:11:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/How-to-copy-the-image-border-efficiently/m-p/1106564#M25306</guid>
      <dc:creator>Stella_Y_</dc:creator>
      <dc:date>2017-05-15T12:11:32Z</dc:date>
    </item>
  </channel>
</rss>

