--------------040209 RS------------------------------------------- Roads = contains all roadpoints point = pixel on the map, n markedRoad = all pixles that are already used for candiadates nodeList = contains all crossing points candidateList = returns list of neighbour points that are road points ---------------------------------------------------------------------
0001 0002 function [candidateList, markedRoad] = getCandidates(Roads, point, markedRoad) 0003 %--------------040209 RS------------------------------------------- 0004 %Roads = contains all roadpoints 0005 %point = pixel on the map, n 0006 %markedRoad = all pixles that are already used for candiadates 0007 %nodeList = contains all crossing points 0008 %candidateList = returns list of neighbour points that are road points 0009 %--------------------------------------------------------------------- 0010 candidateList = []; 0011 sx = point(1) - 1; 0012 sy = point(2) - 1; 0013 x = sx; 0014 y = sy; 0015 for i = 1:3 0016 for j= 1:3 0017 if inMatrix(Roads, x, y) 0018 if (Roads(x,y) == 1)&&(markedRoad(x,y) == 0) 0019 markedRoad(point(1),point(2)) = 1; 0020 candidateList = [candidateList; x y (point(3)+1)]; 0021 markedRoad(x,y) = 1; 0022 end; 0023 % if (Roads(x,y) == 1)&&(connective(x,y) == 1) 0024 % markedRoad(point(1),point(2)) = 1; 0025 % connective(x,y) == 0; 0026 % candidateList = [candidateList; x y (point(3)+1)] 0027 % pause 0028 % markedRoad(x,y) = 1; 0029 % end; 0030 end; 0031 y = y + 1; 0032 end; 0033 x = x + 1; 0034 y = sy; 0035 end; 0036 0037 0038 0039