Support for LG G4 camera phone

Hi there!

I have a RAW-enabled camera phone, LG G4 (H-815), which outputs DNG files, but RT has some problems with these.
First, it crops the very edges of the DNG as compared to the JPEG, exactly the opposite of what normally happens (however, in this case the JPEG might contain the whole frame without cropping, I’m not sure). I was unable to solve it through camconst.json.

The second problem is the images having abnormal white balance, resulting in the erroneous request of WB range extension (as a DNG from this phone happened to be my first shot of a fully HPS-illuminated scene I deemed worth processing, I thought it’s a general problem :slight_smile: ).

ColorChecker:
https://filebin.net/gyx5wrtud4b87xy0

And the HPS-illuminated scene showing the WB problem (already posted in the WB range topic):
https://filebin.net/ee0nbj3y7icp36bs

1 Like

for the crop in camconst.json change

    "raw_crop": [ 0, 0, -8, 0 ], // full frame 5312x2988, 8 black columns at the left

to

    "raw_crop": [ 0, 0, 0, 0 ], // full frame 5312x2988

You will still have the 4 pixel borders (i.e. frame 5304x2980) which RT cuts by default but save the 8 columns at the right which are cropped currently (I don’t remember the reason I cropped them)

@szgabor could you describe the conditions (light and surroundings) under which you took the ColorChecker shot? Did you take it yourself?

@ilias_giarimis should I add that to the camconst.json we ship or do you want to leave that for your bigger update?

Yes, I took it myself near noon, and according to my notes, it was sunny with almost no clouds. I wore a black cloth to minimize reflections. A grassy slope was about 100m away, but that was the best place I found in realistic distance. Made with a (hopefully) genuine ColorChecker. The profiles created using the software shipped with it aren’t very convincing, though, I had to play a lot with the Lab* tool to get anywhere near the camera-JPEGs.

Just for clarity (I replied in a hurry with many distractions, sorry), the not-that-convincing profiles I mentioned primarily relate to different cameras, but none of them can be considered a good reference, one of them doesn’t even natively support RAW, only with CHDK. I only wanted to say “I made the CC shot I provided according to the recommendations as far as I could, but don’t rely on it too much, it might be good as well as terrible” :slight_smile:

I’m awaiting feedback, is the CC shot OK? Can I do anything else to help?

DCamProf 1.0.5:
https://filebin.net/8233az0syro4mea3/LG_Mobile_LG-H815.dcp

argyll-scanin daylight ----------------------------------------

Input file 'daylight.tif': w=1981, h=1321, d = 3, bpp = 16
Data input file 'data-examples/cc24_ref.cie'
Data output file 'daylight.ti3'
Chart reference file '/usr/share/argyllcms/ref/ColorChecker.cht'
Creating diagnostic tiff file 'daylight-diag.tif'
About to allocate scanrd_ object
Verbosity = 2, flags = 0x62af9
About to read input tiff file and discover groups
adivval = 1.000000
About to calculate edge lines
332 useful edges out of 1798
About to calculate perspective correction
Perspective correction factors = 0.000018 -0.000001 990.500000 1097.498919
About to calculate rotation
Mean angle = 0.552075
Standard deviation = 1.775048
Robust mean angle = 0.657365 from 303 lines
About to calculate feature information
About to read reference feature information
Read of chart reference file succeeded
About to match features
Checking xx
Checking yy
Checking xy
Checking yx
Checking xix
Checking yiy
Checking xiy
Checking yix
Axis matches for each possible orientation:
  0: xx  = 0.409353, yy  = 0.467353, xx.sc  = 0.165176, yy.sc  = 0.165138
 90: xiy = 0.256676, yx  = 0.368380, xiy.sc = 0.820297, yx.sc  = 0.165878
180: xix = 0.414704, yiy = 0.521339, xix.sc = 0.165246, yiy.sc = 0.164803
270: xy  = 0.246901, yix = 0.379994, xy.sc  = 0.820297, yix.sc = 0.165897                                                                                                                                                                                                      
r0 = 0.621135, r90 = 0.090792, r180 = 0.664379, r270 = 0.091647                                                                                                                                                                                                                
There are 2 candidate rotations:                                                                                                                                                                                                                                               
cc = 0.621135, irot = 0.657365, xoff = -6.298060, yoff = -18.183553, xscale = 6.054132, yscale = 6.055547                                                                                                                                                                      
cc = 0.664379, irot = 180.657365, xoff = -2003.673852, yoff = -1355.900507, xscale = 6.051601, yscale = 6.067861                                                                                                                                                               
About to compute match transform for rotation 0.657365 deg.                                                                                                                                                                                                                    
About to setup value scanrdg boxes                                                                                                                                                                                                                                             
About to read raster values                                                                                                                                                                                                                                                    
About to compute expected value correlation                                                                                                                                                                                                                                    
About to compute match transform for rotation 180.657365 deg.                                                                                                                                                                                                                  
About to setup value scanrdg boxes                                                                                                                                                                                                                                             
About to read raster values                                                                                                                                                                                                                                                    
About to compute expected value correlation                                                                                                                                                                                                                                    
Expected value distance values are:                                                                                                                                                                                                                                            
0, rot 0.657365: 2869.072382                                                                                                                                                                                                                                                   
1, rot 180.657365: 3952.923625                                                                                                                                                                                                                                                 
Chosen rotation 0.657365 deg. as best                                                                                                                                                                                                                                          
About to compute final match transform                                                                                                                                                                                                                                         
Improve match                                                                                                                                                                                                                                                                  
About to setup value scanrdg boxes                                                                                                                                                                                                                                             
About to read raster values                                                                                                                                                                                                                                                    
About to write diag file                                                                                                                                                                                                                                                       
Writing output values to file 'daylight.ti3'                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                               
make-profile daylight ----------------------------------------                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                               
Reading target...
Camera G on darkest patch(es) is -5.4% lighter compared to observer Y.
  Y dynamic range is 4.83 stops, G dynamic range is 4.91 stops, difference
  -0.08 stops. A small difference is normal, while a large indicates that there
  is glare.
Generating values for the calibration illuminant D50...
Re-generating target reference XYZ values for illuminant D50...
Warning: auto-selected neutral patch (D02) is not the lightest, as the
  lightest patch is considerably off-white. That is if you later use the target
  for white balancing you should use the indicated patch instead of the
  lightest.
The most neutral patch (D02) differs 1.22 DE from actual neutral,
  transforming target reference XYZ values to match, using CAT02.
Automatic LUT relaxation weights assigned.
Making camera profile...
Finding a camera raw RGB to CIE XYZ matrix for calibration illuminant D50...
Whitest patch in target (D02) differs DE 1.22 from calibration illuminant,
  close enough to calculate whitepoint preservation.
Inverting to get ColorMatrix:
  {
    "ColorMatrix1": [
      [  0.821537, -0.216803, -0.070347 ],
      [ -0.341003,  1.155209,  0.209604 ],
      [ -0.045513,  0.224388,  0.629562 ]
    ]
  }
Matrix patch match average DE 1.38, DE LCh 0.83 0.61 0.64
                    median DE 1.24, DE LCh 0.89 0.38 0.59
                       p90 DE 2.18, DE LCh 1.49 1.58 1.22
                       max DE 2.71, DE LCh 2.34 2.12 2.15
ColorMatrix optimal white balance for target: 0.517612,1,0.700458 (m1.93195,1,1.42764)
Finding a camera raw RGB to CIE XYZ matrix for connection space illuminant D50...
Warning: did not succeeed to match whitest patch, DE 0.00.
  Precision may suffer.
  {
    "LUTMatrix1": [
      [  0.685808,  0.123573,  0.154838 ],
      [  0.305704,  0.649524,  0.044772 ],
      [  0.000103,  0.005555,  0.819543 ]
    ]
  }
LUTMatrix optimal white balance for target: 0.51381,1,0.697375 (m1.94625,1,1.43395)
Matrix patch match average DE 5.22, DE LCh 1.99 4.06 2.89
                    median DE 5.14, DE LCh 1.75 3.89 2.35
                       p90 DE 10.11, DE LCh 3.73 7.97 7.04
                       max DE 11.95, DE LCh 4.05 9.35 7.97
Finding a camera raw RGB to CIE XYZ matrix for connection space illuminant D50...
  Y row limit set to -0.2.
Applying white-balance to get ForwardMatrix:
  {
    "ForwardMatrix1": [
      [  0.690314,  0.171621,  0.102283 ],
      [  0.217973,  0.921435, -0.139408 ],
      [ -0.018356, -0.383098,  1.226655 ]
    ]
  }
ForwardMatrix optimal white balance for target: 0.51381,1,0.69738 (m1.94625,1,1.43394)
Matrix patch match average DE 1.46, DE LCh 0.86 0.65 0.72
                    median DE 1.37, DE LCh 0.72 0.45 0.72
                       p90 DE 2.48, DE LCh 1.73 1.61 1.61
                       max DE 3.36, DE LCh 2.79 1.77 1.99
Making 2.5D chromaticity-addressed lookup table for XYZ correction...
4.17% of the patches was put in a chromaticity group due to nearby neighbor.
  25.00% of the patches was removed due to being nearby the whitepoint.
  Largest chromaticity group contains 2 patches. Patch count reduced from
  24 to 17. Note that patch matching cannot reach 100% when chromaticity
  groups are formed, as the LUT matches the average within a group.
Lightness axis is disabled. Since lightness affects chroma, the LUT chroma
  control points are recalculated to better match the uncorrected lightness.
  A residual error of up to about 0.2 DE is expected.
Relaxing LUT stretch with up to 3.93 DE. Iterating over 17 patches...
  Lightness correction is disabled.
Average DE for the 17 tested patches increased to 1.74 after LUT relax.
  47.06% could do without LUT correction.
Native LUT patch match average DE 1.59, DE LCh 0.80 1.01 0.60
                        median DE 1.36, DE LCh 0.57 0.60 0.60
                           p90 DE 3.28, DE LCh 1.72 2.94 1.35
                           max DE 3.89, DE LCh 2.63 3.69 1.90
5 worst patches for Overall DE:
  B06 RGB 0.301 0.341 0.103 XYZref 0.537 0.477 0.066 XYZcam 0.491 0.440 0.088 sRGB #F7A62B #EBA245 DE 3.89 DE LCh -1.80 -3.17 -1.35 (light strong orange)
  C04 RGB 0.386 0.545 0.162 XYZref 0.663 0.666 0.082 XYZcam 0.645 0.650 0.127 sRGB #FECE20 #FCCC4F DE 3.73 DE LCh -0.54 -3.69 -0.27 (light vivid yellow)
  B05 RGB 0.202 0.436 0.144 XYZref 0.390 0.485 0.099 XYZcam 0.375 0.455 0.121 sRGB #AFC245 #ADBB57 DE 3.28 DE LCh -1.44 -2.94 +0.23 (light strong yellow-green)
  C03 RGB 0.173 0.098 0.051 XYZref 0.242 0.140 0.042 XYZcam 0.259 0.160 0.052 sRGB #C0333A #C34242 DE 2.95 DE LCh +2.63 -1.12 +0.72 (strong red)
  D06 RGB 0.015 0.031 0.022 XYZref 0.034 0.035 0.030 XYZcam 0.029 0.031 0.026 sRGB #343435 #2D3132 DE 2.70 DE LCh -1.17 +1.52 -1.90 (gray 20%)
5 worst patches for Lightness DE:
  C03 RGB 0.173 0.098 0.051 XYZref 0.242 0.140 0.042 XYZcam 0.259 0.160 0.052 sRGB #C0333A #C34242 DE 2.95 DE LCh +2.63 -1.12 +0.72 (strong red)
  B06 RGB 0.301 0.341 0.103 XYZref 0.537 0.477 0.066 XYZcam 0.491 0.440 0.088 sRGB #F7A62B #EBA245 DE 3.89 DE LCh -1.80 -3.17 -1.35 (light strong orange)
  C06 RGB 0.063 0.269 0.246 XYZref 0.149 0.209 0.332 XYZcam 0.166 0.225 0.328 sRGB #009BBA #0097B3 DE 2.38 DE LCh +1.72 -1.59 -0.45 (blue)
  B05 RGB 0.202 0.436 0.144 XYZref 0.390 0.485 0.099 XYZcam 0.375 0.455 0.121 sRGB #AFC245 #ADBB57 DE 3.28 DE LCh -1.44 -2.94 +0.23 (light strong yellow-green)
  D01 RGB 0.488 0.937 0.640 XYZref 0.966 1.000 0.798 XYZcam 0.909 0.943 0.749 sRGB #FEFEFA #FAF8F3 DE 1.36 DE LCh -1.31 +0.23 +0.27 (white)
5 worst patches for Chroma DE:
  C04 RGB 0.386 0.545 0.162 XYZref 0.663 0.666 0.082 XYZcam 0.645 0.650 0.127 sRGB #FECE20 #FCCC4F DE 3.73 DE LCh -0.54 -3.69 -0.27 (light vivid yellow)
  B06 RGB 0.301 0.341 0.103 XYZref 0.537 0.477 0.066 XYZcam 0.491 0.440 0.088 sRGB #F7A62B #EBA245 DE 3.89 DE LCh -1.80 -3.17 -1.35 (light strong orange)
  B05 RGB 0.202 0.436 0.144 XYZref 0.390 0.485 0.099 XYZcam 0.375 0.455 0.121 sRGB #AFC245 #ADBB57 DE 3.28 DE LCh -1.44 -2.94 +0.23 (light strong yellow-green)
  C06 RGB 0.063 0.269 0.246 XYZref 0.149 0.209 0.332 XYZcam 0.166 0.225 0.328 sRGB #009BBA #0097B3 DE 2.38 DE LCh +1.72 -1.59 -0.45 (blue)
  D06 RGB 0.015 0.031 0.022 XYZref 0.034 0.035 0.030 XYZcam 0.029 0.031 0.026 sRGB #343435 #2D3132 DE 2.70 DE LCh -1.17 +1.52 -1.90 (gray 20%)
5 worst patches for Hue DE:
  D06 RGB 0.015 0.031 0.022 XYZref 0.034 0.035 0.030 XYZcam 0.029 0.031 0.026 sRGB #343435 #2D3132 DE 2.70 DE LCh -1.17 +1.52 -1.90 (gray 20%)
  B01 RGB 0.271 0.236 0.080 XYZref 0.445 0.342 0.053 XYZcam 0.434 0.334 0.064 sRGB #EE802F #EA803B DE 2.18 DE LCh -0.50 -1.31 -1.67 (strong orange)
  B06 RGB 0.301 0.341 0.103 XYZref 0.537 0.477 0.066 XYZcam 0.491 0.440 0.088 sRGB #F7A62B #EBA245 DE 3.89 DE LCh -1.80 -3.17 -1.35 (light strong orange)
  C05 RGB 0.221 0.186 0.188 XYZref 0.341 0.221 0.255 XYZcam 0.357 0.230 0.252 sRGB #C8599B #CE5A9A DE 1.44 DE LCh +0.91 +0.20 +1.10 (purple-red)
  A06 RGB 0.157 0.504 0.328 XYZref 0.336 0.457 0.380 XYZcam 0.346 0.466 0.378 sRGB #61C4B3 #68C5B3 DE 1.02 DE LCh +0.43 -0.38 -0.85 (light cyan)
5 best patches for Overall DE:
  D02 RGB 0.331 0.645 0.450 XYZref 0.622 0.645 0.532 XYZcam 0.622 0.645 0.532 sRGB #D2D2D2 #D2D2D2 DE 0.00 DE LCh +0.00 +0.00 +0.00 (gray 80%)
  A03 RGB 0.087 0.222 0.208 XYZref 0.187 0.202 0.287 XYZcam 0.185 0.200 0.278 sRGB #5780A3 #597FA1 DE 0.59 DE LCh -0.24 -0.53 +0.03 (purple-blue)
  B02 RGB 0.060 0.158 0.217 XYZref 0.136 0.125 0.320 XYZcam 0.139 0.127 0.319 sRGB #3262AE #3662AE DE 0.63 DE LCh +0.30 -0.18 +0.39 (purple-blue)
  A01 RGB 0.079 0.101 0.057 XYZref 0.130 0.113 0.057 XYZcam 0.130 0.115 0.059 sRGB #7C5547 #7B5648 DE 0.65 DE LCh +0.24 -0.60 -0.01 (dark brown)
  A05 RGB 0.141 0.271 0.266 XYZref 0.268 0.255 0.365 XYZcam 0.271 0.256 0.361 sRGB #8286B6 #8486B5 DE 0.76 DE LCh +0.14 -0.24 +0.60 (purple-blue)
Writing output to "daylight.json"...
Complete!



make-dcp ----------------------------------------

Camera: LG Mobile LG-H815
Copyright: RawTherapee CC0
Curve: acr
TRO: neutral
Gamut: none

Enter DCP filename suffix, if any: 

Generating 2.5D HueSatMap with 90x30 = 2700 entries...done!
The tone curve's contrast value is 1.30 (=> auto chroma scaling value 1.121)
Generating 3D LookTable with 90x30x30 = 81000 entries for the neutral tone reproduction operator...
  0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100%
Writing output to "LG Mobile LG-H815.dcp"...
Complete!

@szgabor the values look good.
Could you also take a shot using tungsten incandescent light? As described here How to create DCP color profiles - RawPedia

@ilias_giarimis any objections to including this DCP in RT?

I am not able to test now but … just judging from the log …
No objections … the DE values are a bit high but this is expected with smartphone sensors

Sure! I’ll just have to figure out how I can set it up in my flat to produce good results.

Here you are:
https://filebin.net/7a8gv1qemutkaepk

LG Mobile LG-H815 dual-illuminant DCP and source files:
https://filebin.net/xyi9cevykh8p8i6u

argyll-scanin tungsten ----------------------------------------

Input file 'tungsten.tif': w=1562, h=1041, d = 3, bpp = 16
Data input file 'data-examples/cc24_ref.cie'
Data output file 'tungsten.ti3'
Chart reference file '/usr/share/argyllcms/ref/ColorChecker.cht'
Creating diagnostic tiff file 'tungsten-diag.tif'
About to allocate scanrd_ object
Verbosity = 2, flags = 0x62af9
About to read input tiff file and discover groups
adivval = 1.000000
About to calculate edge lines
230 useful edges out of 299
About to calculate perspective correction
Perspective correction factors = -0.000006 0.000004 781.000000 520.500000
About to calculate rotation
Mean angle = -0.058109
Standard deviation = 1.510556
Robust mean angle = 0.008914 from 227 lines
About to calculate feature information
About to read reference feature information
Read of chart reference file succeeded
About to match features
Checking xx
Checking yy
Checking xy
Checking yx
Checking xix
Checking yiy
Checking xiy
Checking yix
Axis matches for each possible orientation:                                                                                                                                                                                                                                    
  0: xx  = 0.424449, yy  = 0.400800, xx.sc  = 0.205900, yy.sc  = 0.212934                                                                                                                                                                                                      
 90: xiy = 0.196457, yx  = 0.411342, xiy.sc = 1.212021, yx.sc  = 0.208082                                                                                                                                                                                                      
180: xix = 0.428479, yiy = 0.407533, xix.sc = 0.203802, yiy.sc = 0.208293                                                                                                                                                                                                      
270: xy  = 0.213108, yix = 0.419865, xy.sc  = 0.411221, yix.sc = 0.208082                                                                                                                                                                                                      
r0 = 0.564493, r90 = 0.078261, r180 = 0.578585, r270 = 0.238256                                                                                                                                                                                                                
There are 2 candidate rotations:                                                                                                                                                                                                                                               
cc = 0.564493, irot = 0.008914, xoff = -28.316538, yoff = -8.942849, xscale = 4.856737, yscale = 4.696292                                                                                                                                                                      
cc = 0.578585, irot = 180.008914, xoff = -1584.720193, yoff = -1055.970254, xscale = 4.906734, yscale = 4.800939                                                                                                                                                               
About to compute match transform for rotation 0.008914 deg.                                                                                                                                                                                                                    
About to setup value scanrdg boxes                                                                                                                                                                                                                                             
About to read raster values                                                                                                                                                                                                                                                    
About to compute expected value correlation                                                                                                                                                                                                                                    
About to compute match transform for rotation 180.008914 deg.                                                                                                                                                                                                                  
About to setup value scanrdg boxes                                                                                                                                                                                                                                             
About to read raster values                                                                                                                                                                                                                                                    
About to compute expected value correlation                                                                                                                                                                                                                                    
Expected value distance values are:                                                                                                                                                                                                                                            
0, rot 0.008914: 2500.317113                                                                                                                                                                                                                                                   
1, rot 180.008914: 4052.911069                                                                                                                                                                                                                                                 
Chosen rotation 0.008914 deg. as best                                                                                                                                                                                                                                          
About to compute final match transform                                                                                                                                                                                                                                         
Improve match                                                                                                                                                                                                                                                                  
About to setup value scanrdg boxes                                                                                                                                                                                                                                             
About to read raster values                                                                                                                                                                                                                                                    
About to write diag file                                                                                                                                                                                                                                                       
Writing output values to file 'tungsten.ti3'                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                               


make-profile tungsten ----------------------------------------

Reading target...
Camera G on darkest patch(es) is -7.5% lighter compared to observer Y.
  Y dynamic range is 4.83 stops, G dynamic range is 4.94 stops, difference
  -0.11 stops. A small difference is normal, while a large indicates that there
  is glare.
Generating values for the calibration illuminant StdA and for D50...
Re-generating target reference XYZ values for illuminant StdA...
Re-generating target reference XYZ values for illuminant D50...
CAT02 was applied on XYZ values to transform illuminant "StdA" to "D50".
Warning: auto-selected neutral patch (D02) is not the lightest, as the
  lightest patch is considerably off-white. That is if you later use the target
  for white balancing you should use the indicated patch instead of the
  lightest.
The most neutral patch (D02) differs 1.36 DE from actual neutral,
  transforming target reference XYZ values to match, using CAT02.
Automatic LUT relaxation weights assigned.
Making camera profile...
Finding a camera raw RGB to CIE XYZ matrix for calibration illuminant StdA...
Whitest patch in target (D02) differs DE 1.19 from calibration illuminant,
  close enough to calculate whitepoint preservation.
Inverting to get ColorMatrix:
  {
    "ColorMatrix1": [
      [  1.496574, -0.675486,  0.022642 ],
      [ -0.188122,  1.188171,  0.312010 ],
      [  0.049607,  0.136214,  0.666191 ]
    ]
  }
Matrix patch match average DE 1.74, DE LCh 0.75 0.84 1.14
                    median DE 1.48, DE LCh 0.84 0.88 0.98
                       p90 DE 3.16, DE LCh 1.31 1.81 2.66
                       max DE 4.53, DE LCh 2.35 2.82 3.30
ColorMatrix optimal white balance for target: 0.893839,1,0.391536 (m1.11877,1,2.55405)
Finding a camera raw RGB to CIE XYZ matrix for connection space illuminant D50...
  {
    "LUTMatrix1": [
      [  0.688403,  0.135532,  0.140284 ],
      [  0.252027,  0.708218,  0.039754 ],
      [  0.000177,  0.022919,  0.802105 ]
    ]
  }
LUTMatrix optimal white balance for target: 0.886048,1,0.390463 (m1.12861,1,2.56106)
Matrix patch match average DE 6.55, DE LCh 1.59 4.85 4.15
                    median DE 6.09, DE LCh 1.37 4.52 4.63
                       p90 DE 14.19, DE LCh 4.17 10.57 8.04
                       max DE 15.40, DE LCh 6.89 13.12 11.96
Finding a camera raw RGB to CIE XYZ matrix for connection space illuminant D50...
  Y row limit set to -0.2.
Applying white-balance to get ForwardMatrix:
  {
    "ForwardMatrix1": [
      [  0.618024,  0.190822,  0.155373 ],
      [  0.087657,  0.990236, -0.077894 ],
      [ -0.173931, -0.550143,  1.549276 ]
    ]
  }
ForwardMatrix optimal white balance for target: 0.886048,1,0.390463 (m1.12861,1,2.56106)
Matrix patch match average DE 1.74, DE LCh 0.64 0.90 1.19
                    median DE 1.68, DE LCh 0.47 0.84 1.01
                       p90 DE 2.80, DE LCh 1.45 1.92 2.35
                       max DE 4.26, DE LCh 2.66 2.33 3.38
Making 2.5D chromaticity-addressed lookup table for XYZ correction...
4.17% of the patches was put in a chromaticity group due to nearby neighbor.
  25.00% of the patches was removed due to being nearby the whitepoint.
  Largest chromaticity group contains 2 patches. Patch count reduced from
  24 to 17. Note that patch matching cannot reach 100% when chromaticity
  groups are formed, as the LUT matches the average within a group.
Lightness axis is disabled. Since lightness affects chroma, the LUT chroma
  control points are recalculated to better match the uncorrected lightness.
  A residual error of up to about 0.2 DE is expected.
Relaxing LUT stretch with up to 4.00 DE. Iterating over 17 patches...
  Lightness correction is disabled.
Average DE for the 17 tested patches increased to 1.90 after LUT relax.
  29.41% could do without LUT correction.
Native LUT patch match average DE 1.83, DE LCh 0.81 0.93 0.99
                        median DE 1.83, DE LCh 0.54 0.73 0.97
                           p90 DE 3.46, DE LCh 1.45 2.71 2.05
                           max DE 5.47, DE LCh 5.03 3.37 2.28
5 worst patches for Overall DE:
  C03 RGB 0.380 0.148 0.051 XYZref 0.287 0.160 0.045 XYZcam 0.346 0.201 0.073 sRGB #D12E3C #E03F4F DE 5.47 DE LCh +5.03 -0.55 -2.09 (strong red)
  C04 RGB 0.698 0.635 0.148 XYZref 0.678 0.680 0.108 XYZcam 0.681 0.694 0.162 sRGB #FED03E #FED461 DE 3.53 DE LCh +0.42 -3.37 +0.97 (light strong yellow)
  B06 RGB 0.541 0.414 0.095 XYZref 0.559 0.502 0.081 XYZcam 0.529 0.479 0.108 sRGB #FAAB39 #F1A951 DE 3.46 DE LCh -1.02 -3.07 -1.25 (light strong orange)
  B05 RGB 0.330 0.451 0.109 XYZref 0.370 0.471 0.119 XYZcam 0.370 0.457 0.143 sRGB #A5C154 #A6BD63 DE 2.79 DE LCh -0.67 -2.71 +0.16 (light yellow-green)
  D06 RGB 0.026 0.030 0.012 XYZref 0.033 0.034 0.028 XYZcam 0.028 0.030 0.025 sRGB #333334 #2E3130 DE 2.56 DE LCh -0.91 +1.24 -2.05 (gray 20%)
5 worst patches for Lightness DE:
  C03 RGB 0.380 0.148 0.051 XYZref 0.287 0.160 0.045 XYZcam 0.346 0.201 0.073 sRGB #D12E3C #E03F4F DE 5.47 DE LCh +5.03 -0.55 -2.09 (strong red)
  B03 RGB 0.452 0.219 0.080 XYZref 0.373 0.240 0.113 XYZcam 0.396 0.264 0.128 sRGB #E05964 #E3626A DE 2.23 DE LCh +2.09 -0.73 +0.23 (red)
  D01 RGB 0.837 0.935 0.359 XYZref 0.968 1.000 0.801 XYZcam 0.902 0.937 0.747 sRGB #FEFEFB #F9F7F3 DE 1.86 DE LCh -1.45 +0.02 +1.16 (white)
  B01 RGB 0.522 0.315 0.080 XYZref 0.479 0.371 0.063 XYZcam 0.498 0.390 0.085 sRGB #F58637 #F78B48 DE 2.47 DE LCh +1.09 -1.39 -1.73 (strong orange)
  C05 RGB 0.438 0.220 0.107 XYZref 0.384 0.242 0.241 XYZcam 0.395 0.254 0.229 sRGB #D95896 #DC5D92 DE 2.18 DE LCh +1.08 -0.56 +1.81 (purple-red)
5 worst patches for Chroma DE:
  C04 RGB 0.698 0.635 0.148 XYZref 0.678 0.680 0.108 XYZcam 0.681 0.694 0.162 sRGB #FED03E #FED461 DE 3.53 DE LCh +0.42 -3.37 +0.97 (light strong yellow)
  B06 RGB 0.541 0.414 0.095 XYZref 0.559 0.502 0.081 XYZcam 0.529 0.479 0.108 sRGB #FAAB39 #F1A951 DE 3.46 DE LCh -1.02 -3.07 -1.25 (light strong orange)
  B05 RGB 0.330 0.451 0.109 XYZref 0.370 0.471 0.119 XYZcam 0.370 0.457 0.143 sRGB #A5C154 #A6BD63 DE 2.79 DE LCh -0.67 -2.71 +0.16 (light yellow-green)
  C02 RGB 0.122 0.244 0.068 XYZref 0.146 0.232 0.097 XYZcam 0.159 0.240 0.113 sRGB #3D9557 #479560 DE 2.07 DE LCh +0.73 -1.82 +0.66 (green)
  B01 RGB 0.522 0.315 0.080 XYZref 0.479 0.371 0.063 XYZcam 0.498 0.390 0.085 sRGB #F58637 #F78B48 DE 2.47 DE LCh +1.09 -1.39 -1.73 (strong orange)
5 worst patches for Hue DE:
  A01 RGB 0.143 0.110 0.035 XYZref 0.135 0.116 0.057 XYZcam 0.134 0.118 0.054 sRGB #7F5547 #7E5744 DE 2.30 DE LCh +0.27 +0.04 +2.28 (dark red)
  C03 RGB 0.380 0.148 0.051 XYZref 0.287 0.160 0.045 XYZcam 0.346 0.201 0.073 sRGB #D12E3C #E03F4F DE 5.47 DE LCh +5.03 -0.55 -2.09 (strong red)
  D06 RGB 0.026 0.030 0.012 XYZref 0.033 0.034 0.028 XYZcam 0.028 0.030 0.025 sRGB #333334 #2E3130 DE 2.56 DE LCh -0.91 +1.24 -2.05 (gray 20%)
  A02 RGB 0.507 0.373 0.134 XYZref 0.460 0.397 0.221 XYZcam 0.461 0.393 0.228 sRGB #DB9889 #DC968C DE 1.83 DE LCh -0.23 +0.10 -1.81 (red)
  C05 RGB 0.438 0.220 0.107 XYZref 0.384 0.242 0.241 XYZcam 0.395 0.254 0.229 sRGB #D95896 #DC5D92 DE 2.18 DE LCh +1.08 -0.56 +1.81 (purple-red)
5 best patches for Overall DE:
  D02 RGB 0.568 0.641 0.250 XYZref 0.618 0.641 0.529 XYZcam 0.618 0.641 0.529 sRGB #D1D1D1 #D1D1D1 DE 0.00 DE LCh +0.00 +0.00 +0.00 (gray 80%)
  B02 RGB 0.096 0.132 0.095 XYZref 0.130 0.120 0.296 XYZcam 0.130 0.122 0.284 sRGB #3460A8 #3861A5 DE 0.61 DE LCh +0.19 -0.84 -0.39 (purple-blue)
  B04 RGB 0.097 0.071 0.039 XYZref 0.097 0.073 0.104 XYZcam 0.097 0.072 0.101 sRGB #643E67 #653E65 DE 0.65 DE LCh -0.04 -0.10 +0.64 (dark purple)
  A03 RGB 0.139 0.198 0.100 XYZref 0.178 0.193 0.273 XYZcam 0.174 0.190 0.260 sRGB #557D9F #567C9C DE 0.77 DE LCh -0.39 -0.69 -0.34 (purple-blue)
  A05 RGB 0.241 0.250 0.129 XYZref 0.269 0.251 0.347 XYZcam 0.263 0.245 0.335 sRGB #8784B2 #8782AF DE 0.88 DE LCh -0.54 -0.21 +0.60 (purple-blue)
Writing output to "tungsten.json"...
Complete!



argyll-scanin daylight ----------------------------------------

Input file 'daylight.tif': w=2008, h=1339, d = 3, bpp = 16
Data input file 'data-examples/cc24_ref.cie'
Data output file 'daylight.ti3'
Chart reference file '/usr/share/argyllcms/ref/ColorChecker.cht'
Creating diagnostic tiff file 'daylight-diag.tif'
About to allocate scanrd_ object
Verbosity = 2, flags = 0x62af9
About to read input tiff file and discover groups
adivval = 1.000000
About to calculate edge lines
374 useful edges out of 1898
About to calculate perspective correction
Perspective correction factors = -0.000000 0.000000 1004.000000 669.500000
About to calculate rotation
Mean angle = 0.216192
Standard deviation = 2.129819
Robust mean angle = 0.326489 from 335 lines
About to calculate feature information
About to read reference feature information
Read of chart reference file succeeded
About to match features
Checking xx
Checking yy
Checking xy
Checking yx
Checking xix
Checking yiy
Checking xiy
Checking yix
Axis matches for each possible orientation:
  0: xx  = 0.298064, yy  = 0.348866, xx.sc  = 0.161342, yy.sc  = 0.161288
 90: xiy = 0.157741, yx  = 0.312551, xiy.sc = 0.809326, yx.sc  = 0.162605
180: xix = 0.291455, yiy = 0.367390, xix.sc = 0.162035, yiy.sc = 0.161801
270: xy  = 0.164156, yix = 0.319924, xy.sc  = 0.316411, yix.sc = 0.163802
r0 = 0.458704, r90 = 0.070340, r180 = 0.468283, r270 = 0.186151
There are 2 candidate rotations:
cc = 0.458704, irot = 0.326489, xoff = -27.233531, yoff = -34.196384, xscale = 6.198028, yscale = 6.200102
cc = 0.468283, irot = 180.326489, xoff = -2021.820946, yoff = -1369.900420, xscale = 6.171524, yscale = 6.180419
About to compute match transform for rotation 0.326489 deg.
About to setup value scanrdg boxes
About to read raster values
About to compute expected value correlation
About to compute match transform for rotation 180.326489 deg.
About to setup value scanrdg boxes
About to read raster values
About to compute expected value correlation
Expected value distance values are:
0, rot 0.326489: 2869.384179
1, rot 180.326489: 3952.860945
Chosen rotation 0.326489 deg. as best
About to compute final match transform
Improve match
About to setup value scanrdg boxes
About to read raster values
About to write diag file
Writing output values to file 'daylight.ti3'



make-profile daylight ----------------------------------------

Reading target...
Camera G on darkest patch(es) is -5.4% lighter compared to observer Y.
  Y dynamic range is 4.83 stops, G dynamic range is 4.91 stops, difference
  -0.08 stops. A small difference is normal, while a large indicates that there
  is glare.
Generating values for the calibration illuminant D50...
Re-generating target reference XYZ values for illuminant D50...
Warning: auto-selected neutral patch (D02) is not the lightest, as the
  lightest patch is considerably off-white. That is if you later use the target
  for white balancing you should use the indicated patch instead of the
  lightest.
The most neutral patch (D02) differs 1.22 DE from actual neutral,
  transforming target reference XYZ values to match, using CAT02.
Automatic LUT relaxation weights assigned.
Making camera profile...
Finding a camera raw RGB to CIE XYZ matrix for calibration illuminant D50...
Whitest patch in target (D02) differs DE 1.22 from calibration illuminant,
  close enough to calculate whitepoint preservation.
Inverting to get ColorMatrix:
  {
    "ColorMatrix1": [
      [  0.822685, -0.216335, -0.072272 ],
      [ -0.348501,  1.157821,  0.215187 ],
      [ -0.057994,  0.230698,  0.636521 ]
    ]
  }
Matrix patch match average DE 1.37, DE LCh 0.84 0.57 0.60
                    median DE 1.36, DE LCh 0.90 0.45 0.37
                       p90 DE 2.27, DE LCh 1.41 1.41 1.22
                       max DE 2.71, DE LCh 2.29 2.11 2.33
ColorMatrix optimal white balance for target: 0.517604,1,0.700483 (m1.93198,1,1.42759)
Finding a camera raw RGB to CIE XYZ matrix for connection space illuminant D50...
  {
    "LUTMatrix1": [
      [  0.665334,  0.128655,  0.170230 ],
      [  0.282724,  0.666903,  0.050373 ],
      [  0.000103,  0.009080,  0.816018 ]
    ]
  }
LUTMatrix optimal white balance for target: 0.5138,1,0.697424 (m1.94628,1,1.43385)
Matrix patch match average DE 5.22, DE LCh 1.97 4.10 2.79
                    median DE 5.48, DE LCh 1.91 4.28 2.13
                       p90 DE 10.17, DE LCh 3.85 8.19 6.69
                       max DE 12.04, DE LCh 3.96 9.62 7.65
Finding a camera raw RGB to CIE XYZ matrix for connection space illuminant D50...
  Y row limit set to -0.2.
Applying white-balance to get ForwardMatrix:
  {
    "ForwardMatrix1": [
      [  0.691993,  0.172064,  0.100161 ],
      [  0.217118,  0.922255, -0.139373 ],
      [ -0.015678, -0.384664,  1.225544 ]
    ]
  }
ForwardMatrix optimal white balance for target: 0.5138,1,0.697424 (m1.94628,1,1.43385)
Matrix patch match average DE 1.44, DE LCh 0.86 0.64 0.71
                    median DE 1.35, DE LCh 0.71 0.46 0.73
                       p90 DE 2.47, DE LCh 1.75 1.60 1.63
                       max DE 3.26, DE LCh 2.79 1.71 1.95
Making 2.5D chromaticity-addressed lookup table for XYZ correction...
4.17% of the patches was put in a chromaticity group due to nearby neighbor.
  25.00% of the patches was removed due to being nearby the whitepoint.
  Largest chromaticity group contains 2 patches. Patch count reduced from
  24 to 17. Note that patch matching cannot reach 100% when chromaticity
  groups are formed, as the LUT matches the average within a group.
Lightness axis is disabled. Since lightness affects chroma, the LUT chroma
  control points are recalculated to better match the uncorrected lightness.
  A residual error of up to about 0.2 DE is expected.
Relaxing LUT stretch with up to 3.93 DE. Iterating over 17 patches...
  Lightness correction is disabled.
Average DE for the 17 tested patches increased to 1.73 after LUT relax.
  47.06% could do without LUT correction.
Native LUT patch match average DE 1.59, DE LCh 0.80 1.02 0.62
                        median DE 1.34, DE LCh 0.59 0.60 0.60
                           p90 DE 3.27, DE LCh 1.75 2.94 1.09
                           max DE 3.80, DE LCh 2.57 3.70 1.94
5 worst patches for Overall DE:
  B06 RGB 0.301 0.341 0.103 XYZref 0.537 0.477 0.066 XYZcam 0.489 0.440 0.087 sRGB #F7A62B #EAA244 DE 3.80 DE LCh -1.82 -3.15 -1.09 (light strong orange)
  C04 RGB 0.386 0.545 0.162 XYZref 0.663 0.666 0.082 XYZcam 0.646 0.650 0.127 sRGB #FECE20 #FCCC50 DE 3.77 DE LCh -0.54 -3.70 -0.44 (light vivid yellow)
  B05 RGB 0.202 0.436 0.144 XYZref 0.390 0.485 0.099 XYZcam 0.375 0.455 0.121 sRGB #AFC245 #ADBB57 DE 3.27 DE LCh -1.43 -2.94 +0.20 (light strong yellow-green)
  C03 RGB 0.174 0.098 0.051 XYZref 0.242 0.140 0.042 XYZcam 0.260 0.159 0.053 sRGB #C0333A #C34142 DE 2.82 DE LCh +2.57 -1.05 +0.47 (strong red)
  D06 RGB 0.015 0.031 0.022 XYZref 0.034 0.035 0.030 XYZcam 0.029 0.031 0.026 sRGB #343435 #2D3132 DE 2.76 DE LCh -1.17 +1.57 -1.94 (gray 20%)
5 worst patches for Lightness DE:
  C03 RGB 0.174 0.098 0.051 XYZref 0.242 0.140 0.042 XYZcam 0.260 0.159 0.053 sRGB #C0333A #C34142 DE 2.82 DE LCh +2.57 -1.05 +0.47 (strong red)
  B06 RGB 0.301 0.341 0.103 XYZref 0.537 0.477 0.066 XYZcam 0.489 0.440 0.087 sRGB #F7A62B #EAA244 DE 3.80 DE LCh -1.82 -3.15 -1.09 (light strong orange)
  C06 RGB 0.063 0.269 0.246 XYZref 0.149 0.209 0.332 XYZcam 0.167 0.225 0.327 sRGB #009BBA #0096B2 DE 2.47 DE LCh +1.75 -1.71 -0.41 (blue)
  B05 RGB 0.202 0.436 0.144 XYZref 0.390 0.485 0.099 XYZcam 0.375 0.455 0.121 sRGB #AFC245 #ADBB57 DE 3.27 DE LCh -1.43 -2.94 +0.20 (light strong yellow-green)
  D01 RGB 0.488 0.937 0.640 XYZref 0.966 1.000 0.798 XYZcam 0.910 0.943 0.749 sRGB #FEFEFA #FAF8F3 DE 1.34 DE LCh -1.30 +0.23 +0.23 (white)
5 worst patches for Chroma DE:
  C04 RGB 0.386 0.545 0.162 XYZref 0.663 0.666 0.082 XYZcam 0.646 0.650 0.127 sRGB #FECE20 #FCCC50 DE 3.77 DE LCh -0.54 -3.70 -0.44 (light vivid yellow)
  B06 RGB 0.301 0.341 0.103 XYZref 0.537 0.477 0.066 XYZcam 0.489 0.440 0.087 sRGB #F7A62B #EAA244 DE 3.80 DE LCh -1.82 -3.15 -1.09 (light strong orange)
  B05 RGB 0.202 0.436 0.144 XYZref 0.390 0.485 0.099 XYZcam 0.375 0.455 0.121 sRGB #AFC245 #ADBB57 DE 3.27 DE LCh -1.43 -2.94 +0.20 (light strong yellow-green)
  C06 RGB 0.063 0.269 0.246 XYZref 0.149 0.209 0.332 XYZcam 0.167 0.225 0.327 sRGB #009BBA #0096B2 DE 2.47 DE LCh +1.75 -1.71 -0.41 (blue)
  D06 RGB 0.015 0.031 0.022 XYZref 0.034 0.035 0.030 XYZcam 0.029 0.031 0.026 sRGB #343435 #2D3132 DE 2.76 DE LCh -1.17 +1.57 -1.94 (gray 20%)
5 worst patches for Hue DE:
  D06 RGB 0.015 0.031 0.022 XYZref 0.034 0.035 0.030 XYZcam 0.029 0.031 0.026 sRGB #343435 #2D3132 DE 2.76 DE LCh -1.17 +1.57 -1.94 (gray 20%)
  B01 RGB 0.271 0.236 0.080 XYZref 0.445 0.342 0.053 XYZcam 0.433 0.334 0.064 sRGB #EE802F #EA7F3B DE 2.19 DE LCh -0.54 -1.31 -1.67 (strong orange)
  B06 RGB 0.301 0.341 0.103 XYZref 0.537 0.477 0.066 XYZcam 0.489 0.440 0.087 sRGB #F7A62B #EAA244 DE 3.80 DE LCh -1.82 -3.15 -1.09 (light strong orange)
  C05 RGB 0.221 0.186 0.188 XYZref 0.341 0.221 0.255 XYZcam 0.357 0.230 0.253 sRGB #C8599B #CE5A9A DE 1.42 DE LCh +0.91 +0.24 +1.06 (purple-red)
  C01 RGB 0.030 0.089 0.146 XYZref 0.077 0.064 0.235 XYZcam 0.077 0.067 0.221 sRGB #00499A #004794 DE 1.04 DE LCh +0.59 -1.32 -1.05 (dark purple-blue)
5 best patches for Overall DE:
  D02 RGB 0.331 0.645 0.450 XYZref 0.622 0.645 0.532 XYZcam 0.622 0.645 0.532 sRGB #D2D2D2 #D2D2D2 DE 0.00 DE LCh +0.00 +0.00 +0.00 (gray 80%)
  B02 RGB 0.060 0.158 0.217 XYZref 0.136 0.125 0.320 XYZcam 0.139 0.127 0.319 sRGB #3262AE #3662AE DE 0.50 DE LCh +0.31 -0.23 +0.18 (purple-blue)
  A03 RGB 0.087 0.222 0.208 XYZref 0.187 0.202 0.287 XYZcam 0.185 0.200 0.277 sRGB #5780A3 #597FA0 DE 0.55 DE LCh -0.24 -0.53 -0.11 (purple-blue)
  A05 RGB 0.141 0.271 0.266 XYZref 0.268 0.255 0.365 XYZcam 0.271 0.256 0.361 sRGB #8286B6 #8486B5 DE 0.76 DE LCh +0.14 -0.25 +0.60 (purple-blue)
  A01 RGB 0.079 0.101 0.057 XYZref 0.130 0.113 0.057 XYZcam 0.131 0.115 0.060 sRGB #7C5547 #7C5649 DE 0.77 DE LCh +0.24 -0.60 -0.43 (dark brown)
Writing output to "daylight.json"...
Complete!



make-dcp ----------------------------------------

Camera: LG Mobile LG-H815
Copyright: RawTherapee CC0
Curve: acr
TRO: neutral
Gamut: none

Enter DCP filename suffix, if any: 

Generating 2.5D HueSatMap with 90x30 = 2700 entries...done!
The tone curve's contrast value is 1.30 (=> auto chroma scaling value 1.121)
Generating 3D LookTable with 90x30x30 = 81000 entries for the neutral tone reproduction operator...
  0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100%
Generating 2.5D HueSatMap with 90x30 = 2700 entries...done!
Writing output to "LG Mobile LG-H815.dcp"...
Complete!

The white balance of the StdA shot in RT looks very wrong (1500K/0.37 tint) because the order of the illuminants in these DNG files is incorrect. It’s the camera’s fault. Same problem as here Color temperature range - #27 by ilias_giarimis
This fixes it:

exiftool -CalibrationIlluminant1="Standard Light A" -CalibrationIlluminant2="D65" "LG Mobile LG-H815 tungsten.dng"

Regardless, the DCP works fine.

@ilias_giarimis ok to commit?

I think it’s fine … certainly better than the in_DNG embedded. Even if C03 is off (DE=5.0) :frowning:

Committed LG Mobile LG-H815 DCP · Issue #3868 · Beep6581/RawTherapee · GitHub

Thanks, it works!

Is the 4px-wide cropping of the edges hard-coded? As far as I remember, I couldn’t solve it by tweaking camconst.json. While it’s mostly psychological for a 16Mpx sensor, it would be cool to get no less data than what the camera-JPEG contains…

@ilias_giarimis should I commit the 0, 0, 0, 0 change or leave it for 5.1?

Yes, please commit

Done.