, , . , , , , , .
, , > Jacob's , , . , , .
, , . , :
- , , 0, 1.
- , 1, 1.
- , , 0, 1.
- .
- .
- x .
- 1 .
:
[img,map] = imread('original_chart.gif'); %
[r,c] = size(img); %
redIndex = find((map(:,1) == 1) & ... %
(map(:,2) == 0) & ...
(map(:,3) == 0))-1;
greenIndex = find((map(:,1) < 1) & ... %
(map(:,2) == 1) & ...
(map(:,3) < 1))-1;
blueIndex = find((map(:,1) == 0) & ... %
(map(:,2) == 0) & ...
(map(:,3) == 1))-1;
redLine = (img == redIndex); %
greenLine = (img == greenIndex); %
blueLine = (img == blueIndex); %
w = mean(diff(find(sum(greenLine,1) > r/2))); %
h = mean(diff(find(sum(greenLine,2) > c/2))); %
squareArea = w*h; %
[maxValue,maxIndex] = max(redLine); %
x = find(maxValue > 0); %
y = maxIndex(maxValue > 0); %
[maxValue,maxIndex] = max(sum(blueLine,2)); %
y = maxIndex-y; %
totalArea = trapz(x,y)/squareArea; %
:
squareArea = 460.6 square pixels
totalArea = 169.35 m*h
:
, w:
h , , r/2 c/2 ( ).