# Enhance image in matlab - exp operation - imageJ software-LPR

I use imageJ software, imageJ has a EXP command (process >math >exp ).

original image:

output image processed by EXP command in imageJ software:

in this link explain how do that ImageJ: http://imagej.1557.x6.nabble.com/Process-gt-Math-gt-Exp-td5009733.html

How can I do that in matlab?

It is the matlab code which I wrote,Please correct my mistakes.

clear all;
close all;
clc;
im=rgb2gray(img);
im=im2double(im);

figure,imshow(im)

for i=1:size(im,1)
for j=1:size(im,2)

in = (im(i,j)+1);
result(i,j) = 255*exp(in/46.01);

end
end
figure,imshow(mat2gray(result))

• dear @SergV the second image is this: s6.uplod.ir/i/00594/7znj3tzvefui.png you put the first image instead of first and second image. please edit it.thanks alot – Karo Amini May 8 '15 at 7:01
• I change image by your request. Wait some time. But it was not my fault - maybe it was a some failure. Good luck. – SergV May 8 '15 at 8:05
• You provide a link which describes very clear this function. What's your trouble? Could you give source in Matlab, with which you have tried to solve the problem? – SergV May 8 '15 at 8:08
• Dear @SergV I added my source code :) , please help me and correct my mistakes. thanks alot again. and thanks for your time. (v) – Karo Amini May 8 '15 at 11:25

You have to learn to debug your programs. Try formula for some data:

>> 255*exp(255/46.01)
ans =   6.5091e+004


So formula has bug (explanation in link to forum is valid. Read it carefully). Valid formula:

>> exp(255/46.01)
ans =  255.26


But try calculation with real data from your image:

>> in = (im(10,10)+1)
in = 254
>> exp(in/46.01)
ans =  403.43    % very strange result!!!!
>> in/46.01
ans = 6          %what is it????


Reason is quite simple - type of in is uint8!!!

Valid formula:

result(i,j) = exp(double(in)/46.01);


result:

imshow(uint8(result));


• Dear @SergV ,I do appreciate you for what you have done for me. – Karo Amini May 8 '15 at 12:21