
threshold = 60;
lena      = imread( 'lena512.png' );
dlena     = imresize( double(lena), [ 513, 513 ], 'bilinear' );

faces = bttc_m( dlena, threshold );
figure;
imshow( dlena ./ 255 );
hold on;
for i=1:size(faces,1)
   f = faces(i,:);
   x = [f(:,1) f(:,3) f(:,5) f(:,1)];
   y = [f(:,2) f(:,4) f(:,6) f(:,2)];
   line( x, y, 'LineWidth', 1, 'Color', 'g' );
end

[ Vi, Fi ] = bttc_m( dlena, threshold );
figure;
imshow( dlena ./ 255 );
hold on;
for i=1:size(Fi,1)
   v = Vi( Fi(i,:), : );
   x = [v(:,1);v(1,1)];
   y = [v(:,2);v(1,2)];
   line( x, y, 'LineWidth', 1, 'Color', 'g' );
end

