Class Synthesis


public class Synthesis
extends Thread

Wavelet Transformation Demo: Performs the reconstruction (synthesis) of a wavelet transformed image

Field Summary

private Analysis
analysis
private String
borderExtMethod
private int
boundSize
private ImageCanvas
canvas
private String
decompMethod
private String
dispMethod
private boolean
dispNorm
private TransformDisplay
display
private int
filterSize
private double[]
iHP
private double[]
iLP
private ImageMaker
im
private Interpolation
interpol
private int
lineColor
private int
maxlevel
private int
orgNumBands
private int
orgNumCols
private int
orgNumRows
private TransformParams
params
private double
quanThreshold
private int
quantAbs
private int
quantAll
private boolean
quantFlag
private TransformLength
transLen

Constructor Summary

Synthesis(TransformDisplay tdisp, TransformParams params, ImageCanvas destCanvas, Analysis analysis)
Constructor

Method Summary

private void
calculatePSNR(byte[][][] org, byte[][][] dec)
private boolean
checkArrayDimensions(Data a, Data b)
Check matching of array dimensions
private double[]
convolution(double[] approx, double[] details, int outCount)
Perform the convolution of the approximation with the lowpass filter and the details with the highpass filter and add results for image reconstruction
private void
initSynthesisCanvas()
Init the synthesis display canvas (with full transformation image from analysis)
private void
initSynthesisCanvas(NonStdData coeffs)
Init the synthesis display canvas (with last low pass from analysis)
private void
nonStandardDecomposition(NonStdData coeffs, int level, int dispLevel)
Perform the synthesis based on the Non-Standard decomposition
private void
quantiseAll(Data in, Data out, String decMeth, boolean maxlevFlag)
private Data
quantiseCoeffs(Data data, String decMeth, boolean maxlevFlag)
Perform the quantisation of the image data
private void
quantisePart(Data in, Data out, String decMeth)
void
run()
Start the synthesis
private void
setDecompMethod(String method)
Sets the selected decomposition method and creates corresponding image display templates
private void
setFilter(Filter filter)
Creates the needed filters
private void
showImage(int numBands, int numRows, int numCols)
Display the reconstructed image
private void
standardDecomposition(StdData coeffs, Data low, int level, int dispLevel, boolean colTransform)
Perform the synthesis based on the Standard decomposition
void
synNotify()
Continue the synthesis processing
void
synWait()
Pause the synthesis processing
private void
waitSomeTime(boolean wait)
Wait some time before processing the next synthesis level

Field Details

analysis

private Analysis analysis

borderExtMethod

private String borderExtMethod

boundSize

private int boundSize

canvas

private ImageCanvas canvas

decompMethod

private String decompMethod

dispMethod

private String dispMethod

dispNorm

private boolean dispNorm

display

private TransformDisplay display

filterSize

private int filterSize

iHP

private double[] iHP

iLP

private double[] iLP

im

private ImageMaker im

interpol

private Interpolation interpol

lineColor

private int lineColor

maxlevel

private int maxlevel

orgNumBands

private int orgNumBands

orgNumCols

private int orgNumCols

orgNumRows

private int orgNumRows

params

private TransformParams params

quanThreshold

private double quanThreshold

quantAbs

private int quantAbs

quantAll

private int quantAll

quantFlag

private boolean quantFlag

transLen

private TransformLength transLen

Constructor Details

Synthesis

public Synthesis(TransformDisplay tdisp,
                 TransformParams params,
                 ImageCanvas destCanvas,
                 Analysis analysis)
Constructor

Method Details

calculatePSNR

private void calculatePSNR(byte[][][] org,
                           byte[][][] dec)

checkArrayDimensions

private boolean checkArrayDimensions(Data a,
                                     Data b)
Check matching of array dimensions

convolution

private double[] convolution(double[] approx,
                             double[] details,
                             int outCount)
Perform the convolution of the approximation with the lowpass filter and the details with the highpass filter and add results for image reconstruction

initSynthesisCanvas

private void initSynthesisCanvas()
Init the synthesis display canvas (with full transformation image from analysis)

initSynthesisCanvas

private void initSynthesisCanvas(NonStdData coeffs)
Init the synthesis display canvas (with last low pass from analysis)

nonStandardDecomposition

private void nonStandardDecomposition(NonStdData coeffs,
                                      int level,
                                      int dispLevel)
            throws Message
Perform the synthesis based on the Non-Standard decomposition

quantiseAll

private void quantiseAll(Data in,
                         Data out,
                         String decMeth,
                         boolean maxlevFlag)

quantiseCoeffs

private Data quantiseCoeffs(Data data,
                            String decMeth,
                            boolean maxlevFlag)
Perform the quantisation of the image data

quantisePart

private void quantisePart(Data in,
                          Data out,
                          String decMeth)

run

public void run()
Start the synthesis

setDecompMethod

private void setDecompMethod(String method)
Sets the selected decomposition method and creates corresponding image display templates

setFilter

private void setFilter(Filter filter)
Creates the needed filters
Parameters:
filter - The specified filter

showImage

private void showImage(int numBands,
                       int numRows,
                       int numCols)
Display the reconstructed image

standardDecomposition

private void standardDecomposition(StdData coeffs,
                                   Data low,
                                   int level,
                                   int dispLevel,
                                   boolean colTransform)
            throws Message
Perform the synthesis based on the Standard decomposition

synNotify

public void synNotify()
Continue the synthesis processing

synWait

public void synWait()
Pause the synthesis processing

waitSomeTime

private void waitSomeTime(boolean wait)
Wait some time before processing the next synthesis level