Home > src > BN_pol_rec > functions > makeRoad.m

makeRoad

PURPOSE ^

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

SYNOPSIS ^

function [positionRoad_no, node2, nodes, c_i_node2_j, markedRoad] = makeRoad(rj, roadPoints, point, positionRoad_no, crossingPoints, markedRoad)

DESCRIPTION ^

------------------------040211 RS------------------------------------------
 rj = 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 function  [positionRoad_no, node2, nodes, c_i_node2_j, markedRoad] = makeRoad(rj, roadPoints, point, positionRoad_no, crossingPoints, markedRoad) 
0003 
0004 %------------------------040211 RS------------------------------------------
0005 % rj = road number
0006 % roadPoints = matrix of points that are classified as roadpoints, pixel
0007 % with poistion roadPoints(x,y) = 1 if (x,y) pixle is a road
0008    
0009  [c_i_node2_j, reachedCrossing, markedRoad2, nodes, endnode] = breadthFirst(roadPoints, [point 0], crossingPoints, markedRoad);
0010 
0011   %tag skillnaden newPoints = markedRoad\markedRoad2
0012   % kolla om size(markedRoad2) = size(markedRoad)
0013   diffrence = [];
0014   [sx, sy] = size(markedRoad);
0015   for i = 1:sx
0016       for j = 1:sy
0017         if (markedRoad2(i,j) ~= markedRoad(i,j))
0018             if (i ~= endnode(1,1))||(j ~= endnode(1,2))
0019                 diffrence = [diffrence; i j rj];
0020             end;
0021         end;
0022      end;
0023   end;   
0024    node2 = endnode;
0025    positionRoad_no = [point(1,1) point(1,2) rj ; diffrence];
0026    markedRoad = markedRoad2;
0027    
0028    
0029

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