nstart = 260;
nend = 700;
Height = (90:370);
Width1 = (94:796);
Width2 = (1060:1775);
load('Crop1.mat')
numberOfCells = length(Crop1);
freezingLine1 = zeros(1, numberOfCells);
L1 = round((length(Width1)/3)):round((2*length(Width1)/3));
for k = 1:numberOfCells
thisCell = Crop1{k};
if ~isempty(thisCell)
subplot(2, 2, 1);
imshow(thisCell);
axis on;
caption = sprintf('Frame %d of %d', k, numberOfCells);
title(caption, 'FontSize', fontSize);
croppedImage = thisCell(1:length(Height), L1);
subplot(2, 2, 2);
imshow(croppedImage);
axis on;
title(caption, 'FontSize', fontSize);
[rows, columns] = size(croppedImage);
bottomLine = zeros(1, columns);
for col = 1 : columns
bottomLine(col) = find(croppedImage(:, col), 1, 'last');
end
subplot(2, 2, 3);
plot(bottomLine, 'b-', 'LineWidth', 2);
ylim([1, rows]);
xlim([1, columns]);
title('Bottom Pixels', 'FontSize', fontSize);
xlabel('Column', 'FontSize', fontSize);
ylabel('Row', 'FontSize', fontSize);
grid on;
medianValue = median(bottomLine);
mad = bottomLine - medianValue;
goodIndexes = mad <= 3;
freezingLine1(k) = mean(bottomLine(goodIndexes));
subplot(2, 2, 4);
plot(freezingLine1, 'b-', 'LineWidth', 2);
grid on;
title('Freezing Line Row1', 'FontSize', fontSize);
xlabel('Frame', 'FontSize', fontSize);
ylabel('Row', 'FontSize', fontSize);
drawnow;
end
end
0 Comments
Sign in to comment.