Using the example plugins
Getting and installing the example plugins
The example plugins can be downloaded from:
- http://users.aber.ac.uk/bpt/jpsychomorph/version4/pluginexamples.jar -- the example plugins
To load them into the program, select Plugins->Load Plugin from the Transform window's menu, browse to the location of pluginexamples.jar and select it. The examples should be loaded into the program, and appear on the Plugins menu as a new item with the name of the jar file. Under this menu item you should see a list of options, each option has a 'Batch' counterpart. In addition a new menu item should have appeared on the main Psychomorph window with the label 'Boo!' (an example of how to add menus is included).
Note that plugins (should be) reloaded each time the program is run, which saves needing to reload frequently used plugins each time. To unload a plugin select 'Remove Plugin' from the Plugins menu and select the jar file you wish to unload from the menu provided.
If you are interested in writing or extending the plugins, the source code and NetBeans project files are available here:
- http://users.aber.ac.uk/bpt/jpsychomorph/version4/pluginexamples.zip -- the example plugins NetBeans project source code
and more information is available here.
MRF transforms
MRF transforms require a delineated subject (or list of subjects) to transform, and two sets of delineated images, one for the "start" group (should match the subject) and one for the "target" group. MRF transforms work better with the first derivative filters than with the default (Gabor) filters, these are available in the extras.zip file from the download page:
- http://users.aber.ac.uk/bpt/jpsychomorph/extra.zip -- some additional useful data files
These can be loaded via the main window menu Average->Texture Options -> Load Filters.
When you select the MRF Transform option you are prompted for the two sets of files. You are also asked for the coefficients of a quadratic equation that governs how the smoothing of local feature histograms should vary with spatial scale. The values "1 0 0" (a constant value of 1) will lead to a crisp transform appearance, but the face will likely be made largely from a single individual in the output set. Using a linear equation (e.g. values "1 0.5 0") will result in a slightly blurrier transform, but retaining more of the original subject's identity. Using a quadratic equation (e.g. values "1 0.5 0.5") will increase this effect further.
Another option asks you if you would like to use a Gaussian approximation to the local conditional histograms. Answering "Yes" seems to give almost identical results to using the full histograms and is considerably faster.
Colour calibration
The colour calibration assumes that you have a colour chart located in approximately the same place in each image. Select the colour chart using the rectangle in the delineator window (View -> Display rectangle, then click and drag). The box should be a reasonably tight fit to the chart. When you select colour calibrate, the algorithm samples circles regularly spaced on a 4 (wide) by 6 (high) grid, and iteratively tries to segment pixels of each colour and align the grid to the segmented colour patches. This seems to improve the alignment (e.g. for small rotations). The mean colours from each patch are then compared with the known colours to build a non-linear model of the colour mapping and apply it to the image. In batch mode you are given the option to use the calibration from the first image for all images, or to update the sampled colours (by estimating the grid position, scale and orientation) for each image.
The known colours are supplied in a file, starting with the whitepoint for the measured values (e.g. 65 for the d65 illuminant), followed by each patches colour (in L*a*b* space). The colours are ordered from top to bottom and left to right. An example is given below, in this example the first 6 values represent the grey values from white to black, which is the column on the (viewers) left of the chart.
65 96.07 -0.74 1.73 80.39 0.09 -0.06 66.34 -0.16 -0.63 53.88 -0.03 -0.03 40.89 0.06 -0.26 28.99 -0.1 -0.87 33.12 11.9 -42.25 54.94 -34.45 33.18 40.81 47.21 22.18 78.08 3.8 76.12 51.7 42.41 -16.02 54.02 -27.81 -22.42 60.65 33.43 52.65 43.78 7.58 -40.38 49.68 41.5 13.58 31.61 18.65 -21.02 71.26 -19.92 56.62 68.85 18.96 62.97 38.25 12.9 13.1 64.48 13.48 17.16 51.41 -3.98 -20.47 43.07 -11.07 20.64 55.95 6.89 -23.33 71.26 -29.71 2.1
Symmetrising
In order to symmetrise an image you need to have the image delineated with points and lines, and you need to specify the mirrored counterpart of each point. The points for a particular Template type can be labelled interactively from the Delineator window (Delineate -> Label symmetry). Each point is highlighted and you need to click on the corresponding mirrored point. The results are saved in a .sym file. The extra.zip file (see link above) contains an example .sym file for the standard template configuration.
To symmetrise a single or batch of images select the option from the plugins menu. The settings of the Transform Options (currently just shape and colour) will influence if the transformation to symmetry is performed on just the shape (by warping the image to a symmetrical template), just the colours (by creating a symmetrical shape and colour image then warping back into the original shape) or both (by creating a shape symmetrical image and averaging with itself flipped).
Chimeric Transforms
Chimeric transforms only alter half of the face. As for standard transforms, an image (usually an average) should be loaded into each of the left and right panes of the PsychoMorph window, in addition to the subject in the Transform window. You should be prompted for the transform level for the (viewers) left and right side of the face.
Old to New template
The folk in Aberdeen have been moving to an extended version of the "standard" template, which includes some additional points around the nose, ears and neck. This script will add the extra points in by guessing where they should be relative to the original set of points. These will need to be corrected by hand to be of much use, e.g. by using the plugin described below.
Correct Template
This plugin simply loads each image and template from a list and waits for you to click next on the pop up dialog. While the dialog is waiting you can edit the template, when you click next it'll be saved.
Fix Mouth
People often delineate a batch of images and find they have some in which the inner lip points are round the wrong way, which causes glitches in the warps. This plugin checks the points in the mouth (of the standard template) to see if the top lip point is below the bottom lip point, if it is they are swapped.
Categorise Image
This plugin is an example that allows you to save a record of which way each in a set of faces is facing (left, right or front). I suppose you could adapt something like this as an experimental setup, although there are better ways to do that.