Creating 3D .cube LUTs for camera OOC styles

So today I built LUTs using this here technique, but with the same training images I had used in the other thread. Lo and behold, the produced LUTs have the same sort of strange artifacts as in my own experiments. Of course I could smooth over those just like I did in the other thread, but that doesn’t solve the problem really, it merely hides it.

However, there were two significant differences between the published code and what I did:

  1. I didn’t use darktable as part of the processing, as I had already exported matching darktable-exports and camera-jpegs.
  2. I couldn’t get the automatic image alignment to work reliably. It always infinite-looped on some of my images and wouldn’t converge. But since my images were shot without any lens corrections or processing otherwise, I just went without the alignment.

If I understand the code correctly, it essentially matches the darktable-jpeg histogram to the camera-jpeg histogram using an optimization algorithm. Interestingly, this procedure produces slightly different colors than my match-pixels-to-pixels way of doing things.

At any rate, I learned a few things from this: One, I had a broken file in my training set that confused things (doh!). Two, a 16x16x16 or 9x9x9 LUT is perfectly sufficient, no need to go to the ridiculous 64x64x64 I was using. And probably some more.

Thank you for your code! I learned a lot from it!