Need help-Image Smoothing problem ?

2 views (last 30 days)
Annika
Annika on 4 Aug 2014
Commented: Annika on 5 Aug 2014
Hello,
I am working on a project, where I have to plot some COMSOL images. I choose to get data from COMSOL and plot it through MATLAB, as i have many images. Its a 2D plot.
I am attaching both the images. Problem is I get a very smooth image from COMSOL but when plotting it through MATLAB give me not so good image.
I tried using some noise filter , but could not get a good reslt.
Can some one suggest me, how can i smoothen the image?
First image is COMSOL generated and second is MATLAB plotted.
Thanks Anushka

Accepted Answer

Image Analyst
Image Analyst on 4 Aug 2014
You are just using a colorbar with not many colors (64) so it looks posterized. Use a colormap with higher precision/more colors
colormap(jet(256));
  2 Comments
Annika
Annika on 5 Aug 2014
May I also know how did you keep this number 256? What is the range of numbers that can be used? Cause when i inter-change the axis 'Y' to 'Z' and 'Z' to 'Y', i again view posterized image. I already tried using 128 and 64 instead of 256 but it still looks not ok. Below is the code i used and also attaching image,
if true
for i=3:length(datamat)
sig{i}=XY2Mat(datamat{1},datamat{2},datamat{i},200,250);
figure(i);
imagesc(sig{i});
caxis([-max(abs(datamat{i})) max(abs(datamat{i}))])
colormap(jet(512));
colorbar
xlabel('Y')
ylabel('Z')
hold on;
end
end

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!