03-01-2010 03:56 PM
Maybe I'm incorrect in assuming that the Log operator will replace pixels in the source image with the log or log(10) values, but I am getting flaky results.
For example, in my type single image, I choose two pixels:
Original values
- 1904 and 16112
after MathLookUp, Log function
- 22910.81, 30508.17
I would have expected 7.55, 9.69 (or 3.28, 4.21 if it is log10).
Can someone tell me what is going on?
Thanks!
03-02-2010 11:27 AM
Hey Steve,
What is the Mathlookup function that you are using?
for input of 1904
log2 = 10.8948
log10 = 3.27967
which does not seem to be consistent with 7.55 that you were expecting
03-02-2010 11:44 AM
Algorithms.MathLookup(imageViewer.Image, imageViewer.Image, MathLookupOperator.Log)
03-04-2010 08:09 AM
Hello Steve,
The Mathlookup function has an Operator in which you can specify the remapping procedure to use. By default, it is set to 0 which is a linear remappin. Here's the list of option that you have for the operator.
| Linear (0) |
(Default) Linear remapping. |
| Log (1) |
A logarithmic remapping operation that gives extended contrast for small pixel values and less contrast for large pixel values. |
| Exp (2) |
An exponential remapping operation that gives extended contrast for large pixel values and less contrast for small pixel values. |
| Square (3) |
Similar to exponential but with a more gradual effect. |
| Square Root (4) |
Similar to logarithmic but with a more gradual effect. |
| Power X (5) |
Gives variable effects depending on the value of X. The default value of X is 1.5. |
| Power 1/X (6) |
Gives variable effects depending on the value of X. The default value of X is 1.5. |
03-04-2010 10:52 AM
Thanks, Andy. I am aware that these are the various lookup tables available, but it still doesn't explain why I am getting the result that I do.
Certainly someone in the big ol' NI World knows the answer. Yes?
03-04-2010 12:52 PM
Steve,
This is just a guess, but I'd imagine it does not simply take a direct log of the pixel value. It might take the original max range of pixel values of the image type (say 0-4095 for a 12-bit image) and map it to the exact same range (0-4095) but with a logarithmic scale rather than linear. So the real-world intensity difference between each pixel value would no longer be constant over the entire range but the actual possible range of pixel values would still be the same. If it were a direct log of each pixel value then the end range would not be the same.
Eric
03-04-2010 01:57 PM
Thanks, Blue Cheese -
I had actually thought of that, and it may be that it works that way. It's fine if one is only concerned about displaying the image, but it seems to be kind of worthless if one wants to do actual calculations, e.g., densitometry.