|
Peter Boettcher <boettcher@ll.mit.edu> wrote in message <muy63iili8f.fsf@G99-Boettcher.llan.ll.mit.edu>...
> "Oluwa KuIse" <wespeakforex@yahoo.com> writes:
>
> > Hello, Can anyone please help me out with the imwrite function. When
> > I use it, it creates the file quite alright but it doesn't display the
> > image. I have tried it with both the .png and .jpeg formats. Any
> > suggestions?
>
> What problem are you having? imwrite is supposed to create the file.
> It is not supposed to display anything. Are you looking for image() or
> imshow() instead? Or would you specifically like to do something with
> the image file after it is written?
>
> -Peter
Hi, Peter,
Thanks for your fast response. What I want to do is for MATLAB to be able to display my image in any file I want outside of MATLAB. The results (images) are to be displayed elsewhere and not on MATLAB's figure window. These are the last lines of the program:
source_color = im2uint8([.5 .5 1]);
E = im2uint8(mat2gray(E));
red = E;
green = E;
blue = E;
red(BW) = source_color(1);
green(BW) = source_color(2);
blue(BW) = source_color(3);
rgb_bottom = cat(3, red, green, blue);
imshow(rgb_bottom, 'InitialMag', 'fit')
% Make a second RGB image that is a constant green.
rgb_top = zeros(size(M,1), size(M,2), 3, 'uint8');
rgb_top(:,:,2) = 255;
% Turn the influence or dependence map into an AlphaData channel to be used
% to display with the green image.
M(BW) = 0;
M = imadjust(mat2gray(M), [0 1], [0 .6], 0.5);
image('CData', rgb_top, 'AlphaData', M);
Question: Image() displays the image in a MATLAB figure window. I want to be able to display this image in say, .jpeg.
Thank you!
|