Home > src > BN_pol_rec > functions > slask3.m

slask3

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 [A, map] = imread('r2.bmp', 'BMP');
0003 image(A), hold on
0004 roadPoints = findRoads(A);
0005 crossingPoints = [
0006    128   156
0007    131   156
0008    554   155
0009    540   310
0010    369   389
0011    366   391
0012    515   530];
0013 [node1Node2Road_noCost, positionRoad_no, markedRoad, nodes] = identifyRoads(roadPoints, crossingPoints);
0014 [sx, sy] = size(A(:,:,1));
0015 costMap = 3.*ones(sx,sy);
0016 for i = 1:sx
0017  for j = 1:sy
0018      if (roadPoints(i,j) == 1)
0019          costMap(i,j) = 1;
0020      end;
0021  end;
0022 end;
0023 clf
0024 vi = [639   239];
0025 fi = [669 131];
0026 image(A), hold on
0027  drowVi(vi(2), vi(1));
0028  drowRect(fi(2), fi(1));
0029 %plot(vi(2), vi(1), 'X')
0030 %plot(fi(2), fi(1), 'o')
0031 [cost, path, nodes, positionRoad_no, node1Node2Road_noCost] = findShortestPath(roadPoints, positionRoad_no, [fi 0], [vi 0],  nodes, node1Node2Road_noCost, costMap);
0032 plot(path(:,2), path(:,1))
0033 % plotPath = path;
0034 % [sx, sy] = size(plotPath);
0035 % while sx > 0
0036 %     if sx >= 2
0037 %         plotVec = [plotPath(1,:); plotPath(2,:)];
0038 %         plot(plotVec(:,2), plotVec(:,1), 'green')
0039 %         plotPath = plotPath(2:sx,:);
0040 %     else
0041 %         plotPath = [];
0042 %     end;
0043 %     [sx, sy] = size(plotPath);
0044 % end;
0045 %
0046     
0047     
0048     
0049

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