# How to repeatedly add two images with different size?

## How to repeatedly add two images with different size?

Dear all,I am going to add one small image data to another big one, but I need to repeat copying the small one to fill out all the big image region. This is similar to copying one small matrix data repeatedly to one bigger matrix in a loop in c++, etc. Is there any good way to do this? I was thinking about changing the starting point and region of interest each time while using "add" in ipp, which sounds also like a loop. But I failed. Many thanks in advance. Best regards,Ederman

6 帖子 / 0 全新

Is it possible to attach a snippet of the code that is failing?

Hi Ederman,

It should be right that to chang the starting point and region of interest each time while using "add or Copy" in ipp , to copy a small image to another big image.

For example,
big image

1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
the (0, 0) point : pSrcDst

small image
1 2
3 4
the starting point: pSrc
roiSize = {2, 2};

You may change pSrcDst to pSrcDst to pSrcDst+2 to piont (0, 2) , use

IppStatus ippiAdd_(const Ipp* pSrc, int srcStep, Ipp* pSrcDst, int srcDstStep, IppiSize roiSize);
(please note : as the Regin of interest is unchanged in the case, you don't need change it)

3 4
8 9
and
1 2
3 4

if move pSrcDst to pSrcDst+3, then add
4 5
9 10
and
1 2
3 4.

Best Regards,
Ying

Hi Ying,

3
4
8 9
and
1
2
3
4

if move pSrcDst to pSrcDst+3, then add
4 5
9 10
and
1 2
3 4

It looks like there is a small error in the description of the solution. It adds values {2,4} to {4,9} and then again {1,3} to {4,9}.
I underlined all these values.

Best regards,
Sergey

EDerman 写道：

Dear all,

I am going to add one small image data to another big one, but I need to repeat copying the small one to fill out all the big image region. This is similar to copying one small matrix data repeatedly to one bigger matrix in a loop in c++, etc. Is there any good way to do this?

I was thinking about changing the starting point and region of interest each time while using "add" in ipp, which sounds also like a loop. But I failed.

Best regards,
Ederman

Hi Ederman,
>>...
>>... This is similar to copying one small matrix data repeatedly to one bigger matrix in a loop in c++, etc. Is there any good way to do this? I was thinking about changing the
>>starting point and region of interest each time while using "add" in ipp, which sounds also like a loop. But I failed...
>>...