[FFmpeg-user] absolute difference

Paul B Mahol onemda at gmail.com
Fri Mar 18 10:40:05 EET 2022


On Fri, Mar 18, 2022 at 12:25 AM Michael Koch <astroelectronic at t-online.de>
wrote:

> Question 1:
> I have two streams with RGB24 pixel formats.
> Is it possible to do the following calculation pixel-wise and write the
> result to a grayscale stream?
> output = abs(R1-R2) + abs(G1-G2) + abs(B1-B2)
>
> Question 2:
> Three streams are given:
> [a] A static background image with no person in front of it.
> [b] Exactly the same background with a person in front of it. The person
> does move, but the background doesn't move.
> [c] A new background, for example an image.
>
> I want to replace the background from stream [b] by background [c].
> If the absolute difference between [a] and [b] is larger than a
> threshold, then pick [b], otherwise pick [c].
>
> I did already play with maskedthreshold and threshold filters, but
> didn't yet find a good solution for this problem.
>

http://oioiiooixiii.blogspot.com/2016/09/ffmpeg-extract-foreground-moving.html


>
> Michael
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list