[FFmpeg-trac] #10428(documentation:new): HSV filters are not actually doing HSV
FFmpeg
trac at avcodec.org
Tue Jun 27 18:28:07 EEST 2023
#10428: HSV filters are not actually doing HSV
-------------------------------------+-------------------------------------
Reporter: Mingye Wang | Owner: (none)
Type: defect | Status: new
Priority: minor | Component:
| documentation
Version: git-master | Resolution:
Keywords: terminology | Blocked By:
colorspace |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Description changed by Mingye Wang:
Old description:
> Summary of the bug: The `hsvhold` and `hsvkey` filters claim to be doing
> HSV, but a quick examination of the source code `do_hsvkey_pixel()`
> reveals that they do not actually use the famous
> [https://en.wikipedia.org/wiki/HSL_and_HSV#Basic_principle hexcone
> geometry] based on RGB, but instead piggybacks on YCC. Some clarification
> is needed.
>
> How to reproduce: Navigate to https://ffmpeg.org/ffmpeg-
> filters.html#hsvhold.
>
> (Not using the real HSV is actually a good thing. At least this "V" we
> use is based on video luma, making it a much better representation of how
> bright something looks like than the real thing that weighs RGB equally.
> However, people could have incorrect expectations about what "hsv" value
> their key color is.)
>
> Oh and also every filter that deals with hue works on YCC, because of
> course, that's what's in the video stream! A disclaimer in `filters.texi`
> should minimize the number of files to change.
New description:
Summary of the bug: The `hsvhold` and `hsvkey` filters claim to be doing
HSV, but a quick examination of the source code `do_hsvkey_pixel()`
reveals that they do not actually use the famous
[https://en.wikipedia.org/wiki/HSL_and_HSV#Basic_principle hexcone
geometry] based on RGB, but instead piggybacks on YCC. Some clarification
is needed.
How to reproduce: Navigate to https://ffmpeg.org/ffmpeg-
filters.html#hsvhold.
(Not using the real HSV is actually a good thing. At least this "V" we use
is based on video luma, making it a much better representation of how
bright something looks like than the real thing that weighs RGB equally.
However, people could have incorrect expectations about what "hsv" value
their key color is.)
This also applies to filters like `hue` and `huesaturation` which does the
rotation in polarized YCC space. A disclaimer in `filters.texi` should
minimize the number of files to change.
Funny enough, there really isn't a name applied to this polar YCC / "Y
with UV in polar coordinates" thing. Papers and patents has used this idea
since the time of color TV vectorscopes, but nobody has bothered to name
it.
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10428#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list