msm_get_shape_params
The msm_get_shape_params tool fits a shape model to
each set of points and computes the pose and shape parameters.
These are saved to a text file for later processing.
The basic usage (running from command line) is:
msm_get_shape_params -p param_file.txt -o params.txt
where get_shape.params is a text file describing which model to use and where to find the points.
param_file.txt should be structured like this:
// Path to the shape model
shape_model_path: shape_model.msm
image_dir: ./images
points_dir: ./points
images:
{
image1.pts : image1.png
image2.pts : image2.png
image3.pts : image3.png
// ...
}
Parameters are saved to params.txt, one line per example.
The first columns contain the pose parameters (as defined by the msm_aligner), the next the shape parameters. So with a similarity transform (msm_similarity_aligner) the first four
numbers correspond to the four pose parameters.
If you add the -no_pose flag, then the pose parameters are not included.
If you add the -use_pts_name flag, then the points name string is put in the first column.
If you have built a shape model with parameter file build_shape_model.params, you can use the same file.
By default the parameters are in units defined in the model frame.
You can change to use units of standard deviation (ie normalise them) by adding the -rel_p flag:
msm_get_shape_params -p param_file.txt -o params.txt -rel_p
If the shape model was built with a parameter limited, it willl be applied when fitting to a new set of points. That may constrain the allowable range of the shape parameters. So, to be safe, use the -u flag for unconstrained shape fitting:
msm_get_shape_params -p param_file.txt -o params.txt -rel_p -u
Histograms
To get histograms for each parameter, use the -h flag to define the path:
msm_get_shape_params -p param_file.txt -o params.txt -h histo
This will then save histogram information to histo_b1.txt, bisto_b2.txt etc
You can display this with gnuplot:
plot "histo_b1.txt" with boxes
By default the parameters are in units defined in the model frame.
You can change to use units of standard deviation (ie normalise them) by adding the -rel_p flag:
msm_get_shape_params -p param_file.txt -o params.txt -h histo -rel_p
In that case the histograms can easily be compared to that of a unit gaussian in gnuplot:
plot "histo_b1.txt" with boxes, exp(-0.5*x*x)/sqrt(2*pi)
The range of the histo can be set with" -hr 4.0", and the number of bins with "-hn 101".