forked from marcusstenbeck/tnm034-qr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalization.m
More file actions
41 lines (32 loc) · 1003 Bytes
/
localization.m
File metadata and controls
41 lines (32 loc) · 1003 Bytes
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
38
39
40
41
% DESCRIPTION
% A function that finds the PIFS in the supplied image
% genom att skanna bilden för att hitta PIFs, sök efter mittpunkter i PIFs, beräkna
%medelpunkten(gravitypoint), hitta hörnpunkter
% PARAMETERS
% IN:
% imin: The input image of the captured QR-code.
% OUT:
% imout: An image of the extracted QR-code
function imout = localization(imin)
filter = [0 1 0; 1 -4 1; 0 1 0];
%laplacefilter för att hitta linjer
%for x = 1 : width
% for y = 1 : height
% ratio = [1 1 3 1 1];
bla = filter2(filter, imin, 'same');
imshow(bla)
figure(2);
[width, height] = size(bla);
for x = 1 : width
for y = 1 : height
if(bla(x,y) < 0.1)
bla(x,y) = 0;
else
bla(x,y) = 1;
end
end
end
imshow(bla)
% end
%end
return;