Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ippiCopyConstBorder got wrong value

adaTao
Beginner
752 Views

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 Kudos
1 Solution
adaTao
Beginner
689 Views
0 Kudos
3 Replies
NoorjahanSk_Intel
Moderator
704 Views

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.

 

0 Kudos
adaTao
Beginner
690 Views

Very appreciated for your reply! It works now.

0 Kudos
NoorjahanSk_Intel
Moderator
654 Views

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


0 Kudos
Reply