public class MeanDifference extends Operation
RGB24Image
,
the other of type Paletted8Image
.RGBIntegerImage
.GrayIntegerImage
.Double meanDifference = MeanDifference.compute(image1, image2);
Modifier and Type | Field | Description |
---|---|---|
private double |
diff |
|
private PixelImage |
image1 |
|
private PixelImage |
image2 |
Constructor | Description |
---|---|
MeanDifference() |
Modifier and Type | Method | Description |
---|---|---|
static Double |
compute(PixelImage image1,
PixelImage image2) |
Compute the mean difference between two images.
|
private static int |
computeDiff(int a,
int b) |
Returns abs(a - b).
|
double |
getDifference() |
After a call to process, returns the determined mean difference value.
|
void |
process() |
This method does the actual work of the operation.
|
private void |
process(GrayIntegerImage image1,
GrayIntegerImage image2) |
|
private void |
process(RGB24Image image1,
Paletted8Image image2) |
|
private void |
process(RGBIntegerImage image1,
RGBIntegerImage image2) |
|
private void |
setDifference(double newValue) |
|
void |
setImages(PixelImage firstImage,
PixelImage secondImage) |
Sets the two images for which the mean difference is to be
determined.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
private double diff
private PixelImage image1
private PixelImage image2
public static Double compute(PixelImage image1, PixelImage image2)
image1
- first image to be examinedimage2
- second image to be examinednull
on failure (image types
are incompatible)private static int computeDiff(int a, int b)
a
- first numberb
- second numberpublic double getDifference()
public void process() throws MissingParameterException, WrongParameterException
Operation
process
in class Operation
MissingParameterException
- if any mandatory parameter was not given to the operationWrongParameterException
- if at least one of the input parameters was
not initialized appropriately (values out of the valid interval, etc.)private void process(GrayIntegerImage image1, GrayIntegerImage image2)
private void process(RGB24Image image1, Paletted8Image image2)
private void process(RGBIntegerImage image1, RGBIntegerImage image2)
private void setDifference(double newValue)
public void setImages(PixelImage firstImage, PixelImage secondImage)
firstImage
- first imagesecondImage
- second imageIllegalArgumentException
- if either of the images is null,
if their resolution is different or if their types are not supported
by this operation