How to repeatedly add two images with different size?

How to repeatedly add two images with different size?

ederman's picture

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 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Chuck De Sylva (Intel)'s picture

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

Ying H (Intel)'s picture

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)

to add
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

Sergey Kostrov's picture
Hi Ying,

Quoting Ying H (Intel) ...to add
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

's picture

Quote:

EDerman wrote:

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 

Sergey Kostrov's picture

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...
>>...
That question was already asked: Could you upload your test-case? It is impossible to understand where your error is without seeing the test-case.
Best regards,
Sergey

Login to leave a comment.