Image analysis on multiple images

3 ビュー (過去 30 日間)
jchris14
jchris14 2014 年 8 月 6 日
回答済み: Image Analyst 2014 年 8 月 6 日
Hi,
is there a way to automate an image analysis code to run through several images rather than me having to insert each image using imread function?
thanks
  1 件のコメント
Evan
Evan 2014 年 8 月 6 日
Are you trying to process all the images located in a certain folder? Or only certain images, but you want to be able to select them all at the beginning?

サインインしてコメントする。

採用された回答

Evan
Evan 2014 年 8 月 6 日
編集済み: Evan 2014 年 8 月 6 日
You can use uigetfile to load in multiple images at once
help uigetfile
If the images are all of the same resolution, try something like this:
[fNames pName] = uigetfile('*.png','MultiSelect','on'); % change the first argument to whatever your image filetype is
for i = 1:numel(fNames)
img(:,:,:,i) = imread(fullfile(pName,fNames{i}));
end
If they differ in resolution, try this:
[fNames pName] = uigetfile('*.png'.'MultiSelect','on');
for i = 1:numel(fNames)
img{i} = imread(fullfile(pName,fNames{i}));
end
  2 件のコメント
jchris14
jchris14 2014 年 8 月 6 日
thank you
Evan
Evan 2014 年 8 月 6 日
No problem!

サインインしてコメントする。

その他の回答 (2 件)

Chris Turnes
Chris Turnes 2014 年 8 月 6 日
You can place the code you are running inside of a function that you write that takes as input the filename of the image that you want to process and produces whatever output you would like. You can read more about writing custom functions from the documentation. Once you have this function written, you can simply call it for each image that you would like to analyze.
Some pseudocode for this function might look like
function [output1, output2,...] = imageAnalysis(filename)
X = imread(filename);
% your analysis here
  1 件のコメント
jchris14
jchris14 2014 年 8 月 6 日
thank you Chris

サインインしてコメントする。


Image Analyst
Image Analyst 2014 年 8 月 6 日
Description
This GUI will help the novice user get up to speed very quickly on using GUI-based applications. Everything is laid out in a very simple Step 1, Step 2, Step 3, etc. layout. It is a very good starting point for a typical image analysis application. This application uses GUIDE to do the user interface design, and has most of the basic controls such as buttons, listboxes, checkboxes, radio buttons, scrollbars, etc. It allows the user to select a folder of images, select one or more images and display them, to select a series of options, and to individually or batch process one or more images. The user can .................

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by