由买买提看人间百态

topics

全部话题 - 话题: imwrite
1 (共1页)
PK
发帖数: 1153
1
来自主题: Computation版 - matlab 图像处理疑问
我有24张512*512的16位Intensity Image
用imread把每张图读进matlab,然后把每张剪裁一下,拼成一个620*930的图Ione
让后我想用imwrite把Ione存出来,可是却总有下面的错误
imwrite(Ione,'ww.tif','tif');
??? Error using ==> imagesci\private\writetif
Couldn't open 'ww.tif' for writing.
Error in ==> imwrite at 384
feval(fmt_s.write, data, map, filename, paramPairs{:});
而且奇怪的是当我用同样的方法去处理另外一组20张512*512的16位Intensity Image时
却没有任何问题
唯一区别在于这组的Ione只有348*435。
对matlab图像处理不太熟悉,希望大虾指点
z*y
发帖数: 1311
2
来自主题: ComputerGraphics版 - JPEG2000 Question
Thanks, but not work very well.
I use C.
Here is the code I generate data.
FILE *f_out = fopen("LL.dat", "wb");
fwrite(LL, sizeof(short int), 256*256, f_out);
fclose(f_out);
Then I try Matlab.
f = fopen('LL.dat', 'rb');
d = fread(f, [256,256], 'int16');
imwrite(d, 'LL.jpg', 'jpg', 'BitDepth', 16, 'Mode', 'lossless');
imwrite(d, 'LL.png', 'png', 'BitDepth', 16);
The image is not right. BTW, data LL is correct.
I verify using other ways.
Thank you for the help.
h***n
发帖数: 276
3
【 以下文字转载自 EE 讨论区 】
【 原文由 jinghanna 所发表 】
I have a sequence of grayscale images, and want to write them into one image
file, for example *.tiff file. How can I do this?
I know maybe I can use the matlab function imwrite, but when I use this func
tion, I meet some problem.
I use the following command,
imwrite(X,map,filename,fmt)
How can I determine the map term above?
Thanks a lot for your kind help!
x5
发帖数: 27871
4
来自主题: PhotoGear版 - photoshop新手求教
imread,读进来是数组,随便怎么弄
完事再imwrite就可以了
l********a
发帖数: 1154
5
来自主题: ComputerGraphics版 - JPEG2000 Question
is this in matlab?
result =
[ LL LH
HL HH]
if size(result)=[m,n]
then
LL = result(1:m/2,1:n/2);
LH = result(1:m/2,n/2+1:end);
HL = result(m/2+1:end,1:n/2);
HH = result(m/2+1:end,n/2+1:end);
imwrite(LL,'ll.jpg','jpg'); % save LL
...
l******a
发帖数: 3803
6
来自主题: Linux版 - Matlab commandline

谢谢!
比如,ssh然后matlab -nodesktop.
用plot(xxxxx,xx)画图,然后,
imwrite存起来。
这样的话,figure是不是看不见?
但能存起来?
b*****l
发帖数: 9499
7
来自主题: Linux版 - Matlab commandline
不是 imwrite,用 savevas。
L****8
发帖数: 3938
8
生成图片的matlab代码
I=zeros(128,64);
I(1:3,:)=1;
for x=1:128
Ix=I;
for t=1:x
ya=32*(x-t)/(x-1)+32;
yb=-32*(x-t)/(x-1)+32;
for y=1:64
if y <= ya && y >= yb
Ix(t,y)=1;
end
end
end
imwrite(Ix, ['Image' num2str(x) '.png'])
end
x是瀑布下尖位置 完全决定瀑布的形状和外观
s*****a
发帖数: 1022
9
mov = aviread(filename);
得到一个struct array mov
然后循环一下
i=1:whatever
a=frame2im(mov(i));
imwrite(a,whatever);
不难吧
BTW, 我用的是matlab 6.5.0.180913a (R13) campus license
j**u
发帖数: 6059
10
imwrite(D,map,'gif_example.gif','DelayTime',0.2,'LoopCount',inf)
k***n
发帖数: 383
11
来自主题: Computation版 - matlab能输出成PS格式的图片吗
我说的是把图片写成PS或EPS
比如
imwrite(a,'a.ps')
or eps.
能这么做吗?
C***S
发帖数: 175
12
来自主题: Computation版 - matlab能输出成PS格式的图片吗
seems .ps format is not supported by imwrite function.
you may try print('-deps', filename)
check the online manul for more detailed information.
s*s
发帖数: 100
13
来自主题: Computation版 - 如何从3d矩阵产生一个3维的图?
就是说有个M*N*K的矩阵, 每个位置上的值代表空间中的那
一点的灰度, 怎么才能搞出3d 的图?
二维的我知道,matlab 中的imwrite就可以做到, 也可以直接
产生ppm, ptm的格式的图片,但是3d的,我就搞不定了.
要是plot3,可以有个参数表示灰度就好了...
有谁知道怎搞么? 谢谢了
听说可以用vff格式,网上找了半天,p也没找到...
g******s
发帖数: 733
14
temp2=kron(temp,ones(8));
temp2=uint8(temp2);
imwrite(temp2, 'filename.bmp','bmp');
程序执行到第一行就说内存不够。请问怎么不占内存地把数据temp2写入图像文件?
先谢了!
d*******2
发帖数: 340
15
现在我用
imwrite(my_matrix,'my_bmp.bmp');
得到位图,但是CAD软件需要矢量图,请问有什么办法由一个二值(0和1)矩阵得到一个
精确的矢量图吗?先谢了!
s*****c
发帖数: 753
16
来自主题: EE版 - Re: Matlab Guru please help

Just write your own script to plot the data into a 2D
matrix, and then use imwrite.
So that script should know what resolution the jpg file will
be (can be a constant like 640*480 or can be taken as
parameter). That script should be able to determine the
scale to use (maxx, minx, maxy, miny) and calculate a
conversion factor. You have to create the marker, axis,
label (at least 0-9 and "." to mark the axis)etc. yourself.
If your figures have same scale, you can just copy the outer
part of the f
t******r
发帖数: 41
17
来自主题: EE版 - paper的图片dpi问题
matlab imwrite函数有option可以改dpi
t**t
发帖数: 9
18
如果是大批量的话,matlab的图像包就很合适.
核心程序就一行:
imwrite(imread(sFileName, srcfmt), strrep(sFileName, srcfmt, dstfmt), dstfmt);
支持很多格式.
f*******a
发帖数: 663
19
来自主题: DataSciences版 - Science上新clustering算法的分析测试
开始忘贴代码了,有朋友要求,就把修改后的代码贴在这里。改动不多,可以部分提升
效率。原来的也没删,注释掉了。供参考。
=========================================================================
clear;
close all
disp('The only input needed is a distance matrix file')
disp('The format of this file should be: ')
disp('Column 1: id of element i')
disp('Column 2: id of element j')
disp('Column 3: dist(i,j)')
if(0)
% mdist=input('name of the distance matrix file (with single quotes)?\n'
);
mdist = 'example_distances.dat';

disp('Reading input dis... 阅读全帖
1 (共1页)