hyperion-webos icon indicating copy to clipboard operation
hyperion-webos copied to clipboard

LUT mapping

Open sundermann opened this issue 3 years ago • 7 comments

This PR aims at solving the color accuracy issues seen with the LG capture APIs. Essentially, this is like HyperHDR's HDR tone mapping feature but integrated into hyperion-webos itself. The data format is also the same and as such lut tables from HyperHDR can be used as is. However, opposed to HyperHDR the tone mapping is always active because we are seeing color inaccuraries even on SDR content.

I am providing my LUT file that I calculated using machine learning by showing pregenerated color table images and capturing them. Then the network learned given an input capture color to predict the input color. The predictions were carried out for the full 8-bit color space and saved into a LUT file. The generated LUT is not perfect for many reasons possibly the most prominent one being that multiple input colors match the same captured color. Yet still, without LUT mapping colors are quite off. For instance, solid red captures as [228, 80, 52], green as [110, 255, 100] and blue as [44, 0, 184] which is quite far off the real value.

I am marking this as WIP because I haven't tested configuration reloading.

LUT table

sundermann avatar Oct 03 '22 18:10 sundermann

@sundermann: Do you mind to change the config line to @Informatic's latest start/stop improvement in https://github.com/webosbrew/hyperion-webos/pull/105?

Also wanted to ask if you think it's possible to add lut tables to this git repository. Maybe in root under a new "luts" folder. In this case we could easily ship them in PicCap.

TBSniller avatar Mar 11 '23 22:03 TBSniller

~~Would it break the LUT functionality in HyperHDR, as it also ships a LUT ?~~ Edit: Nevermind, only one LUT correction should be enabled at given time.

Two options:

  1. Make sure users are aware that only one method should be used, not both.
  2. Remove the LUT stuff from HyperHDR entirely?! e.g. Remove LUT table itself + Remove the HTTP calls into HyperHDR RPC API to toggle content mode (SDR/HDR)

tuxuser avatar Mar 11 '23 22:03 tuxuser

@sundermann: Do you mind to change the config line to @Informatic's latest start/stop improvement in #105?

Rebase?

Also wanted to ask if you think it's possible to add lut tables to this git repository. Maybe in root under a new "luts" folder. In this case we could easily ship them in PicCap.

One LUT table is roughly 50mb. I don't think we want to ship different LUT tables by default. Also right now I have only calculated a decent LUT table for o22.

Edit: Nevermind, only one LUT correction should be enabled at given time.

No, multiple LUTs can work together. Consider the hyperion-webos more like a LUT that corrects for the device specific tone mapping errors. After those have been corrected HyperHDR can apply its own LUT table for HDR content.

sundermann avatar Mar 12 '23 01:03 sundermann

Rebase?

Rebased

One LUT table is roughly 50mb. I don't think we want to ship different LUT tables by default. Also right now I have only calculated a decent LUT table for o22.

In that case, just have the functionality ready for the advanced users that are able to create their own LUT, for their respective model, and edit the config.json by hand. Do not ship anything additional within piccap.

No, multiple LUTs can work together. Consider the hyperion-webos more like a LUT that corrects for the device specific tone mapping errors. After those have been corrected HyperHDR can apply its own LUT table for HDR content.

Thanks for clearing that up.

tuxuser avatar Mar 12 '23 01:03 tuxuser

Do we need anything else here to merge this?

sundermann avatar Oct 22 '23 15:10 sundermann

Hi @sundermann, the LUT seems to be offline, would it be possible to re-upload it? I'd love to give this branch a try 👍

Do I understand correctly, that this entirely removes the need for using a LUT with SDR content, but a LUT will still be needed in HyperHDR to map HDR to SDR?

I built a version of hyperion-webos that uses HyperHDRs Json api to allow using different LUTs for sdr and hdr content, and I'm wondering if it's worth to create a PR, if this one already removes the need for it :)

Edit: Something worth noting is that @TBSniller noticed that the captured images are dependent on the chosen image mode on the TV. I suppose as long the creators & the users settings are not completely different, the results with a general LUT such as yours, should still be better than without one at all

Dak0r avatar Oct 30 '23 10:10 Dak0r

@sundermann Can you please reupload the LUT you generated? The links is dead and I would like to give it a try

Ah wait, I was assuming the LUT was generated for Piccap, which is probably not correct.

jclsn avatar Feb 11 '24 12:02 jclsn