a matrix save in a variable

4 views (last 30 days)
Amir Khan
Amir Khan on 12 May 2015
Commented: Amir Khan on 12 May 2015
i want to save this expression to a variable
imshow( expT ,[] )
like this
e = expT
but it save a single value . i need whole matrix
  3 Comments
Amir Khan
Amir Khan on 12 May 2015
i am showing a image which is matrix . imshow(expT, [ ] ) it display the image . now i wnt to save all elements of this image .
Amir Khan
Amir Khan on 12 May 2015
clear all
clc
rgb=imread('D:\aa\final\Back ground\background.jpg');
subplot(2,2,1);
imshow(rgb),title('Original RGB');
[ row col wid ] = size(rgb);
wid=3
% Log transformation
for i=1:size(rgb,1)
for j=1:size(rgb,2)
inb = double(rgb(i,j,wid)+1);
Lb(i,j,wid) = log2(inb);
end
end
% Exponantial transformation
for i=1:size(rgb,1)
for j=1:size(rgb,2)
inb = double(Lb(i,j,wid)+1);
Eb(i,j,wid) = exp(inb);
end
end
logTg = (Lb/(max(Lb(:))))*255;
expTg = (Eb/(max(Eb(:))))*255;
subplot(2,2,2);
imshow(logTg,[]),title('Log Transformed');
subplot(2,2,3);
imshow( expTg ,[]) , title('Exponential of Log Transformed');
subplot(2,2,4);
e=expTg;
imshow( e ) , title(' B Exponential of Log Transformed');

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 12 May 2015
Is the question to save the elements as colored on the screen ? If so then use the File Exchange Contribution freezeColors and then get() the CData field of the image() object. For example,
h = image(expT, []);
freezeColors();
fullimage = get(h, 'CData');
  1 Comment
Amir Khan
Amir Khan on 12 May 2015
please change the value of wid
[ row col wid ] = size(rgb); wid=1
the result is
basically i want to get its rotten area
if i put your code
h = image(expT, []);
freezeColors();
fullimage = get(h, 'CData');
Error in RGB_expo_R_G_B_2_R (line 61) h = image(expT, []);

Sign in to comment.

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!