#include <ImageComparison.hh>
List of all members.
Public Member Functions |
| | ImageComparison (const Image &img1, const Image &img2) |
| | ~ImageComparison (void) |
| int | rows (void) const |
| int | cols (void) const |
| int | size (void) const |
| Image * | difference (coeff magnify=1, bool reverse=false) |
| double | cmpsnr (void) |
| double | cmpmse (void) |
| lq | distlq (double percent, FilterSet &flt, imgtype type) |
| double | distlqd (double percent, FilterSet &flt, imgtype type) |
Static Public Member Functions |
| static Image * | truncateForLq (const Image &image, double percent, FilterSet &flt, const decomp t=STANDARD) |
| static double | calcLqDetailScore (const Image &truncated1, const Image &truncated2, int colorChannel=0) |
| static double | calcLqAverageScore (const Image &truncated1, const Image &truncated2, int colorChannel=0) |
| static Image * | truncateForLq (const Image &image, int nKeptCoeffs, FilterSet &flt, const decomp t=STANDARD) |
| static ImageInformation * | imageInfoForLq (const Image &image, int nKeptCoeffs, FilterSet &flt, const decomp t=STANDARD) |
| static const float * | getWeights (const imgtype imgType, int channel) |
Protected Member Functions |
| int | level (int pos) |
| double | weight (int y, int x, imgtype type) |
| double | lq_sum (imgtype type, bool reverse, bool oldLqd=false) |
Protected Attributes |
| int | m_ysize |
| int | m_xsize |
| int | m_xysize |
| Image * | m_images [2] |
| logvals * | m_lqcache |
| double | m_lqDWeights [2][N_WEIGHTS] |
| int | m_lqcachesize |
Static Protected Attributes |
| static const float | m_scWeights [][N_WEIGHTS] |
| static const float | m_drWeights [][N_WEIGHTS] |
Detailed Description
A class for differences between two images
Definition at line 43 of file ImageComparison.hh.
Constructor & Destructor Documentation
Constructor. Creates copies of the two images. If the two images have different dimensions they will be resized to the largest common dimensions.
- Parameters:
-
| img1 | the first image |
| img2 | the second image |
Destructor. Releases allocated memory.
Member Function Documentation
Calculate an $L^q$ average score for a greyscale image / single color channel.
- Parameters:
-
| truncated1 | the first image already truncated (see truncateForLq) |
| truncated2 | the second image already truncated (see truncateForLq) |
| colorChannel | the number of the color channel to which the two images correspond, this is important as it has an effect on the weights chosen when calculating the score |
- Returns:
- the average score
Calculate an $L^q$ detail score for a greyscale image / single color channel.
- Parameters:
-
| truncated1 | the first image already truncated (see truncateForLq) |
| truncated2 | the second image already truncated (see truncateForLq) |
| colorChannel | the number of the color channel to which the two images correspond, this is important as it has an effect on the weights chosen when calculating the score |
- Returns:
- the detail score
Compare with another image producing the mean square error. Stolen from Geoff Davis' Wavelet Coder kit.
- Returns:
- The MSE
Compare with another image producing the PSNR. Stolen from Geoff Davis' Wavelet Coder kit.
- Returns:
- The PSNR
Produce an image holding the difference between the first and the second image
- Parameters:
-
| magnify | multiply the result by a factor to increase / decrease visibility |
| reverse | reverse the subtraction (take img1 - img2) |
- Returns:
- a new image containing the difference
Calculate the distance to another image according to the $L^q$ norm. Idea and basic algorithm from Jacobs, Finkelstein, Salesin: "Fast
multiresolution image querying", Proc. of SIGGRAPH, 95. Note that this method is deprecated as it does not strictly conform to the original algorithm. I propose using the static methods truncateForLq and calcLqAverageAcore, calcLqDetailScore instead.
- Exceptions:
-
| invalid_argument | image is not square |
- Parameters:
-
| percent | the relative number of Wavelet coefficients to compare |
| flt | the filter to use |
| type | the type of the images to be assumed (drawn or scanned) |
- Returns:
- The $L^q$ norm
Calculate the distance to another image according to the old $L^qd$ norm. Idea and basic algorithm from Jacobs, Finkelstein, Salesin: "Fast
multiresolution image querying", Proc. of SIGGRAPH, 95.
- Exceptions:
-
| invalid_argument | image is not square |
- Parameters:
-
| percent | the relative number of Wavelet coefficients to compare |
| flt | the filter to use |
| type | the type of the images to be assumed (drawn or scanned) |
- Returns:
- The $L^qd$ norm
Return a reference to the weight table for a given type.
- Parameters:
-
| imgType | the type (scanned or drawn) |
| channel | the channel (Y, U, V) |
- Returns:
- the weight table
Calculates a feature vector for the $L^q$ and $L^qd$ metrics.
- Parameters:
-
| image | the image |
| nKeptCoeffs | the absolute number of Wavelet coefficients to keep |
| flt | the filter to use |
| t | the decomposition type to use (default: Standard) |
- Returns:
- an image information of overall average the n most significant coeffs sorted by absolute
Helper method for distlq(). Calculates the weighing level for a position
- Parameters:
-
| pos | the position (row or col) |
- Returns:
- the level
Helper method for distlq(). Calculate the sum of differences of the two decomposed images.
- Parameters:
-
| type | the type (drawn or scanned) to be assumed |
| reverse | if true, subract the first from the second image |
| oldLqd | if true, calculate the old Lqd way: add up the score for differing locations instead of subtracting the scores for identical values |
Calculates a feature vector for the $L^q$ and $L^qd$ metrics.
- Parameters:
-
| image | the image |
| percent | the relative number of Wavelet coefficients to keep |
| flt | the filter to use |
| t | the decomposition type to use (default: Standard) |
- Returns:
- an image of overall average and truncated coeffs
Calculates a feature vector for the $L^q$ and $L^qd$ metrics.
- Parameters:
-
| image | the image |
| nKeptCoeffs | the absolute number of Wavelet coefficients to keep |
| flt | the filter to use |
| t | the decomposition type to use (default: Standard) |
- Returns:
- an image of overall average and truncated coeffs
Helper method for distlq(). Calculate the weight for a position (y, x).
- Parameters:
-
| y | the row |
| x | the col |
| type | the images' type to be assumed (drawn or scanned) |
- Returns:
- the position's weight
Member Data Documentation
The size of the m_lqcache. Always as big as MAX (rows, cols).
Definition at line 236 of file ImageComparison.hh.
The documentation for this class was generated from the following file: