Facemorph.psychomorph.batchable
Class BatchColourCalibrate

java.lang.Object
  extended by Facemorph.psychomorph.batchable.BatchColourCalibrate
All Implemented Interfaces:
Batchable

public class BatchColourCalibrate
extends java.lang.Object
implements Batchable

Colour calibration implementation Reads calibration chart data from file. User selects a box around the chart, attempts to refine the alignment (rigid+scale) based on matching to the mean colours. Optionally will refine the alignment to each image in a set, based on the initial box selection.


Field Summary
static double[] D50
          reference white D50 in XYZ coordinates
static double[] D55
          reference white D55 in XYZ coordinates
static double[] D65
          reference white D65 in XYZ coordinates
static double[] D75
          reference white D75 in XYZ coordinates
 
Constructor Summary
BatchColourCalibrate()
           
 
Method Summary
 void finish()
          Performs any processing required at the end of the batch loading,
 java.lang.String getName()
          Gets the name of the Batchable, used in to put them on the psychomorph menu in the form (for "My Bachable"): - My Batchable - Batch My Batchable
 boolean getReadTemplate()
          Indicates if templates should be read in during batch operation
 boolean getWriteImage()
          Indicates if images should be written out during batch operation
 boolean getWriteTemplate()
          Indicates if templates should be written out during batch operation
 boolean initialise(PsychoMorphForm psychomorph)
          Initialise the Batchable This is called each time the batchable is selected
static double[] LabtoXYZ(double[] col, double[] wp)
          Convert L*a*b* to XYZ
 boolean process(ImageZoomPanel izp, boolean single)
          The process method is called for each image in the list, or for the current image in single mode
static double[] XYZtoLab(double[] col, double[] wp)
          Convert XYZ to L*a*b*
 int[] XYZtoRGB(double[] XYZ)
          Convert XYZ to RGB
 int[] XYZtoRGB(double X, double Y, double Z)
          Convert XYZ to RGB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

D50

public static final double[] D50
reference white D50 in XYZ coordinates


D55

public static final double[] D55
reference white D55 in XYZ coordinates


D65

public static final double[] D65
reference white D65 in XYZ coordinates


D75

public static final double[] D75
reference white D75 in XYZ coordinates

Constructor Detail

BatchColourCalibrate

public BatchColourCalibrate()
Method Detail

process

public boolean process(ImageZoomPanel izp,
                       boolean single)
Description copied from interface: Batchable
The process method is called for each image in the list, or for the current image in single mode

Specified by:
process in interface Batchable
Parameters:
izp - The ImageZoomPanel holds the image and Template to process
single - this indicates that we are (or are not) in bacth mode. Useful for things like saving undo data (for single) or not (for batch)
Returns:
returns true if the processing was successfule, or false if not

initialise

public boolean initialise(PsychoMorphForm psychomorph)
Description copied from interface: Batchable
Initialise the Batchable This is called each time the batchable is selected

Specified by:
initialise in interface Batchable
Parameters:
psychomorph - the main psychomorph object
Returns:
returns true if initialised OK

finish

public void finish()
Description copied from interface: Batchable
Performs any processing required at the end of the batch loading,

Specified by:
finish in interface Batchable

getName

public java.lang.String getName()
Description copied from interface: Batchable
Gets the name of the Batchable, used in to put them on the psychomorph menu in the form (for "My Bachable"): - My Batchable - Batch My Batchable

Specified by:
getName in interface Batchable
Returns:
return the name of your Batchable aas a String

XYZtoLab

public static double[] XYZtoLab(double[] col,
                                double[] wp)
Convert XYZ to L*a*b*

Parameters:
col - the XYZ colour
wp - the whitepoint
Returns:
the colour in L*a*b*

LabtoXYZ

public static double[] LabtoXYZ(double[] col,
                                double[] wp)
Convert L*a*b* to XYZ

Parameters:
col - the L*a*b* colour
wp - the whitepoint
Returns:
the colour in XYZ

XYZtoRGB

public int[] XYZtoRGB(double X,
                      double Y,
                      double Z)
Convert XYZ to RGB.

Parameters:
X - X
Y - Y
Z - Z
Returns:
RGB in int array.

XYZtoRGB

public int[] XYZtoRGB(double[] XYZ)
Convert XYZ to RGB

Parameters:
XYZ - in a double array.
Returns:
RGB in int array.

getReadTemplate

public boolean getReadTemplate()
Description copied from interface: Batchable
Indicates if templates should be read in during batch operation

Specified by:
getReadTemplate in interface Batchable
Returns:
return true if the template should be read

getWriteTemplate

public boolean getWriteTemplate()
Description copied from interface: Batchable
Indicates if templates should be written out during batch operation

Specified by:
getWriteTemplate in interface Batchable
Returns:
return true if the template should be written

getWriteImage

public boolean getWriteImage()
Description copied from interface: Batchable
Indicates if images should be written out during batch operation

Specified by:
getWriteImage in interface Batchable
Returns:
return true if the image should be written