フィルターのクリア

Problems applying algorithm to multiple images

1 回表示 (過去 30 日間)
Philip
Philip 2012 年 7 月 30 日
Hi my aim is to remove noise and segment bacteria from time lapse microscopy images. So far I have created a function to that does this and can be applied to any of the images independently. I would like to create a new function or adapt the present one to loop over the images and apply the algorithm. I have looked at the Matlab help page Batch Processing Images in Parallel and after following the instructions I get the following error Error in ==> batchProcessFiles at 12 Cell contents reference from a non-cell array object. The line mentioned reads I = imread(fileNames{1}); I am confused as fileNames is a cell array object containing all the images to be looped over. Also I am getting a warning stating that variable fcn is indexed but not sliced in a parfor loop. The lines of code are parfor (k = 1:nImages)
I = imread(fileNames{k});
segmentedCellSequence(:,:,k) = fcn(I);
  1 件のコメント
Image Analyst
Image Analyst 2012 年 7 月 30 日
What is fcn? What does "indexed but not sliced" mean? (I don't have the parallel toolbox, in case those are special parallel terms.) Is fcn an array or a function? If it's an array, how can it take a 2D or 3D image as an index?

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

回答 (2 件)

Walter Roberson
Walter Roberson 2012 年 7 月 30 日

gargoyle
gargoyle 2012 年 8 月 2 日
as i understand this: you have a function which you want to apply to every image in a folder. assuming that is what you want. try the following:
get the file list from your folder with images (root)
root='C:\some path\'; % you can enter your path here
file_list=dir([root '*.tiff'])% here i assume you have a tiff file and you will %get all the tiff files in the folder
%now the for loop:
for count=1:numel(file_list)
img=imread([root file_list(count).name]) %this will open the images you can %also try something called bfopen (search for it) if you dont have raw tiff %files
%use img to run your code on
end
  1 件のコメント
gargoyle
gargoyle 2012 年 8 月 2 日
OOPS. Walter already covers this with his link and there is some error checking also included there.

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

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by