- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
-----------------------------------------------------------------------
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page