Created
June 22, 2022 08:47
-
-
Save adujardin/bbc32f993e5a0f15e034c426bed8873e to your computer and use it in GitHub Desktop.
Efficient CPU iterations over sl::Mat 32F and 8UC4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int y = 0; y < height; y++) { | |
// line pointer | |
float * ptr_disp = (float *) (disp.getPtr<uchar>(sl::MEM::CPU) + y * disp.getStepBytes(sl::MEM::CPU)); | |
uchar4* ptr_image = (uchar4*) (img.getPtr<uchar>(sl::MEM::CPU) + y * img.getStepBytes(sl::MEM::CPU)); | |
for (int x = 0; x < width; x++) { | |
float px_disp = ptr_disp[x]; | |
uchar4 px = ptr_image[x]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment