Azzera filtri
Azzera filtri

TimeCross-correlation of image sequences?

3 visualizzazioni (ultimi 30 giorni)
Osman
Osman il 22 Mag 2015
I want to estimate the image velcoity field using "temporal cross correlation algorithm" in the following paper: Crone, Timothy J., Russell E. McDuff, and William SD Wilcock. "Optical plume velocimetry: A new flow measurement technique for use in seafloor hydrothermal systems." Experiments in fluids 45, no. 5 (2008): 899-915. First I save the images in one folder and converted as array. The cross correlation correlation function implemented between two points (say I(1,1) and I(5,1) where I is the image depending on the function in the above paper. and repeat that over time depending on lag number. Can one check for me, I am new in Matlab coding what is wrong in this code? `myFolder = 'C:\Users\User\Documents\MATLAB\Preprocessing\MyCode'; if ~isdir(myFolder) errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder); uiwait(warndlg(errorMessage)); return; end % Create an array of filenames that make up the image sequence fileFolder = fullfile(myFolder, '*.jpg'); dirOutput = dir(fileFolder); fileNames = {dirOutput.name}'; numFrames = numel(fileNames); %% % Create image sequence array.. for p = 1:numFrames sequence(:,:,p) = double(rgb2gray(imread(fileNames{p}))); im_crop(:,:,p) = imcrop(sequence(:,:,p),[45.25 6.75 161.5 247]); end I = im_crop(:,:,1); im_crop = sequence; [m n p] = size(im_crop); d = 5; L = 2; lag = 1; for d = 1:5 for lag = 1:p %numFrames for i = 1 : m - d for j = 1:n - L for k = 1:p-lag % Find the correlation for each lag number.. C(i,j,lag,d) = im_crop(i+d,j+L,k)* im_crop(i,j,k+lag);
[Cmax(i,j,lag,d), lm(i,j,lag)] = max(C(i,j,lag,d));
end
end
end
end`

Risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by