[FFmpeg-user] how to invert a colormap implemented with filter_complex
Michael Koch
astroelectronic at t-online.de
Thu Jun 22 20:25:00 EEST 2023
Am 22.06.2023 um 19:12 schrieb Audette, Michel A.:
> Dear members of the ffmpeg community,
>
> I'm trying to visualize the deep neural network-based depth estimation result based on a video input, using code available on GitHub: https://github.com/tinghuiz/SfMLearner . There is a demo on that page whose visualization is exactly right: a purple-to-yellow colormap that corresponds to plasma. e.g.:
>
> [cid:d60c3a17-abd3-469a-978f-90199c4baf1f]
>
> I believe that the implementation is along the lines of the following:
>
> -filter_complex "pseudocolor=p=plasma"
>
> However, my current result has the proximate objects mapped to dark purple and the furthest objects appearing in yellow, which is counterintuitive from a saliency standpoint.
>
> [cid:ce889fa7-fb3e-49d8-878c-bf66728a98c5]
> It is the opposite of what I would like to achieve.
>
> How can I invert this mapping, while retaining that particular plasma colormap?
>
> If I try to use -lutrgb="r=negval:g=negval:b=negval", right after the -filter_complex command, I get "unrecognized option".
Please show your whole command line. Something must be wrong.
It might be easier to do that with the negate filter:
-filter_complex "negate,pseudocolor=p=plasma"
Michael
More information about the ffmpeg-user
mailing list