I have series of images something look like this.
each image was taken with increment of time (interval of 5 seconds) and I need to compute the area of each image then make a graph (x-axis: time , y-axis: area)
I think I should use loop function (repeating same method), and length (to calculate the number of file) Then at the end, make a graph. But
@@@@@@@@@@@@Here is my code which opens just one image. (works well)@@@@@@@@@@@@@@
a=imread ('rose1.jpg'); % read image
b= rgb2gray (a); %chagne to gray image
c= im2bw(b) % change to black and white image
regions1and2 = imclearborder(~c); clear the border regionarea = bwarea(regions1and2); % calculate the area of region 1 and 2
@@@@@@@@@here is other code that does not work well@@@@@@@@@
clc;clear;path= 'F:\Thesis data\'file= dir([path 'jpg']); n_file=length(file); count number of filesx = 1:1:10for i = 1:n_filetemp = imread([path file(i).name])'temp2 = rgb2gray (temp)temp3 = im2bw(temp2)temp4 = imclearborder(~temp3);area = bwarea(temp4);endplot(x,i);xlabel('Time(second)','FontSize',10)ylabel('area','FontSize',10)
Best Answer