Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

C/C++ • Re: C++ app using libcamera for motion detection

$
0
0
More specifically, the image is divided into 3 horizontal blocks or bands. The top 271 pixels look normal but then the middle part is shifted left by 128 pixels and is also 271 pixels high. Then the bottom is shifted by a further 128 pixels. It is 538 pixels high, for a total of 1080 pixels.

I've tried different pixels formats for both libcamera and the OpenCV writer. formats::YUV420 (YU12) for libcamera and Y800 for the writer, since I only care about the Y channel. Neither change made any difference.

It must have something to do with the stride, that the buffer has extra padding after each row or something. But streamConfig.stride returns 1920 so I don't know what else to look for. There's good API documentation for both libcamera and OpenCV, but not many tutorials telling how to actually use it.

Statistics: Posted by xtal256 — Mon Nov 03, 2025 12:31 am



Viewing all articles
Browse latest Browse all 8374

Trending Articles