forked from mathworks/Integrate_Python_code_with_Simulink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython_HumanDetector.m
36 lines (29 loc) · 980 Bytes
/
python_HumanDetector.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
classdef python_HumanDetector < matlab.System
% Pre-computed constants
properties(Access = private, Nontunable)
hog
end
methods(Access = protected)
function setupImpl(obj)
% Perform one-time calculations, such as computing constants
obj.hog = py.detectHuman.getHogObject();
end
function y = stepImpl(obj,u)
% Calculate y as a function of input u and discrete states.
out = py.detectHuman.detectHumanFromFrame(u, obj.hog);
y = uint8(out);
end
function out = getOutputSizeImpl(obj)
out = [300 400 3];
end
function y1 = getOutputDataTypeImpl(obj)
y1 = 'uint8';
end
function y1 = isOutputComplexImpl(~)
y1 = false;
end
function out = isOutputFixedSizeImpl(obj)
out = true;
end
end
end