Skip to content

Instantly share code, notes, and snippets.

View chunibyo-wly's full-sized avatar
🏠
Working from home

Longyong Wu chunibyo-wly

🏠
Working from home
View GitHub Profile
@chunibyo-wly
chunibyo-wly / getDepthData.m
Created March 2, 2021 07:46
get depth data
CVPixelBufferLockBaseAddress(pixelBuffer, kCVPixelBufferLock_ReadOnly);
const uint8_t* baseAddress = (const uint8_t*)CVPixelBufferGetBaseAddress(pixelBuffer);
for (size_t y = 0; y < height; ++y) {
const __fp16* data = (const __fp16*)(baseAddress + y * stride);
for (size_t x = 0; x < width; ++x, ++data) {
__fp16 depth = *data;
if (!isnan(depth) && depth > minDepth) {
{"version":1,"resource":"file:///Users/chunibyo/01_project/07_latex/04%20Bachelor%27s%20thesis%20-%20no%20cite/sections/section4.tex","entries":[{"id":"LWql.tex","source":"undoRedo.source","timestamp":1652076675114},{"id":"MsgN.tex","timestamp":1652076759270},{"id":"s9Uf.tex","timestamp":1652076776773},{"id":"KxDf.tex","timestamp":1652076798761}]}