Did you try ln_image =log(mat2gray(image))?
By the way it's a terrible idea for them to tell you to use the word "image" for your variable name. image() is a built-in function. If there are any zeros in your image you should add 1 to the image before taking the log of it.
3 Comments
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/663878-how-can-i-apply-a-natural-logarithm-to-an-image#comment_1162983
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/663878-how-can-i-apply-a-natural-logarithm-to-an-image#comment_1162983
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/663878-how-can-i-apply-a-natural-logarithm-to-an-image#comment_1163033
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/663878-how-can-i-apply-a-natural-logarithm-to-an-image#comment_1163033
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/663878-how-can-i-apply-a-natural-logarithm-to-an-image#comment_1163103
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/663878-how-can-i-apply-a-natural-logarithm-to-an-image#comment_1163103
Sign in to comment.