用matlab处理Raw格式的图像文件的方法

作者在 2008-06-22 18:08:45 发布以下内容
% It depends on your RAW data format.
% Try this example:

function raw(dim1,dim2)
[filename pathname] = uigetfile('*.raw','Please select a RAW file');
fid = fopen([pathname filename],'rb','ieee-be');
shift = fseek(fid, -dim1*dim2*4,'eof');
img = fread(fid,[dim2, dim1],'float32');
imshow(img, []);
status = fclose(fid);
图像 | 阅读 31225 次
文章评论,共1条
vfdff(作者)
2008-12-30 12:35
1
matlab 绘图<br />
<br />
MATLAB包含了大量的二维和三维绘图命令。其中最基本的命令是“plot”,它有多个可选参数。用这个命令画一个时间函数作为一个简单的例子。<br />
t = linspace(0, 8, 401); %Define a vector of times from 0 to 8 s with 401 points<br />
x = t.*exp(-t).*cos(2*pi*4*t); %Define a vector of x values<br />
plot(t, x); %Plot x vs t<br />
xlabel(‘Time(s)’); %Label time axis<br />
ylabel(‘Amplitude’); %Label amplitude axis<br />
该脚本生成的图如图1所示。<br />
7.1 简单绘图命令<br />
简单的二维绘图命令包括 8<br />
plot 连续函数在线性坐标上绘图<br />
stem 离散采样在线性坐标上绘图<br />
loglog 对数x和y轴<br />
semilogx 线性y轴和对数x轴<br />
semilogy 线性x轴和对数y轴<br />
bar 条线图<br />
errorbar 误差条线图<br />
hist 柱状图<br />
polar 极坐标图<br />
7.2 自定义绘图<br />
自定义绘图有很多命令,用注释,标题,坐标轴名称等等。一些最常用的命令有<br />
xlabel 为x轴命名<br />
ylabel 为y轴命名<br />
title 为绘图命名<br />
grid 为绘图加网格<br />
gtext 允许用鼠标定位文本<br />
text 允许在图的指定坐标放置文本<br />
axis 运行改变x和y轴<br />
figure 生成一个图形对象<br />
figure(n) 使当前图像的图像句柄为n<br />
hold on 允许在同一坐标轴上绘制多个图<br />
hold off 释放保持当前绘图<br />
close(n) 关闭第n号图像<br />
subplot(a,b,c) 生成a×b矩阵的绘图,当前图形为第c个<br />
orient 指定图形方位
游客请输入验证码
浏览1943000次