关于matlab制作gif中matlab的imwrite函数数的delaytime

matlab中imwrite函数输出tif影像问题_百度知道
matlab中imwrite函数输出tif影像问题
请问imwrite函数如何输出指定路径的tif影像,影像像元值在0-1范围内(数据数组就是0-1的数组)在线等啊
我有更好的答案
0-1是normalize过的图像,你需要给他转化回uint。例如imwrite(im2uint8(Img),'A.tif');
我需要输出的就是0-1范围内的double型,现在以输出就是unit,怎样解决
那你需要的不是保存成图片,是保存成文本或者.mat文件。图像都是uint类型的。或者你保存成图片,读取之后再用im2double转化成0-1之间
采纳率:72%
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。只需一步,快速开始
扫一扫,访问微社区
查看: 16171|回复: 6|关注: 0
Matlab如何使用imwrite函数时用变量来命名图片
<h1 style="color:# 麦片财富积分
新手, 积分 5, 距离下一级还需 45 积分
比如我要做一个循环,批量产生图片,然后使用imwrite函数来保存,如果我要根据循环的次数来对图片进行命名,应该怎样处理??如第一次循环产生的图片命名为pic_1.bmp,第二次循环产生的图片为pic_2.bmp,怎样来实现,谢谢!!!!!!!
<h1 style="color:# 麦片财富积分
image=pic(i);
imwrite(image,strcat('pic_',num2str(i),'.bmp')); %关键是这句
人生永远追逐着幻光,但谁要把幻光当成幻光,谁变沉入了无底的苦海。
<h1 style="color:# 麦片财富积分
谢谢你的无私帮助!
<h1 style="color:# 麦片财富积分
不会的东西真多,好好学习,谢谢分享啦!
<h1 style="color:# 麦片财富积分
恩。真的很好用。我原先以为变量可以呢。原来必须得把strcat写在参数的位置才可以!谢谢高手,受教了!
<h1 style="color:# 麦片财富积分
fei chang ganxie
<h1 style="color:# 麦片财富积分
站长推荐 /4
筑起功能安全的堡垒 - 基于模型设计的软件开发
MATLAB中文论坛是全球最大的 MATLAB & Simulink 中文社区。用户免费注册会员后,即可下载代码,讨论问题,请教资深用户及结识书籍作者。立即注册加入我们吧!
MATLAB官方社交平台
MATLAB中文论坛微社区频道本月排行
随机推荐文章
Copyright (C) 2006 - 2016 www.eorder.net.cn
All Rights Reservedmatlab的imwrite函数_百度知道
matlab的imwrite函数
imshow(A);显示的图像是一片白,然后imwrite(A,&#39;a.bmp&#39;)保存的图片也是一片白。imshow(A,[ ]);显示的图像有灰度差别了,但是怎么把这样效果的图保存下来?用imwrite怎么用?求指教
我有更好的答案
是你的数据类型有问题。你的矩阵A需要是uint8类型才可以那样做。A1 = uint8(A);imshow(A1);imwrite(A1,&#39;a.bmp&#39;)
确实是这样。我之前矩阵A是double型的。为什么一定 uint8类型才可以?
一般的图像的格式都是8位无符号整数,matlab里叫uint8.值在[0,255]范围内
采纳率:72%
为您推荐:
其他类似问题
imwrite的相关知识
&#xe675;换一换
回答问题,赢新手礼包&#xe6b9;
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
for i=1:8 & %图片数& & Img=imread(['D:\software\taylor\' num2str(i) '.jpg']);& & imshow(Img,[]);%可以看到图像的变化,若去掉,直接保存起来了,不会显示& & frame=getframe(gcf);& & im=frame2im(frame);%制作gif文件,图像必须是index索引图像& & [I,map]=rgb2ind(im,256);& & if i==1;& & & & imwrite(I,map,'D:\software\oceanmodel\matlab\test.gif','gif','Loopcount',inf,...& & & & & & 'DelayTime',0.1);&& & else& & & & imwrite(I,map,'D:\software\oceanmodel\matlab\test.gif','gif','WriteMode','append',...& & & & & & 'DelayTime',0.1);&& & endend本人试过,可以出来gif图&问题1:但出现下列提示,目前还不知道问什么,如果看到的能够解答一下,不甚感激& & &警告: Image is too
displaying at 67%&& & && In imuitools\private\initSize at 71& & &In imshow at 282& & &In makegif at 5&!!!!已解决()&%imshow(Img,[]);把此式去掉即可,????但是为什么会说&Image is too big to fit on screen??????尚不明白问题2: & &若把if语句去掉改为 & &imwrite(I,map,'D:\software\oceanmodel\matlab\test.gif','gif','WriteMode','append',...& & & & & & 'DelayTime',0.1,'Location',[10,15],'screensize',[100,106]);&& & &则保存的动图打开之后,位置会变,而且存的gif图由原先的200多kb增加到1m,这是为什么& 已解决:去掉if语句之后,再把问题1中红色部分去掉即可,介绍一下有些函数的功能,可以help ~查看(一)imread:Read image from graphics fileSyntaxA = imread(filename, fmt)[X, map] = imread(...)[...] = imread(filename)[...] = imread(URL,...)[...] = imread(...,Param1,Val1,Param2,Val2...)descriptions1.The return value A is an array containing&the image data.2.The text string fmt specifies the&format of the file by its standard file extension. For example, specify 'gif' for&Graphics & & & & & & & &Interchange Format files. To see a list of supported formats,&with their file extensions, use the imformats function.If imread & &cannot find a file named filename,&it looks for a file named filename.fmt.3.[X, map] = imread(...) reads the indexed&image in filename into X and&its associated colormap into map. Colormap values&in & & & & & &the image file are automatically rescaled into the range [0,1](二)imwrite: &Write image to graphics fileSyntaximwrite(A,filename)&imwrite(A,map,filename)&imwrite(___,fmt)&imwrite(___,Name,Value)GIF — Graphics Interchange &Format1.map — Colormap of indexed imagem-by-3 array& &Colormap associated with indexed image data in A,specified as an m-by-3 array. map must&be a valid MATLAB colormap.& &See colormap for&a list of built-in MATLAB colormaps. Most image file formats&do not support colormaps with more than 256 & & &entries.& & Example: [0,0,0;0.5,0.5,0.5;1,1,1]& &Example: jet(60)Data Types: double2.&DelayTime' — Delay before displaying next image& 0.5 (default) | scalar value in the range [0,655]& Delay before displaying next image, &in seconds, specified as&the comma-separated pair consisting of 'DelayTime' and&a &scalar value in the range [0,655]. A value of 0 displays&images as fast as your hardware allows.& Example: 'DelayTime',603.LoopCount' — Number of times to repeat animationInf&& (default) | integer in the range [0,65535]& Number of times to repeat the animation, specified as the comma-separated&pair consisting of 'LoopCount' and either an & &integer&in the range [0,65535], or the value Inf.&If you specify 0, the animation plays once. If you specify the value&1, the &animation plays twice, and so on. A LoopCount value&of Inf causes the animation to continuously loop.&To enable animation &within&Microsoft? PowerPoint?, specify&a value for 'LoopCount' within the range [1,65535].&Some Microsoft applications &interpret the value 0 to mean do&not loop at all.&Example: 'LoopCount',34.'WriteMode' — Writing mode& &'overwrite' (default) | 'append'& Writing mode, specified as the comma-separated pair consisting&of 'WriteMode' and either 'overwrite' or 'append'.In overwrite & mode, imwrite overwrites&an existing file,filename. In append mode, imwrite adds&a single frame to the existing file.& Example: 'WriteMode','append'(三)frame2im:Return image data associated with movie frame& & Syntax& &[X,Map] = frame2im(F)& &Description& &[X,Map] = frame2im(F) returns&the indexed image X and associated colormap Map from&the single movie frame F. If the & &frame contains&true-color data, the m-by-n-3&matrix Map is empty. The functions getframe and im2frame create&a movie frame.(四)im2frame:Convert image to movie frame&&Syntax& f = im2frame(X,map)& f = im2frame(X)(五)getframe returns a movie&frame, which is a structure having two fields:cdata — The image data stored& as a matrix of uint8 values. The dimensions of F.cdata are&height-by-width-by-3.colormap — The colormap&stored as an n-by-3 matrix of doubles. F.colormap is&empty on true color systems.To capture an image, use this approach:& F = getframe(gcf);& image(F.cdata)&colormap(F.colormap)(六)drawnow:update figure window and execute pending callbacks(七)rgb2ind:Convert RGB image to indexed image& [X,map] = rgb2ind(RGB,n)&&converts&the RGB image to an indexed image X using minimum&variance quantization and dithering. map contains&at most n &colors. n must be&less than or equal to 65,536.(八)ind2rgb:Convert indexed image to RGB&& &RGB = ind2rgb(X,map)& &RGB = ind2rgb(X,map) converts&the indexed image, X, and the corresponding colormap, map,to the truecolor image, RGB.& The indexed image, X,is an m-by-n array of integers. The colormap, map,is a three-column array of values in the range [0,1]. & Each row of map is&a three-element RGB triplet that specifies the red, green, and blue&components of a single color of the colormap.&(九)imshow:Display image(十)gcf:Current figure handle&&h = gcf && h = gcf returns the current figure handle.If a figure does not exist, then gcf creates a&figure and returns its handle. You can use & the figure handle to query&and modify figure properties. &(十一)gca:Current axes handle(坐标轴)&h = gcah = gca&returns the&handle to the current&axes for the current figure. If an axes does not exist, then gca creates&an axes and returns its handle. You can use the axes handle to query&and modify axes properties. For more information, see Axes Properties.
阅读(1957)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'matlab制作gif图,并保存',
blogAbstract:'首先文件下存有一系列的图(按顺序命名的),如1.jpg,2.jpg,3.jpg等基本思想是 imread(读取图片信息)——处理——imwrite(存取)for i=1:8 & %图片数& & Img=imread([\'D:\\software\\taylor\\\' num2str(i) \'.jpg\']);& & imshow(Img,[]);%可以看到图像的变化,若去掉,直接保存起来了,不会显示& & frame=getframe(gcf);& & im=frame2im(frame);%制作gif文件,图像必须是index索引图像',
blogTag:'',
blogUrl:'blog/static/1',
isPublished:1,
istop:false,
modifyTime:7,
publishTime:8,
permalink:'blog/static/1',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}}

我要回帖

更多关于 matlab delay函数 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信