- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
コピーされたリンク
1 返信
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
