Step 1: obtain parameters
MATLAB Language
1. Number of components
Numcomponents = length (model. Rules {model. Start })
Ncom = length (model. Rules {model. Start });
2. numberof features fixed, = 31, no records in the model file
3. Score Threshold = model. thresh
Step 2: Obtain the root filter, part filters, and deformation of each component.
Filter
1. Each component first obtains the index of the rootfilter.
The model. Start command is used to obtain the label of the root filter in two cases:
For ICOM = 1: ncom % component count
RHS = model. Rules {model. Start} (ICOM). RHS;
% Assume the root filter is firston The RHS of the Start rules
If Model. Symbols (RHS (1). type = 'T'
% Handle case where there's nodeformation model for the root
Root = model. Symbols (RHS (1). filter;
Else
% Handle case where there is adeformation model for the root
Root = model. Symbols (model. Rules {RHS (1)} (layer). RHs). filter;
End
End
2. In each component, obtain the number of part filters and the parameters of each part.
ICOM = 1: numcomponents
Npart = length (model. Rules {model. Start} (ICOM). RHs)-1;
The value of % ICOM does not affect the result. The part values should be the same.
For ipart = 2: npart + 1
Irule = model. Rules {model. Start} (ICOM). RHS (ipart );
Filternum = model. Symbols (model. Rules {irule}. RHs). filter;
% Get the relevant parameters of each part [dx, Dy, DS] and penalty [dx dy dxx dyy]
VX = model. Rules {model. Start} (ICOM). Anchor {ipart} (1) + 1;
Vy = model. Rules {model. Start} (ICOM). Anchor {ipart} (2) + 1;
DX = model. Rules {irule}. Def. W (2 );
DY = model. Rules {irule}. Def. W (4 );
Dxx = model. Rules {irule}. Def. W (1 );
Dyy = model. Rules {irule}. Def. W (3 );
End