在Matlab中通过imwrite将图像写入文件夹 [英] writing a image to a folder via imwrite in Matlab

查看:164
本文介绍了在Matlab中通过imwrite将图像写入文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将图像写入文件夹,但imwrite没有指定文件夹名称的输入。有没有其他的功能。或者将图像存储到文件夹的方式。如果我这样做,也许我不喜欢,我很抱歉。

当我使用像folder1 / folder2 / img.jpg这样的文件名参数时,它不会创建相应的文件夹,它只是创建一个名为folder1 / folder2 / img.jpg的文件。



我也尝试使用mkdir,但也提供Permission拒绝在控制台上。



顺便说一下,我正在使用Linux。可能是关于权限的问题?

解决方案

filename - 你可以给它一个路径,无论是绝对的还是相对的,作为字符串的一部分。

  imwrite(img,'my / folder / images / file','jpg')

例如。


I try to write a image to a folder but imwrite has no input for specifying a folder name. Is there any other func. or way to store image to a folder. Maybe I amiss on imwrite if I do, I am sorry about it.

When I use a file name parameter like "folder1/folder2/img.jpg" it does not create folders accordingly and it just create a file named as "folder1/folder2/img.jpg"

I also try to use mkdir ahead in time but it also gives "Permission Denied" on console.

By the way I am using Linux. May be about permission problem?

解决方案

The filename parameter doesn't mean just the name - you can give it a path, either absolute or relative, as part of the string.

imwrite(img,'my/folder/images/file','jpg')

for example.

这篇关于在Matlab中通过imwrite将图像写入文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆