Learn R Programming

Momocs (version 1.0.0)

as.Out: Convert an OutCoe object into an Out object

Description

Uses the $method to do the inverse corresponding function. For instance, an OutCoe object obtained with efourier, will be converted to an Out object (outlines from harmonic coefficients), using efourier_i.

Usage

as.Out(object, OutCoe, nb.pts = 120)

Arguments

object
an OutCoe object
OutCoe
used by as, useless for the front user
nb.pts
number of point for the reconstructed outlines

Value

an Out object.

Details

Note that the 'positionnal' coefficients (ao and co if any) are lost, so for a proper comparison between a raw Out and a Out from Out -> OutCoe -> Out, the raw Out should be centered.

This method is useful since it allows a direct inspection at how Fourier-based methods handle outlines, and in particular how they normalize it (when they do). If you have bad "reconstruction" using as.Out, this probably means that you have to think about alternative alignements on the raw outlines. For instance, it is obvious that normalization does a good job on the bottle example, yet it -pi/2 turns the "outlines" yet neutral for further analysis (and that can be manage with the argument rotate.shp in functions/methods that use reconstructed outlines, e.g. plot.PCA).

Examples

Run this code
data(bot)
bot <- coo_center(bot)
bot.f <- rfourier(bot, 120)
bot.fi <- as.Out(bot.f)
op <- par(mfrow=c(1, 2))
stack(bot, title="raw bot")
stack(bot.fi, title="outlines from bot.f")
par(op)

Run the code above in your browser using DataLab