Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tetrahedral matrix documentation #5

Open
ThomasWilshaw opened this issue Aug 1, 2024 · 5 comments
Open

Tetrahedral matrix documentation #5

ThomasWilshaw opened this issue Aug 1, 2024 · 5 comments

Comments

@ThomasWilshaw
Copy link

Hi,

Firstly thanks for creating this library, it's incredibly useful. I was wondering if you could provide some documentation on how to use the results of the Tetrahedral matrix values? Are they the red, green, blue, magenta, cyan and yellow triplets to be used in a standard tetrahedral colour tool or something else? I've set up a simple script to match two test charts as below:

matrix = TetrahedralMatrix()
matrix.solve(scanner_pixels_data_array, xyz_pixels_data_array)
print(matrix.matrix)

but when I input the results into a tetrahedral node in Nuke I get results that are definitely wrong:
image
image

Any help would be greatly appreciated. Also I'm assuming these can also be used in pipelines? Something like this:

pipeline= Pipeline([TetrahedralMatrix(), RBF()])
pipeline.solve(bmpcc_data, film_data)
matrix = pipeline.nodes[0]
rbf = pipeline.nodes[1]
print(matrix.matrix)
rbf.export_LUT(path="after_tet_scanner_WB_to_rec709_65.cube", size=65)

If so does the above do a tetrahydral match and then do a RBF match on top of that?

@ethan-ou
Copy link
Owner

ethan-ou commented Aug 1, 2024

I should probably put docs on this but try the following order for the tetra matrix: Red, Yellow, Green, Cyan, Blue, Magenta. Or it might be easier to switch the order so that it matches the DCTL. What do you think?

Also your pipeline with Tetra + RBF should work but worst case you can try having two pipelines one after each other.

@ThomasWilshaw
Copy link
Author

Thanks I'll give that a try :) All the tools I've seen have been ordered R, G, B, C, M, Y so that would proably make sense, I guess so long as it's documented it doesn't matter too much. They also usually have controls for the black and white points but i don't know if you could pull that out of your code too?

If I do two pipelines would it be something like this (pseudo code):

pipeline1= Pipeline([TetrahedralMatrix()])
pipeline1.solve(bmpcc_data, film_data)

pipeline2 = Pipeline(RBF())
pipeline2.solve(pipeline1, film_data)

@ThomasWilshaw
Copy link
Author

Yep that order seems to have worked worked :) I've not got a perfect match but its' very close. I'm using every pixel in the image as a data point, is that too much or is more always better do you think?

@ethan-ou
Copy link
Owner

ethan-ou commented Aug 2, 2024

For the two pipelines you can just use the nodes themselves:

matrix = TetrahedralMatrix()
matrix.solve(bmpcc_data, film_data)

# Apply the matrix to the existing data
new_bmpcc_data = matrix(bmpcc_data)

rbf = RBF()
rbf.solve(new_bmpcc_data, film_data)

As for the number of data points having a lot is fine. It'll likely work so long as the data is high quality and fits what you're trying to match.

@ThomasWilshaw
Copy link
Author

Thanks that's really helpful, I'll give it a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants