필터 지우기
필터 지우기

image and imwrite colormap problem

조회 수: 2 (최근 30일)
Nikita Tarasov
Nikita Tarasov 2012년 11월 6일
Hello! I need to generate an image from matrix (like fluid jet) and save it as a picture. At the moment I use
mesh(dlmread(my_data.txt))
Then I choose X-Y projection and save it as a picture. It's is very cumbersome but colormap is applied correctly, 'Color data min' and 'Color data max' are set to appropriate min and max values of my data array.
But if I use image(dlmread(my_data.txt)) imwrite - colormap is set to default [0 1] (even though in colormap editor correct min max values displayed). How do I re-scale colormap for range of values in my data? Thank you in advance!
  댓글 수: 2
Image Analyst
Image Analyst 2012년 11월 6일
Can you give a short script demonstrating what you have so we can reproduce it?
Nikita Tarasov
Nikita Tarasov 2012년 11월 9일
Hello,
I've managed to make imwrite to save picture as grey image, still have problems with colormaps. That's what I'm trying to do:
min110=min(min(wave110.mat));
max110=max(max(wave110.mat));
img110=(wave110.mat-min110)./(max110-min110);
mapTrace=colormap(jet(256));
imwrite(img110,mapTrace,'110.tiff','tiff');
Where wave110.mat - matrix MxN. This code gives me blue (in case of 'jet' and red in case of 'hsv') picture. I've tried to cast img110 to uint8, uint16 - no luck.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Red에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by