- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am new to IPP libraries and I'd like to concatenate 4 images to get one bigger one. From 4 images of size 256*256, I'd like to make one of size 512*512.
How is it possible? I guess that playing with ROI could be possible but I can't figure out how. I had a look at Set and Copy functions but Set only works for constants values, and Copy only for source and destination images of the same size if I understand it well.
Thanks for you help,
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Thomas.
Welcome to IPP!
The most of IPP image processing functions process images inside rectangular region of interest "roiSize" using steps "srcStep/dstStep" inside input and output images between lines.
According with API ippiCopy_8u_C1R( const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep,IppiSize roiSize ) the pseudo code will be
roiSize.width = 256; roiSize.height = 256;
srcStep= 256;
dstStep = 512;
ippiCopy_8u_C1R( pSrc0, srcStep, pDst, dstStep, roiSize ); // copy left-up image
ippiCopy_8u_C1R( pSrc1, srcStep, pDst+roiSize.width, dstStep, roiSize );//copy right-up image
ippiCopy_8u_C1R( pSrc2, srcStep, pDst+dstStep*roiSize.height, dstStep, roiSize ); //copy left-down image
ippiCopy_8u_C1R( pSrc3, srcStep, pDst+dstStep*roiSize.height+roiSize.width, dstStep, roiSize ); // copy right-down image
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Thomas.
Welcome to IPP!
The most of IPP image processing functions process images inside rectangular region of interest "roiSize" using steps "srcStep/dstStep" inside input and output images between lines.
According with API ippiCopy_8u_C1R( const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep,IppiSize roiSize ) the pseudo code will be
roiSize.width = 256; roiSize.height = 256;
srcStep= 256;
dstStep = 512;
ippiCopy_8u_C1R( pSrc0, srcStep, pDst, dstStep, roiSize ); // copy left-up image
ippiCopy_8u_C1R( pSrc1, srcStep, pDst+roiSize.width, dstStep, roiSize );//copy right-up image
ippiCopy_8u_C1R( pSrc2, srcStep, pDst+dstStep*roiSize.height, dstStep, roiSize ); //copy left-down image
ippiCopy_8u_C1R( pSrc3, srcStep, pDst+dstStep*roiSize.height+roiSize.width, dstStep, roiSize ); // copy right-down image
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would that be faster than using e.g. memmove, memcpy or vm_copy ?
Regards,
Adriaan van Os
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrey,
Thanks for your quick reply. I was missing the real meaning of the dstStep parameter, indeed.
Using your code, I fixed my problem. However as I am working with Ipp32f type, it's not dstStep in bytes which has to be used but in terms of pixels. It can be confusing to call it dstStep as in the documentation this variable means the step in unit of bytes.
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adriaan van Os wrote:Would that be faster than using e.g. memmove, memcpy or vm_copy ?
I hope yes because ippiCopy uses ippsCopy that is optimized.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I hope yes because ippiCopy uses ippsCopy that is optimized.
Interesting. I looked at the source code of glibc's memcpy c.s. They don't seem to be vectorized. Unless, maybe, the compiler builtin_memcpy is used. But I can't find that either gcc or llvm vectorizes them.
The Intel compiler has intel_fast_memcpy c.s. https://software.intel.com/en-us/articles/memcpy-memset-optimization-and-control.
That suggests that it would pay to replace memcpy c.s. with ippsCopy/ippsMove for n > .....
Regards,
Adriaan van Os
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page