In this video we will continue with point operations - Log and Inverse Log transformation on images. The log transformation can be defined by this formula = c*log(1+r) where s and r are the pixel values of the output and the input image and c is a constant. Show Log and Inverse Log transformation on Image in Python
how do i find inverse of this ?? I want it to return back to the original value and not the scaled value
hoefling 51.3k10 gold badges131 silver badges168 bronze badges asked Aug 3, 2018 at 9:21
2 Hope the above answers were helpful, in case you or anyone want the inverse for log10 (base 10) and log (natural)
answered Mar 23, 2020 at 13:44
If you want to obtain the original value then you can do:
answered Aug 3, 2018 at 9:25
Jacques UngJacques Ung 1492 silver badges6 bronze badges y = np.log10(train_set["SalePrice"]) return back to the original value all of array elements
answered Jun 1, 2020 at 14:36
A logarithm of a given number n is the exponent to which another number which is been fixed, the base b, must be raised, to produce that number n. In layman terms the logarithm counts the number of occurrences of the same factor in repeated multiplication. A logarithmic function is represented as:
When the base b of the logarithm equals 10, we generally don’t mention it, i.e. f(x) = log (x). The inverse of a log or exponential function is given by : In general case,
For natural log:
let us look at some examples for better understanding:
An inverse log transformation in the R programming language can be exp(x) and expm1(x) functions. exp( ) function simply computes the exponential function, whereas the expm1( ) function computes exp(x) – 1 accurately also for |x| << 1. Here x must be a numeric or complex vector and base must be positive. Method 1: Using exp()Syntax:
Where, x is a numeric value. Example: R
Output:
For bigger numbers, it generally returns “Inf” which means infinity. Method 2: Using expm1()Syntax:
Where, x is a numeric value. Example: R
Output:
For large numeric values exp( ) and expm1( ) functions return the same values. Example : R
Output:
|