hidden text to trigger early load of fonts ПродукцияПродукцияПродукцияПродукция Các sản phẩmCác sản phẩmCác sản phẩmCác sản phẩm المنتجاتالمنتجاتالمنتجاتالمنتجات מוצריםמוצריםמוצריםמוצרים
Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Help with ippiCopyReplicateBorder function

Intel_C_Intel
직원
651 조회수
Hello,

I am having trouble with using the ippiCopyReplicateBorder function when performing the in-place operation. I used the not-in-place operation without a problem but I get "Access violation reading location" errors when I try to use the "in-place" Copy version.

I have a 1504x1504 byte image and I am trying to add a (16 pixel) border around in order to run the Median Filter function on the image. My confusion is what to set the "srcDstStep" argument to? I tried 1504 and 1536. I am not sure where my error is.

Can I copy the whole image using the "in-place" operation and add the needed border to it? Then I would not need to create a copy of the image on which I perform the median filtering.

Function call:
ippiCopyReplicateBorder_8u_C1IR(ippImg,srcDstStep,roi,roi2,height,width);
ippImg = 1504 by 1504 byte image
roi = 1504x1504
roi2 = 1536x1536
height = 16
width = 16

Thanks for your help in advance.







ippiCopyReplicateBorder_8u_C1IR(ippImg+stepBytes*10,500,roi4,roi3,16,16);
0 포인트
3 응답
Vladimir_Dudnik
651 조회수

Hello,

in case of in-place operations, your source image should be located inside your destination image. It means you allocate extra memory, taking into account border size, then somehow you place your data inside that bigger image (you point pSrc to the first pixel of your inner image). The line step is step in your outer image. The function will just set border pixels into specified value, no image copy operation is needed in that case.

Regards,
Vladimir

0 포인트
losh96
초급자
651 조회수

Vladimir,

Thanks for the clarification. I guess for my filtering applicationthe in-place operation is not necessary since itadds extra steps to get the same final point (since the "not in-place" Copy operation creates the wanted image with the border in function call step).

Thanks for your time,

Petrovic

0 포인트
Vladimir_Dudnik
651 조회수

It is up to you to decide what is better fits your needs. Just note from my side is that with in-place operations you use less memory, so more chances to keep everything in cache (at least L2 in case of your big images)

Vladimir

0 포인트
응답