Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ippiCopy_ problem with ROI

photo_tom
Beginner
540 Views
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
Ying_H_Intel
Employee
540 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
Reply