]> AND Private Git Repository - these_gilles.git/blob - THESE/codes/meanshift/Ms_segmenter/Region_matrix.m
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
28/08 matin
[these_gilles.git] / THESE / codes / meanshift / Ms_segmenter / Region_matrix.m
1 function Image = Region_matrix(Region)\r
2 \r
3 Min_x = Region.Shifts(1, 1);\r
4 Min_y = Region.Shifts(2, 1);\r
5 Max_x = Region.Shifts(1, 2);\r
6 Max_y = Region.Shifts(2, 2);\r
7 \r
8 Image = zeros(Max_x-Min_x+1, Max_y-Min_y+1);\r
9 \r
10 Image(sub2ind(size(Image), Region.Boundary(1, :)-Min_x+1, ...\r
11         Region.Boundary(2, :)-Min_y+1)) = 1;\r
12 \r
13 To_start_fill = [Region.Inner_pts(2, :)-Min_y+1; ...\r
14         Region.Inner_pts(1, :)-Min_x+1];\r
15 Image = bwfill(Image, To_start_fill(1, :), To_start_fill(2, :));\r
16 \r