--------------0402? 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 [crossingP] = nextCrossing(roadPoints, point, crossingPoints, markedRoad) 0003 %--------------0402? 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 crossingP = []; 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(roadPoints, x, y) 0018 if markedRoad(x,y) == 5 0019 crossingP = [x y]; 0020 end; 0021 end; 0022 y = y + 1; 0023 end; 0024 x = x + 1; 0025 y = sy; 0026 end; 0027 0028 0029 0030