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

Howto get pointer of ROI

simbalee
Beginner
197 Views
The method of calculating pointer of ROI is given on pp.2-24 of manual with a Document Number A70805-023US as following:
-----------------------------------------------------------------------
pSrc = pSrcImg + 3*(srcImgSize.width * srcRoiOffset.y + srcRoiOffset.x),
-----------------------------------------------------------------------

I am not quite sure if it is correct.
See, considering step size of the SrcImg nad package of each pixel of the SrcImg, in case that the pixel is packed as
[R G B][R G B]......
Then the pointer should be
pSrc = pSrcImg + StepSizeOfSrcImg* srcRoiOffset.y + 3 * srcRoiOffset.x,
Here the StepSizeofSrcImg not necessarily equal with SrcImgSize.width * 3.
Is my understanding right?

Otherwise if the each channel of the source image is packed seperately as [ R R R R....] [G G G ...] [B B B ... ]
Then the calculation could be much more complicated.



0 Kudos
1 Reply
Vladimir_Dudnik
Employee
197 Views
Hello,

yes, your understanding is correct. The sample code in documentation did not take into account that padding may appear at the end of image row. Thanks for pointing to this.

Regards,
Vladimir
0 Kudos
Reply