-
Notifications
You must be signed in to change notification settings - Fork 2
/
getDescs_RECT_FPGA.m
55 lines (41 loc) · 1.87 KB
/
getDescs_RECT_FPGA.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function [frames, descs] = getDescs_RECT_FPGA(TD, param)
subsamp_count_matrix = param.countmatsubsamp;
subsamp_desc_regionsize = floor(param.descsize/2); %radius of descsize by descsize region
% subsample the TD x y locations and account for zero padding in the
% count matrix for easy desc generation
TD.x = ceil(TD.x(:)./subsamp_count_matrix) + subsamp_desc_regionsize;
TD.y = ceil(TD.y(:)./subsamp_count_matrix) + subsamp_desc_regionsize;
TD.ts = TD.ts(:);
TD.p = TD.p(:);
% x and y locations have already accounted for left and top padding
count_matrix = zeros(max(TD.y) + subsamp_desc_regionsize, max(TD.x) + subsamp_desc_regionsize);
global_eventcount = 0;
desc_count = 0;
queue = CQueue();
queue.capacity = param.queuesize;
minNumEvents = param.minNumEvents;
descs = uint16(zeros(param.descsize*param.descsize, 1));
frames = uint8(zeros(2, 1));
for i = 1:size(TD.x,1)
global_eventcount = global_eventcount + 1;
event_x = TD.x(i);
event_y = TD.y(i);
if global_eventcount <= minNumEvents