[Cin] ChomaKey's old bug

Igor Vladimirsky sitelve at gmail.com
Sun Apr 7 06:59:51 CEST 2024


сб, 6 апр. 2024 г. в 21:59, Phyllis Smith via Cin <
cin at lists.cinelerra-gg.org>:

> Our ChromaKey is broken as demoed in previous emails with
> GG-BLUR.tar.bz2.  I was trying to incorporate some changes in the version 8
> (in GitHub) of HV but failed to just get it to work.  But hopefully Andrew
> will figure it out.
>

Hi all,

I have written a new article about Chroma Key HSV
https://linuxvideoediting.blogspot.com/2024/04/chroma-key-hsv-cinelerra.html

The article consists of two parts. In the first part I describe what I
already showed in the screencast
https://www.youtube.com/watch?v=QATi9J6Q8uw

I added a small excursion into the history of the plugin and a few
screenshots.
Read this msg from Jerome (2006)
Quote:

*"I saw this (Avid's new chroma keyer): and I told myself that it would be
cool to have a similar plugin for Cinelerra.So I completely modified the
chromakey plugin."*
--------
As you see, Jerome was trying to replicate the Avid's new chroma keyer
(SpectraMatte).
https://resources.avid.com/SupportFiles/attach/Symphony_Effects_and_CC_Guide_v5.5.pdf
 (pages:  203 - 212,   691 - 703)  but the problem seems to be harder than
he thought.

The current ChromaKeyHSV (in CV*/GG and [HV_before-02.2024] ) is doing
whatever Jerome Cornet had.
However, the original Avid algorithm is a lot more complex & might have
been marketing.

ChromaKey HSV in HV_before-02.2024 (before upgrading) is Jerome's version.
The current implementation of ChromaKeyHSV in Cinelerra-HV_after-02.2024 is
most of the SpectraMatte algorithm.
I describe it in the second part of the article. It contains many original
screenshots.

If you delve into the operation of the 'Saturation Offset' parameter, the
question arises: "What is the difference between it and 'Min Saturation'?"
If you watched the screencast, you saw that 'Saturation Offset' only takes
effect if 'Min Saturation' is > 0. Both set the minimum. saturation level,
but S.O. cannot set a level lower than that specified using M.S. I.e. in
conjunction with S.O.,  M.S. may act as a limiter. That's all?

In theory, the purpose of the parameter is to shift the keying sector along
the line of increasing saturation.
However, it appears that either Jerome did not complete the parameter, or
the parameter is broken.
You can "squeeze" the following out of it: set 'In Slope' and 'Out Slope',
then turn up 'Saturation Min' to maximum. And let's increase 'Sat.Offset' a
little as in the screenshot
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR-BA3Khw0mq2b8w868lS3kBYdHFe95oZFQICDqqTvu5VpIhyphenhyphen_q5YT53gsxLzpoPPUW7adooTO51Pm2rsupesECI6fBVHKWq0WcQQFj7_ywquTTtNg9hJ0bu87wpNTlnF0g0j4LXXClU9zqKMPS_sACXztnbOpVSlQC0sQym1pufIFyeLqm-EFDIbLX57v/s16000/sat-offset.png

 I.e. its current capabilities allow it to do something similar to an
offset. But all this looks unconvincing.

I looked at how the parameter works in other forks (cin-cv/cve/gg) - the
behavior was/is the same everywhere.
In addition, I encountered the fact that 'Spill Threshold' did not work
properly in Cin-HV__before-02.2024  and Cin-GG (it was throwing artifacts).
I recorded a screencast and sent it to Adam. I attached to the letter the
collected information on the plugin (who made it, when, goals) and links to
the official SpectraMatte documentation.
A few days later, Adam made a number of bugfixes and innovations and wrote
an algorithm for the plugin similar to the SM algorithm.
I quote Adam's comment in the code: "The current implementation is most of
the SpectraMatte algorithm.".
'Saturation Offset' was first removed (with a  verdict 'confused'  and a
transparent hint to ask Jerome himself what he wanted to tell the world
with this parameter), and later was resurrected again, but in a new quality
https://drive.google.com/file/d/1ECMFIDBsditblrmmV2pISAGCLM_xp5oi/view?usp=sharing
(I made this screencast during testing).

Everything else in the article is a technical part and it seems that the
google translator translates it into English quite well.

About Cin-GG
This screencast/screenshot shows the problem with 'Spill Threshold'
 (select 720-quality in player's settings)
https://drive.google.com/file/d/13saceEUhBpNT9fkzRQhgUFrfr-f9o60l/view?usp=sharing
https://drive.google.com/file/d/1WPTFC6qF8kfF_dDva25o7cEM0j2lKo4x/view?usp=sharing

XML for testing. Created in CinGG-20240229-x86_64-older-distros.AppImage
https://drive.google.com/file/d/1zRFIgx2yJ6lkbeNNrazYj93yv79JIZBk/view?usp=sharing

This screencast (Jerome's version in CV) shows how the parameter should
work.
https://drive.google.com/file/d/1HvdDyO0jqe2yY4H2VbkXqnylotnXmhnK/view?usp=sharing

===========
What do I recommend to understand what's going on with ChKHSV in Cin-HV
(GG)?
Go to the Source_code repo
https://github.com/heroineworshiper/hvirtual/commits/master/?after=43fd35a6162b7af24e8f368fe8d6344be7959701+34

This is the 1-st commit for CK-HSV-fixing (after my report)
https://github.com/heroineworshiper/hvirtual/commit/739bb752739d177fbeb870f3b81058c48792a19d
chromakey HSV fixes. Color swatch generator

The 2-nd commit is
https://github.com/heroineworshiper/hvirtual/commit/c297ff15f3a2a86d6905c9b2194e5b3adacf7027
It removes confusing parameter (Saturation Offset). Makes YUV fix (spill
threshold creates artifacts in YUV)
+ This commit removes  'Saturation Offset' from GUI.
-----
The next commits implement AVID's algorithm
-------
To get the build (from Adam's binary repo !) that contains the changes for
fixing Jerome's version in HV, use
wget
https://github.com/heroineworshiper/hvirtual_bin/archive/adfebed3e473adc416b53b60fdb03b64f1ba353f.zip
The binary repo was created by Adam after my request.

The next buld in the binary repo contains AVID's algorithm.
----------------------------------

IgorV
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240407/966377af/attachment.htm>


More information about the Cin mailing list