1 function Image = Region_matrix(Region)
\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
8 Image = zeros(Max_x-Min_x+1, Max_y-Min_y+1);
\r
10 Image(sub2ind(size(Image), Region.Boundary(1, :)-Min_x+1, ...
\r
11 Region.Boundary(2, :)-Min_y+1)) = 1;
\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