Package com.openstego.desktop.util.dwt
Class DWTUtil
- java.lang.Object
-
- com.openstego.desktop.util.dwt.DWTUtil
-
public class DWTUtil extends Object
Class to handle Wavelet filters and other DWT utilities.This class is conversion of C to Java for the file "wavelet.c" file provided by Peter Meerwald at:http://www.cosy.sbg.ac.at/~pmeerw/Watermarking/
Refer to his thesis on watermarking: Peter Meerwald, Digital Image Watermarking in the Wavelet Transfer Domain, Master's Thesis, Department of Scientific Computing, University of Salzburg, Austria, January 2001.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
convoluteLines(Image outputImg, Image inputImg, Filter filter, int method)
Method to convolute linesstatic void
convoluteRows(Image outputImg, Image inputImg, Filter filter, int method)
Method to convolute rowsstatic void
decomposition(Image inputImg, Image coarseImg, Image horizontalImg, Image verticalImg, Image diagonalImg, Filter filterG, Filter filterH, int method)
Method to decompose the imagestatic void
filterCutOff(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply cut-off filterstatic void
filterInvCutOff(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply inverse cut-off filterstatic void
filterInvMirror(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply inverse mirror filterstatic void
filterInvPeriodical(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply inverse periodical filterstatic void
filterMirror(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply mirror filterstatic void
filterPeriodical(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply periodical filterstatic int
findDeepestLevel(int width, int height)
Method to get the deepest level possible for given image width and heightstatic double
getPixel(Image image, int x, int y)
Get pixel value from the imagestatic void
invDecomposition(Image sumImg, Image coarseImg, Image horizontalImg, Image verticalImg, Image diagonalImg, FilterGH filterGH, int method)
Method to perform inverse decompositionstatic Image
inverseTransform(ImageTree tree, FilterGH[] filterGHList, int method)
Method to perform inverse wavelet transformstatic void
setPixel(Image image, int x, int y, double val)
Set pixel value in the imagestatic ImageTree
waveletTransform(Image origImg, int level, FilterGH[] filterGHList, int method)
Method to perform the wavelet transform
-
-
-
Method Detail
-
waveletTransform
public static ImageTree waveletTransform(Image origImg, int level, FilterGH[] filterGHList, int method)
Method to perform the wavelet transform- Parameters:
origImg
- Original imagelevel
- Decomposition levelfilterGHList
- List of filtersmethod
- Wavelet filtering method- Returns:
- Data after performing wavelet transform
-
decomposition
public static void decomposition(Image inputImg, Image coarseImg, Image horizontalImg, Image verticalImg, Image diagonalImg, Filter filterG, Filter filterH, int method)
Method to decompose the image- Parameters:
inputImg
- Input imagecoarseImg
- Coarse imagehorizontalImg
- Horizontal imageverticalImg
- Vertical imagediagonalImg
- Diagonal imagefilterG
- G filterfilterH
- H filtermethod
- Wavelet filtering method
-
convoluteLines
public static void convoluteLines(Image outputImg, Image inputImg, Filter filter, int method)
Method to convolute lines- Parameters:
outputImg
- Output imageinputImg
- Input imagefilter
- Filter to usemethod
- Wavelet filtering method
-
convoluteRows
public static void convoluteRows(Image outputImg, Image inputImg, Filter filter, int method)
Method to convolute rows- Parameters:
outputImg
- Output imageinputImg
- Input imagefilter
- Filter to usemethod
- Wavelet filtering method
-
filterCutOff
public static void filterCutOff(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply cut-off filter- Parameters:
inputImg
- Input imageinStart
- Start point for input imageinLen
- Length of data for input imageinStep
- Step for loop for input imageoutputImg
- Output imageoutStart
- Start point for output imageoutLen
- Length of data for output imageoutStep
- Step for loop for output imagefilter
- Filter
-
filterInvCutOff
public static void filterInvCutOff(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply inverse cut-off filter- Parameters:
inputImg
- Input imageinStart
- Start point for input imageinLen
- Length of data for input imageinStep
- Step for loop for input imageoutputImg
- Output imageoutStart
- Start point for output imageoutLen
- Length of data for output imageoutStep
- Step for loop for output imagefilter
- Filter
-
filterPeriodical
public static void filterPeriodical(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply periodical filter- Parameters:
inputImg
- Input imageinStart
- Start point for input imageinLen
- Length of data for input imageinStep
- Step for loop for input imageoutputImg
- Output imageoutStart
- Start point for output imageoutLen
- Length of data for output imageoutStep
- Step for loop for output imagefilter
- Filter
-
filterInvPeriodical
public static void filterInvPeriodical(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply inverse periodical filter- Parameters:
inputImg
- Input imageinStart
- Start point for input imageinLen
- Length of data for input imageinStep
- Step for loop for input imageoutputImg
- Output imageoutStart
- Start point for output imageoutLen
- Length of data for output imageoutStep
- Step for loop for output imagefilter
- Filter
-
filterMirror
public static void filterMirror(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply mirror filter- Parameters:
inputImg
- Input imageinStart
- Start point for input imageinLen
- Length of data for input imageinStep
- Step for loop for input imageoutputImg
- Output imageoutStart
- Start point for output imageoutLen
- Length of data for output imageoutStep
- Step for loop for output imagefilter
- Filter
-
filterInvMirror
public static void filterInvMirror(Image inputImg, int inStart, int inLen, int inStep, Image outputImg, int outStart, int outLen, int outStep, Filter filter)
Method to apply inverse mirror filter- Parameters:
inputImg
- Input imageinStart
- Start point for input imageinLen
- Length of data for input imageinStep
- Step for loop for input imageoutputImg
- Output imageoutStart
- Start point for output imageoutLen
- Length of data for output imageoutStep
- Step for loop for output imagefilter
- Filter
-
inverseTransform
public static Image inverseTransform(ImageTree tree, FilterGH[] filterGHList, int method)
Method to perform inverse wavelet transform- Parameters:
tree
- Forward transformed DWT datafilterGHList
- List of filtersmethod
- Wavelet filter method- Returns:
- Inverse transformed image data
-
invDecomposition
public static void invDecomposition(Image sumImg, Image coarseImg, Image horizontalImg, Image verticalImg, Image diagonalImg, FilterGH filterGH, int method)
Method to perform inverse decomposition- Parameters:
sumImg
- Sum imagecoarseImg
- Coarse imagehorizontalImg
- Horizontal imageverticalImg
- Vertical imagediagonalImg
- Diagonal imagefilterGH
- Filtermethod
- Wavelet filter method
-
findDeepestLevel
public static int findDeepestLevel(int width, int height)
Method to get the deepest level possible for given image width and height- Parameters:
width
- Image widthheight
- Image height- Returns:
- Deepest possible level
-
setPixel
public static void setPixel(Image image, int x, int y, double val)
Set pixel value in the image- Parameters:
image
- Imagex
- X position of pixely
- Y position of pixelval
- Pixel value
-
getPixel
public static double getPixel(Image image, int x, int y)
Get pixel value from the image- Parameters:
image
- Imagex
- X position of pixely
- Y position of pixel- Returns:
- Pixel value
-
-