Report cleaning.
[master-thesis.git] / src / Tests_hough / test_hough_simple.m
1 function test_hough_simple(images_path, image_name)
2     i = imread([images_path image_name]);
3     green = i(:, :, 2);
4     green_filtered = imgaussfilt(cast(i(:, :, 2), 'double'), 1.0);
5     edges = edge(green_filtered);
6
7     disp('Applying Houg...');
8     tic
9     [acc_votes, acc_radius] = HTCircle(edges, [20, 40]);
10     toc
11
12     disp('Finding ellipses...');
13     tic
14     ellipses = find_ellipses(0.4, acc_votes, acc_radius);
15     toc
16
17     show_figures(['Hough simple - ' image_name], {...
18         {green, 'original'},...
19         {green_filtered, 'original filtered with a gaussian, sigma=1'},...
20         {edges, 'edges (sobel)'},...
21         {acc_votes, 'votes'}}, green, ellipses);
22 end