-
Notifications
You must be signed in to change notification settings - Fork 25
/
orpExample.m
37 lines (33 loc) · 883 Bytes
/
orpExample.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
% Clear
close all
clear all
clc
% Load image
X = imread(fullfile('..', 'data', 'hus.jpg'));
% Make image greyscale
if size(X, 3) > 1
X = rgb2gray(X);
end
% Compute Oriented FAST Rotated Pattern
sigma1 = 1; % Backgroun filtering
sigma2 = 6; % Filtering for the descriptors
threshold_sobel = 127; % Threshold for the corners
threshold_fast = 50; % Threshold for the corners
fast_method = 9; % FAST method: 9, 10, 11, 12
[data, X1, X2, G, corners] = mi.orp(X, sigma1, sigma2, threshold_sobel, threshold_fast, fast_method);
% Plot
figure
imshow(uint8(X))
hold on
plot(corners(:, 1), corners(:, 2), 'r.');
title('Corner detection')
hold off
figure
imshow(uint8(X1))
title('Gaussian filter - Background')
figure
imshow(uint8(X2))
title('Gaussian filter - For descriptor')
figure
imshow(uint8(G));
title('Sobel filter - For corner/edge detection')