That is (almost) equivelent to a -clut operator
For more details See IM Examples, Color Modifications, CLUT
http://www.imagemagick.org/Usage/color/#clut
Lets break down the formula...
First FX loops through each pixel of the input image (no control at this time though -geagion has been proposed to limit the area of the input image looped through), and also through each of the three color channels (controled by the -channel value that defaults to just RGB channels (just the color channesl not alpha).
that means the FX formula will be exected width * height * 3 times! that is a lot!
Now as you guessed...
u = color (value) of the current pixel (and channel) in input image
the input image (u) is presumably a greyscale image so each channel value is the same, unless you are doing a histogram adjustment basied on a greyscale gradient in the second 'v' image.
v.h = is the height of the second image.
u*v.h = Multiply the color value (range 0 to 1) with the heigh of the second 'v' image.
that is convert the color into a height index position in the second image.
v.p{} = look up the color from 'v' at position given
v.p{0, u*v.h} get the color from the first column of 'v' at a distance u*v.h from the top.
In other word replace each color value in the input 'u' image, with the color in the second 'v' image indexed by the original color value.
Or A Color Lookup using the second image as the Lookup table.
As mentioned this is (almost) exactly the same as the newer
-clut operator that was developed from that specific
-fx formula. The only difference is instead of v.p{0,u*v.h} it is actually using v.p{u*v.w,u*v.h} or an indexed lookup along a diagonal line though the second lookup-table-image. this means that the lookup table image can be either single row, or a single column image, and things will still come out correct.
Actually the final formula is a little more complex than that to take into account the current
-interpolation setting. It also is effected at extreme values by the
-virtual-pixel setting, so it is a good idea to ensure the defualt 'edge' VP setting is in use.
For more details See IM Examples, Color Modifications, CLUT
http://www.imagemagick.org/Usage/color/#clut