I'm now able to reference from a single frame, too. However, it only works with one rotation.
Here's how the algorithm works. First, I match the normalized cumulative histogram of each color channel. This results in a 1-to-1 transfer of each value to the target value. For example, the red value of 185 may change to 233. I'll save this 1-to-1 mapping and use it for other pictures. The result is really great and the algorithm saves a lot of time with the color mapping process.
But as I've said, it only works with simple histogram matching, because when I apply the pdf algorithm, there is 1-to-many mapping. And I haven't found a way yet, to calculate how the next value is choosen. Since the next values are usually in a range (let's say 185 changes to values between 225-240), I've calculated the mean value and used it for one to one mapping. Doesn't work, unfortunately. I've also tried to map from rotation to rotation, but even then one value is mapped to many others.
So yeah, the mapping based on a refernce frame is a great addition, but so far it only works with with histogram matching/one rotation. It will result in a good color transfer, which is probably enough most of the time.