Replies: 1 comment 1 reply
-
The data in the ROI are not fully sequential, each row is separated by a "rowSpan" (original image row size in bytes). It looks like Span2D may help: Based on the documentaion I would try to use this constructor: You will need to provide the correct "pitch" parameter, for gray scale single channel image this should be the same as the rowSpan. |
Beta Was this translation helpful? Give feedback.
-
Currently i have this:
It works fine for pixel manipulation, but when executing this on a ROI mat, set pixels below first row will continue to sequential set pixels on original Mat. That is understandable, the DataPointer points to first pixel on the ROI and then any pixel > than first row will be set outside ROI, here an example, where blue square is ROI and noise pixels are set via this span method:
It works as should be, since ROI mat is a submatrix and not a new matrix with new data and pointers. So i understand that.
My question: Is there any easy way to use memory access to read/set pixels correctly on ROI mat using sequential indexing? (Without jumps)
Beta Was this translation helpful? Give feedback.
All reactions