News from Cam16 - A processing challenge is coming up

@paulmatth

Paul
I try on other images, with your pp3, and get the same problem. Thanks for the NEF

I think I found the culprit - the Hz(hz) curve, a phenomenon increased by “Laplacian threshold” in mask. To be checked.

We found - with Wayne @Wayne_Sutton and Jacques @Jade_NL 2 years ago , that JzCzHz behaved badly, when we activated the corrections with Hz, particularly in the blues. I think there is a fault in the matrix / or in the PQ tools. This confirms it… But for me (I am not a researcher) no solution.

Probably, I will remove H(H) and / or “Laplacian threshold”. I will re-check if there are other anomalies, your search for settings is a mine for finding anomalies.

Thank you again :grinning:

Jacques

I finally deleted “Laplacian threshold”, it is the one that causes the most disturbances (also in Cam16). I’m not saying everything else works perfectly. :wink:

New executables:
https://github.com/Beep6581/RawTherapee/releases/tag/pre-dev-github-actions

For the record, when researchers imagined Ciecam97 (published in 1997), it was full of defects (only in Matlab).
When Ciecam02 came out, there were fewer. I ported to RT in 2012 (I used the spreadsheet made by the researchers to have the implementation of the “formulas”) , one of the only “non-research” versions, usable by an informed user.
But there too a lot of artifacts, bad behavior… This is not why: a) we should not be interested in it - taking into account the physiological aspects is an important dream; b) that it should be ignored because…bad behavior in some cases.
In 2016, with a version released and modified in 2022, Cam16 is finally ready… 25 years old. The adaptation of the code was relatively minimal, now it behaves well, even very well in the majority of cases. It’s something other than mathematics alone.

I think that Jzczhz is potentially very efficient, being both (at least in theory SDR and HDR compatible).

  • it’s a challenge for me, to try to understand what the HDR concept is and its practical translation, and to translate it concretely in a software.
  • this development also allows people (perhaps rare) who are interested in new developments to see a possible application (perhaps not very well implemented).

Two documents from which I drew for Jz
https://inria.hal.science/hal-02131890/document
https://theses.hal.science/tel-02378332/document

An excerpt that shows the gap between human vision and the capabilities of SDR/HDR monitors. These 3 HDR are very, very expensives…

Thank you again Paul

Jacques

1 Like

Following Paul’s comments, I’ve made a few improvements to simplify the GUI of “lacam16n”, in particular the part concerning masks.
In “LA”, masks are not available in “Basic”, with limited possibilities in “Standard” and with the maximum in “Advanced”.
The fact that I classified “JzCzHz” as “advanced” made it compulsory, with the global GUI, for the masks associated with Jz to always be “maximum”, thus making them difficult to read and adding to the complexity.

I’ve added an “Enable all mask tools” checkbutton, which only appears in “advanced” mode for both Cam16 and JzczHz. By default, it’s disabled, offering only the simple masks menu. This simplifies the form, but makes no difference to the algorithms. I’m by no means a GUI specialist…

As a reminder, the masks are of the “jdc” type…I added them because I was asked to. In most cases, you should be able to do without them. Nevertheless, for the enthusiasts, they will be satisfied. Nevertheless, these masks are “incomplete” because I don’t know how to use the GUI to draw curves, polygons… But the problem with LA to delimit the action (polygons, etc.) is not limited to the GUI - the problem of adapting the algorithm is at least as important.

Executables
https://github.com/Beep6581/RawTherapee/releases/tag/pre-dev-github-actions

JzCzHz
I’ll come back to its complexity… not so much.
In fact, there is a “simple” part (if we can use this formula), which is the use of the basics of XYZ<=>Jzazbz conversion. This can be found in many reports and, barring errors, poses no problems.

Where difficulties arise is when you want to go from a theoretical tool, to something useful for photography. Adjusting brightness (not to be confused with lightness), saturation and contrast. The problem is more complex than it seems.

Several parameters work against the developer:

  • instead of having bounded values (like RGB, XYZ, Lab, etc.), whether in the range [0…1], or [0…65535], as with Cam16 in Jz, Brightness takes into account absolute luminance, which is obviously different between a scene on a winter’s morning and one at noon in the tropics… Even if the Camera “compensates”… Our eye, our brain sees that it’s not the same. Brigthness is not stubborn…
  • Jzazbz (or JzCzHz, which is basically the same thing) takes into account image dynamics (whether it’s called Scene or Source is secondary) through a PQ (Perceptual Quantizer) function…and Absolute luminance. This may seem obvious, but in the long run monitor performance, as shown in the previous graph, will also have to be taken into account. This means that the data “converted” by Jz are not in the range [0…1] for “Jz” or [-0.5…0.5] for “az” and “bz”, but at values that are often considerably lower (notably due to the influence of PQ), e.g. [0.000001 - 0.22]. As a result, all the usual sliders and curves are “lost” and respond poorly or not at all.

So I “got around” the obstacle - without changing the algorithm - in such a way that every slider, curves, or other tool is in the right interval [0…1], etc.
I’ve added some personal interpretations in “Scene conditions” to take account of PQ and absolute luminance (Absolute luminance, PQ -peak luminance, Jz remapping…) as well as some “tinkering” to make it usable and realistic. Perhaps I’m mistaken?

In order to be able to better evaluate Jz, and not remain at the reference level (output of conversion matrices), I’ve added some functionalities to the usual sliders - found in RT:

  • Log encoding Jz, Sigmoid Jz, which must work with the above constraints (unbounded data…)
  • Curves: Jz(Jz), Cz(Cz), Cz(Jz), Jz(Hz), Hz(Hz), Cz(Hz)… with Hz some (rare) bad behavior.
  • Shadows/Highlights (Jz)
  • Wavelets Jz: a) Local contrast - with attenuation response and choice of decomposition level range; b) Clarity/Sharp mask/blend & Soften images.

Of course, the masks, which are the same as those of the other modules, are located “before Jz”… hence the probable negative impact of the Laplacian on the image, and “Recovery based on luminance mask”, which is located “after Jz”.

It is possible, without major difficulty, to add features that are present elsewhere in RT - those in Lab mode, almost all of LA - notably the Wavelet part - Edges sharpness - which both softens the background of images and hardens contours - here no Laplacian, but an algorithm taking into account the Sobel-Canny transform, and “Attenuation response”).

Thanks to Paul for testing this module, which is “less complex” than you might think…

Jacques

Hello Jacques,

I have been testing this branch.
There is one of my images that always made it crash.
It is quite simple to always reproduce: it occurs wheneve you select temperature correlation (white balance options)

Other “similar” images work fine with these same steps (temperature correlation options)
The stable branch (5.10) is fine: no crash with this same image by using the same steps (wb).

Here is the Raw in case you want to test it in your computer (on Dropbox: NO password or registration needed to get it):

Here is a short video with all my steps (Windows 11).

I’m struggling with Dropbox…can’t download.

What must I do ?

But I try to understand ? The problem is with “Temperature correlation” ? or Cam16 ?

Jacques

OK, I have download…

Hello Jacques,

It occurs with temperature correlation.
The same steps (same raw) do not crash the stable branch (5.10)

There are also a few warning when you launch it but I suppose they are not related with the crash

I just test with “Temperature correlation”
Then Cam16 or JzCzHz

I closed RT, re-open, no problem…

No problem for me, to confirm

Jacques

Very strange indeed: as usual with softwares :grinning: :grinning:

I have just tested, again, many Raws imags (D850) and they work fine with your branch and Temperature correlation applied.
However, as soon as I apply the T. correlation to this specific Raw file this branch crashes…

Anyway, thanks for testing my image!

Yes there are warning since I merge with dev, PR #6830

The merge went without problems, without (one change to do in localabtools2) alert messages, all others files merge, but now (and only on this branch) the messages
Failed to load icon “circle-white-small.png” for size 16px
Failed to load icon “rawtherapee-logo-16.png” for size 16px
Failed to load icon “circle-black-small.png” for size 16px

@Pandagrapher @Lawrence37

What is going on ? Did I do the wrong thing? What to do ?

Thank you

Jacques

Hello Jacques,

Here is the output on the power shell:
(rawtherapee.exe:11036): Gtk-WARNING **: 18:39:31.464: Failed to set text from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity ? escape ampersand as &
Assertion failed: (index >= 0) && (std::size_t(index) < rows.size()), file D:/a/RawTherapee/RawTherapee/rtengine/array2D.h, line 187
Assertion

I also have this message which appears from time to time since this merge… I looked at the tooltips… and found nothing more on this branch - compare with kdiff3.

Curious

Aside from this crash I have been testing the local editing tools and I find them extremely useful. Just tried to change my fungi from white to pink and it is super fast to achieve my results.

Hi Jacques,

When you want to use an icon, you now need to only indicate its name without the file extension. For instance, use circle-white-small instead of circle-white-small.png.

For the icon rawtherapee-logo-16, use circle-multicolor-small instead that has been created to avoid the use of RT app icon.

Pierre

@Pandagrapher

Salut Pierre, content de te revoir.

I clearly saw this difference, but all the files remained without the “.png” extension (after the merge), including all those that I did not touch…

Do I have to replace everything?

But it’s curious…

Merci

Jacques

@Pandagrapher

I think now it is solved… 3 files still had the .png suffix. But the I replace “rawtherapee-logo-16” by “circle-yellow-small”, because even with no .png, I still had the alert message (no or very little importance).

Thank you

Bonne soirée

Jacques

@Silvio_Grosso

I have push a change for the 3 warning … Thanks to @Pandagrapher
Maybe ? does this solve the crash… which I don’t have

Good night.

Jacques

Hello Jacques,

Thanks a lot indeed for all your amazing work all these past years!

3 Likes

@Silvio_Grosso

After much research I think I found what was causing this problem (I hope)
In fact, these are small things, but in software, small things can do big damage.

The first is that I had the .png extension in 3 locations, whereas since a recent ‘commit’ this was harmful (in branch lacam16n)

The second is the message with “& amp;”

  1. I looked at the writing of the “language” file and added “& amp;” has all the tooltips where it was missing

  2. I noticed that it was also present in “Dev” as soon as we touched the “Color tab”…After research and probably an evolution of the GTK, in the “Wb auto” menu there was a message “Automatic & Refinement” (who had curiously disappeared for several weeks).
    I replaced the wording of the message with “Automatic ‘& amp;’ Refinement”.

No more warning messages, the general WB menu is now correct.

Maybe, I hope these 2 anomalies now corrected will prevent malfunctions on certain systems.

New executables
https://github.com/Beep6581/RawTherapee/releases/tag/pre-dev-github-actions

Thank you.

Jacques

Hello Jacques,

Thanks a lot!

The new executable works fine: no “strange” messages on start-up.
In addition, no crash whatsoever while testing many Raws images with the White balance: Temperature correlation options

1 Like