Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
8 Views

ippiCopy_ problem with ROI

This is a newbie issue with ipp in understanding ROI.

What I'm trying to do is to is to "paint" using ippiCopy a small image into a much larger image to build up a composite image. My problem is that I don't understand how to configure the region of interest (ROI) for the destination. The code I'm using is below. I'm trying to write newImage into location target.x, target.y in to large image named buffer.
[cpp]    IppiSize roi;
    roi.height = newImage->height();
    roi.width = newImage->width();
    IppStatus resultCopy = ippiCopy_8u_C4R(newImage->scanLine(0),
           newImage->width()*4,     buffer->scanLine(target.y), buffer->width()*4, roi);[/cpp]

My problem is that I don't see how to configure the starting X coordinate in the target image.
0 Kudos
1 Reply
Highlighted
Employee
8 Views


Hello,

You can configure the X coordinate by shift the target image's starting position.
For example,
assume the buffer->scanLine(target.y)is pointing to Buffer[0] and the poniter "buffer->scanLine(target.y)+target.x*4" points to Buffer.

Then you can enterbuffer->scanLine(target.y)+target.x*4 directly as pDst parameter.
Or any other way, whichcan make sure that pDst pointers to the starts position ofdestination ROI Buffer.

There isa picture in IPP manual ippiman.pdf, Figure 2-1 Image, ROI, and Offsets. You may refer it.

Regards,
Ying
0 Kudos