如何从matlab文件夹读取图像 [英] How to read images from folders in matlab

查看:360
本文介绍了如何从matlab文件夹读取图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有六个这样的文件夹>> 图片
和每个文件夹包含一些图像。我知道如何读取matlab中的图像,但我的问题是我如何遍历这些文件夹和读取abc.m文件中的图像(这个文件显示在这个 image )任何帮助都会有所帮助。因此,基本上你想读取不同文件夹中的图像,而不必将所有的图像放入一个文件夹,并使用 imread()?因为你可以复制所有的图像(并且以一种让你知道它来自哪个文件夹的方式命名)到你的MATLAB工作目录中,然后以这种方式加载它们。

使用 cd 命令更改目录(如* nix),然后在遍历每个文件夹时加载/读取图像。您可能需要绝对路径名称。


I have six folders like this >> Images and each folder contains some images. I know how to read images in matlab BUT my question is how I can traverse through these folders and read images in abc.m file (this file is shown in this image) any help will be helpful. thanks in advance.

解决方案

So basically you want to read images in different folders without putting all of the images into one folder and using imread()? Because you could just copy all of the images (and name them in a way that lets you know which folder they came from) into a your MATLAB working directory and then load them that way.

Use the cd command to change directories (like in *nix) and then load/read the images as you traverse through each folder. You might need absolute path names.

这篇关于如何从matlab文件夹读取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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