help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with images loading


From: olga_kruglova
Subject: Re: Problem with images loading
Date: Mon, 21 Mar 2011 02:10:12 -0700 (PDT)

Program was running fine and all of the sudden I have problem. When I try to
run it gives me an error "error: A(I): Index exceeds matrix dimension.
error: called from:
error:   Images.m at line 5, column 3"
And I haven't change anything. Would it be possible to help me?
tifDir='C:\01m_nacl_4v_10hz';
filePaths =dir([tifDir '*.tif']);
fileNames = {filePaths.name};
numberOfImageFiles = numel(fileNames);
I = imread( fileNames{1});

subtractedSequence = zeros([size(I) numberOfImageFiles],class(I));
subtractedSequence(:,:,1) = I;

for i = 2 : numberOfImageFiles
        priorImage{i-1} = imread([tifDir fileNames{i-1}]);
        currentImage{i} = imread([tifDir fileNames{i}]);
        subtractedSequence = currentImage{i} - priorImage{i-1};
        priorImage = currentImage;
        outputFileName = sprintf('Subtraction_%d.tif',i);
                           imwrite(subtractedSequence, outputFileName ); 
        end
Thank you very much in advance!

Olga

--
View this message in context: 
http://octave.1599824.n4.nabble.com/Problem-with-images-loading-tp3340938p3392993.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]