Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6810 ディスカッション

ippiCopyConstBorder got wrong value

adaTao
ビギナー
1,292件の閲覧回数

Hi,

The wrong value I got after calling function ippiCopyConstBorder_32f_C1R.

 

Code Example:

adaTao_0-1663309398901.png

Got Wrong Value:

adaTao_1-1663309590749.png

This problem has been bothering me for two days, 

Thanks for any help!

0 件の賞賛
1 解決策
adaTao
ビギナー
1,229件の閲覧回数
3 返答(返信)
NoorjahanSk_Intel
モデレーター
1,244件の閲覧回数

Hi,

 

Thanks for reaching out to us.

 

We looked into your code and made few changes to your code.

 

Since size of ipp32f is 4 Bytes, srcstep will be 32(i.e 8x4=32 Bytes) & dststep will be 28(i.e 7X4=28 Bytes).

 

where, 

srcStep = 8 (Distance in bytes between starts of consecutive lines in the source image.)

dstStep= 7 (Distance, in bytes, between the starting points of consecutive lines in the destination image.)

 

Could you please try the below code and let us know if it helps?

 

 

 

#include<iostream>
#include <stdio.h>
#include<ipp.h>
int main()
{
    Ipp32f src[8 * 4] = { 3.5, 3.5, 3.5, 3.0, 3.0, 8.0, 8.0, 8.0,
              3.0, 2.0, 1.0, 2.0, 3.0, 8.0, 8.0, 8.0,
              3.0, 2.0, 1.0, 2.0, 3.0, 8.0, 8.0, 8.0,
              3.0, 3.0, 3.0, 3.0, 3.0, 8.0, 8.0, 8.0 };
    Ipp32f dst[8 * 6]={0};
    IppiSize srcRoi = { 5, 4 };
    IppiSize dstRoi = { 7, 6 };
    int borderWidth = 1;
    int borderHeight = 1;
    int borderVal = 0;

    ippiCopyConstBorder_32f_C1R(src, 32, srcRoi, dst, 28, dstRoi, borderHeight, borderWidth, borderVal);
    for (int i = 0; i < 42; i++)
    {
        printf("%.1f ", dst[i]);
        if ((i + 1) % 7 == 0)
            printf("\n");

    }

}

 

 

Please find the below screenshot for the expected output.

NoorjahanSk_Intel_0-1663584839796.png

 

Thanks & Regards,

Noorjahan.

 

adaTao
ビギナー
1,230件の閲覧回数

Very appreciated for your reply! It works now.

NoorjahanSk_Intel
モデレーター
1,194件の閲覧回数

Hi,


Thanks for the confirmation.

As this issue has been resolved, we will no longer respond to this thread. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.



Thanks & Regards,

Noorjahan


返信