I have a 3d array representing a volume. Every voxel keeps a vector (k1, k2) as its local principle curvature.
Now, I need to visualize this volume by color (just like the picture below). So I need to convert it to a RGBA volume. Is there any algorithm to implement transfer function from (k1, k2) to (r, g, b, a)? Thanks!
I basically copy pasted the solution for
Visualize Optical Flow with color model
Code from OpenCV's tutorial:
The only thing missing is the alpha channel that you didn't specify how you can compute. From what I can understand from the image of your color space, you can use the magnitude of the gradient as the value of alpha. The change you'll have to do for this is adding the magnitude as the fourth channel in the BGR image.