The general idea is to use the Node.sample () with the sampling function of the whole picture per pixel sampling, I write the sampling function is more flexible, can define a sampling family, that is, the whole picture into a number of blocks, block by sample, to a large extent reduce the sampling workload, but the relative accuracy will be reduced. Considering that the single screen contains four components of RGBA, I will sample four times for one screen. After sampling the reference picture, the target image needs to be sampled, so the total needs to be sampled eight times, which is a small amount of computation.
A lot of data will be generated after sampling, I have found a lot of toolkits to try to manage this data, finally choose NumPy, this toolkit is easy to use, the array array or matrix data storage mode with the sampling screen can establish a very intuitive correspondence. NumPy is a very powerful data analysis tool that can efficiently get the information you need. By NumPy, we can calculate the maximum minimum value of the current sampling screen, the numerical distribution histogram and so on. After getting the information about the two pictures, we need to consider proposing a feasible algorithm for matching. My first idea is histogram matching, it is commonplace, my algorithm slightly different, I only match two histogram in the crest, as long as two pictures of RGB three-channel crest can match the same, it is done, but the actual matching process in the straight-side diagram of the fitting and there are a lot of problems, finally I can only take the approximate way to carry out , the final result is not ideal so accurate, but encountered the picture bright dark transition even more difficult to catch the crest, the accuracy of the decline is very serious. To propose a new algorithm and consider the time cost, I finally adopted a compromise scheme, that is, a toolkit, the internal two nodes, one for the automatic color, one on the basis of sampling to provide manual color function. As for how the histogram matching process needs to adjust the value of the map to the gain value in the Nuke gamma value Blackpoint value Whitepoint value, this is actually a formula, online check can be.
The idea of nuke color matching node