Home > src > BN_pol_rec > functions > identifyRoads.m

identifyRoads

PURPOSE ^

----------------RS 040211-----------------------------------------

SYNOPSIS ^

function [node1Node2Road_noCost, positionRoad_no, markedRoad, nodes] = identifyRoads(roadPoints, crossingPoints)

DESCRIPTION ^

 ----------------RS 040211-----------------------------------------
 identify roads from points and crossing point assess them cost 
 node1Node2Road_noCost = [crossing1, crossing2, road number j, cost from
 crossing1(node 1) to crossing2(node 2) by using road number j]
 positionRoad_no = [x, y, road number]
 roadPoints = matrix of points that are classified as roadpoints, pixel
 with poistion roadPoints(x,y) = 1 if (x,y) pixle is a road
 crossingPoints = croosing of roads 
 --------------------------------------------------------------------

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 
0003 function [node1Node2Road_noCost, positionRoad_no, markedRoad, nodes] = identifyRoads(roadPoints, crossingPoints)
0004 
0005 % ----------------RS 040211-----------------------------------------
0006 % identify roads from points and crossing point assess them cost
0007 % node1Node2Road_noCost = [crossing1, crossing2, road number j, cost from
0008 % crossing1(node 1) to crossing2(node 2) by using road number j]
0009 % positionRoad_no = [x, y, road number]
0010 % roadPoints = matrix of points that are classified as roadpoints, pixel
0011 % with poistion roadPoints(x,y) = 1 if (x,y) pixle is a road
0012 % crossingPoints = croosing of roads
0013 % --------------------------------------------------------------------
0014 
0015 
0016 %Initialisation
0017 markedRoad = zeros(size(roadPoints));
0018 nodes = crossingPoints;
0019 %connective = zeros(size(roadPoints));
0020 positionRoad_no = [];
0021 node2 = [];
0022 rj = 0;
0023 c_i_node2_j = 0;
0024 node1Node2Road_noCost = [];
0025 listOfcrossings = crossingPoints;
0026 [sx1,sy1] = size(listOfcrossings);
0027 for h = 1:sx1
0028     markedRoad(listOfcrossings(h,1),listOfcrossings(h,2)) = 5;
0029 end;
0030 while sx1 > 0
0031 crossing = listOfcrossings(1,:);
0032 [sx1,sy1] = size(listOfcrossings);
0033     if sx1 >= 2
0034         listOfcrossings = listOfcrossings(2:sx1,:);
0035     else 
0036         listOfcrossings = [];
0037         sx1 = 0;
0038     end;  
0039 % for each crosing get non marked roads
0040 %markedRoad(crossing(1,1), crossing(1,2)) = 1;
0041 if crossing
0042   [candidateList,  markedRoad] = getCandidates(roadPoints, [crossing 0], markedRoad);
0043   [sx2,sy2] = size(candidateList); 
0044     if sx2 > 0
0045                 for j = 1:sx2
0046                  %for each road from crossing point(i) find roads j
0047                 [reachedCrossing, markedRoad, nodes, node1Node2Road_noCost, positionRoad_no] = breadthFirst(roadPoints, [candidateList(j,1) candidateList(j,2) 1] , crossingPoints, markedRoad, node1Node2Road_noCost, positionRoad_no, nodes, crossing);
0048                 node1Node2Road_noCost = node1Node2Road_noCost;
0049                 positionRoad_no = positionRoad_no;
0050                 nodes = nodes;
0051                 end; % end for each road
0052      end; % end if candidateList not empty
0053  end;
0054 end; % end for each crosing
0055 
0056 
0057         
0058

Generated on Wed 16-Mar-2005 09:17:47 by m2html © 2003