xiufuyolo矿体

This commit is contained in:
sladro 2025-12-26 16:26:27 +08:00
parent 5533969800
commit 5ee7061624

View File

@ -366,13 +366,17 @@ private:
int w = frame->width;
int h = frame->height;
int stride = frame->stride > 0 ? frame->stride : w * 3;
uint8_t* data = frame->data;
PixelFormat fmt = frame->format;
bool supported = (fmt == PixelFormat::RGB || fmt == PixelFormat::BGR || fmt == PixelFormat::NV12);
if (!supported) {
return;
// Calculate correct byte stride based on format
int stride;
if (fmt == PixelFormat::RGB || fmt == PixelFormat::BGR) {
stride = w * 3; // 3 bytes per pixel
} else if (fmt == PixelFormat::NV12 || fmt == PixelFormat::YUV420) {
stride = w; // Y plane stride
} else {
return; // Unsupported format
}
for (const auto& det : frame->det->items) {