close all; clear; clc;
global debugLevel_01;
global L1;
global L2;
global SUM_L1_L2;
debugLevel_01 = 1;
L1 = 110.0;
L2 = 140.0;
SUM_L1_L2 = L1 + L2;
maximum_x_limit = SUM_L1_L2;
maximum_y_limit = SUM_L1_L2;
minimum_x_limit = - SUM_L1_L2;
minimum_y_limit = - SUM_L1_L2;
width = abs(minimum_x_limit) + abs(maximum_x_limit);
height = abs(minimum_y_limit) + abs(maximum_y_limit);
I = zeros(height, width, 3);
debugLevel_01 = 0;
dy = maximum_y_limit;
for row = 1 : height
dx = minimum_x_limit;
for col = 1 : width
switch isReachable( dx, dy )
case -1
I(row, col, 1) = 0; I(row, col, 2) = 0; I(row, col, 3) = 1;
case -2
I(row, col, 1) = 0; I(row, col, 2) = 1; I(row, col, 3) = 0;
case -3
I(row, col, 1) = 0; I(row, col, 2) = 1; I(row, col, 3) = 1;
case -4
I(row, col, 1) = 1; I(row, col, 2) = 0; I(row, col, 3) = 0;
case -5
I(row, col, 1) = 1; I(row, col, 2) = 0; I(row, col, 3) = 1;
case 2
I(row, col, 1) = 1; I(row, col, 2) = 1; I(row, col, 3) = 0;
case 1
I(row, col, 1) = 1; I(row, col, 2) = 1; I(row, col, 3) = 1;
end
dx = dx + 1;
end
dy = dy - 1;
end
imshow(I);
title('WHITE and YELLOW color shows the Reachable co-ordinates');
saveas(gcf,'output.jpg')
J=I; imwrite(J,'background_c0.bmp');
J=I + 0.1; imwrite(J,'background_c1.bmp');
J=I + 0.2; imwrite(J,'background_c2.bmp');
J=I + 0.3; imwrite(J,'background_c3.bmp');
J=I + 0.4; imwrite(J,'background_c4.bmp');
J=I + 0.5; imwrite(J,'background_c5.bmp');
J=I + 0.6; imwrite(J,'background_c6.bmp');
J=I + 0.7; imwrite(J,'background_c7.bmp');
J=I + 0.8; imwrite(J,'background_c8.bmp');
J=I + 0.9; imwrite(J,'background_c9.bmp');