Object Recognition and scene understanding (9) model conversion mat-> XML

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.