red , green and blue part from Exponential image

5 views (last 30 days)
subplot(2,2,1); imshow(rgb),title('Original RGB');
[row col wid] = size(rgb);
% Log transformation
for i=1:size(rgb,1)
for j=1:size(rgb,2)
in = double(rgb(i,j)+1);
L(i,j) = log2(in);
end
end
% Exponantial transformation
for i=1:size(rgb,1)
for j=1:size(rgb,2)
in = double(L(i,j)+1);
E(i,j) = exp(in);
end
end
% convert to 8-bit % figure
logT = (L/(max(L(:))))*255; % L ;
expT = (E/(max(E(:))))*255; %E ;
subplot(2,2,2);
imshow(logT,[]),title('Log Transformed');
% imshow(I,[low high]) displays the gray scale image I, specifying the
% display range as a two-element vector, [low high].
subplot(2,2,3);
imshow( expT , [ ] ) , title('Exponential of Log Transformed');
if true
% code
end
Now i want to get red , green and blue part from Exponential image

Accepted Answer

Image Analyst
Image Analyst on 17 Apr 2015
What is wid (the number of color channels)? If it's 3, like for a normal RGB image, then using code like:
in = double(rgb(i,j)+1);
could lead to unintended consequences. If rgb is a 3 dimensional matrix, what value do you think you'll get if you supply indexes for only 2 of the dimensions and not the third dimension?
What does this show:
whos logT
  4 Comments
Image Analyst
Image Analyst on 17 Apr 2015
Why are you not referring to all 3 indexes in the rgb() matrix?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!