[Wavelet-commit] Wavelet/Wave WaveletTransform.hh,1.4,1.5
Status: Beta
Brought to you by:
herbert
From: Herbert M. D. <he...@us...> - 2007-05-25 08:08:19
|
Update of /cvsroot/wavelet/Wavelet/Wave In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18996/Wave Modified Files: WaveletTransform.hh Log Message: Added WaveletTransform::highMax() method. Index: WaveletTransform.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Wave/WaveletTransform.hh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WaveletTransform.hh 12 Jul 2005 14:52:20 -0000 1.4 --- WaveletTransform.hh 25 May 2007 08:08:12 -0000 1.5 *************** *** 7,13 **** */ ! /** ! * @addtogroup Wave ! * @{ */ --- 7,13 ---- */ ! /** ! * @addtogroup Wave ! * @{ */ *************** *** 19,28 **** #include "Wave/Filter.hh" ! /** ! * An abstract Wavelet Transform. The Transform transform is two-dimensional, * it thus works on images. */ /*abstract*/ ! class WaveletTransform { --- 19,28 ---- #include "Wave/Filter.hh" ! /** ! * An abstract Wavelet Transform. The Transform transform is two-dimensional, * it thus works on images. */ /*abstract*/ ! class WaveletTransform { *************** *** 37,41 **** virtual ~WaveletTransform (void); ! /** Perform a Wavelet transform on the image. * @exception invalid_argument * image is not square --- 37,41 ---- virtual ~WaveletTransform (void); ! /** Perform a Wavelet transform on the image. * @exception invalid_argument * image is not square *************** *** 43,52 **** * the number of transform steps */ virtual void analysis (int steps); ! /** Perform an inverse Wavelet transform on the image. * @exception invalid_argument * image is not square * @param steps ! * the number of inverse transform steps ! * @param prevSteps * if greater than 0, the number of previous decomposition steps * to assume. This is necessary to reconstruct images that are --- 43,52 ---- * the number of transform steps */ virtual void analysis (int steps); ! /** Perform an inverse Wavelet transform on the image. * @exception invalid_argument * image is not square * @param steps ! * the number of inverse transform steps ! * @param prevSteps * if greater than 0, the number of previous decomposition steps * to assume. This is necessary to reconstruct images that are *************** *** 59,67 **** void restoreImage (void); ! /** Identify position and size of a given channel in a given subband. ! * This default method of calculation refers to the Pyramid transform ! * and due to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the ! * Packet transform may have to implement their own version of that * method. * @param what --- 59,67 ---- void restoreImage (void); ! /** Identify position and size of a given channel in a given subband. ! * This default method of calculation refers to the Pyramid transform ! * and due to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the ! * Packet transform may have to implement their own version of that * method. * @param what *************** *** 77,81 **** * @param xsize * the returned number of cols */ ! virtual void where (area what, int subband, int &yoffs, int &xoffs, int &ysize, int &xsize) const; --- 77,81 ---- * @param xsize * the returned number of cols */ ! virtual void where (area what, int subband, int &yoffs, int &xoffs, int &ysize, int &xsize) const; *************** *** 90,106 **** * where the calculated subband gets written to. * @param channel ! * where the calculated channel gets written to. * @param steps * the current number of transform steps to be assumed (-1 for automatic * determination) */ ! virtual void where (int ypos, int xpos, int &subband, area &channel, int steps = -1) const; ! /** Identify channel and subband of a given position in the transformed * image and map it to another subband/channel. ! * This default method of calculation refers to the Pyramid transform ! * and due to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the ! * Packet transform may have to implement their own version of that * method. * @param yOld --- 90,106 ---- * where the calculated subband gets written to. * @param channel ! * where the calculated channel gets written to. * @param steps * the current number of transform steps to be assumed (-1 for automatic * determination) */ ! virtual void where (int ypos, int xpos, int &subband, area &channel, int steps = -1) const; ! /** Identify channel and subband of a given position in the transformed * image and map it to another subband/channel. ! * This default method of calculation refers to the Pyramid transform ! * and due to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the ! * Packet transform may have to implement their own version of that * method. * @param yOld *************** *** 117,129 **** * where the target location's column gets written to. * @param sizeFactor ! * where the target sizeFactor gets written to. * @param steps * the current number of transform steps to be assumed (-1 for automatic * determination) */ ! virtual void mapPosition (int yOld, int xOld, int toSubband, ! area toChannel, int &yNew, int &xNew, int &sizeFactor, int steps = -1) const; ! ! /** Return the average color for a particular area in a subband * inside the image. The coefficients' signedness will be considered. * This is a shortcut to the corresponding method in the Image class. --- 117,129 ---- * where the target location's column gets written to. * @param sizeFactor ! * where the target sizeFactor gets written to. * @param steps * the current number of transform steps to be assumed (-1 for automatic * determination) */ ! virtual void mapPosition (int yOld, int xOld, int toSubband, ! area toChannel, int &yNew, int &xNew, int &sizeFactor, int steps = -1) const; ! ! /** Return the average color for a particular area in a subband * inside the image. The coefficients' signedness will be considered. * This is a shortcut to the corresponding method in the Image class. *************** *** 133,137 **** virtual coeff saverage (int subband, area channel) const; ! /** Return the average color for a particular area in a subband * inside the image. The coefficients' signedness will be discarded. * This is a shortcut to the corresponding method in the Image class. --- 133,137 ---- virtual coeff saverage (int subband, area channel) const; ! /** Return the average color for a particular area in a subband * inside the image. The coefficients' signedness will be discarded. * This is a shortcut to the corresponding method in the Image class. *************** *** 141,145 **** virtual coeff aaverage (int subband, area channel) const; ! /** Return the square variance for a particular area in a subband * inside the image. * This is a shortcut to the corresponding method in the Image class. --- 141,145 ---- virtual coeff aaverage (int subband, area channel) const; ! /** Return the square variance for a particular area in a subband * inside the image. * This is a shortcut to the corresponding method in the Image class. *************** *** 149,153 **** virtual coeff sqvariance (int subband, area channel) const; ! /** Return the variance for a particular area in a subband * inside the image. * This is a shortcut to the corresponding method in the Image class. --- 149,153 ---- virtual coeff sqvariance (int subband, area channel) const; ! /** Return the variance for a particular area in a subband * inside the image. * This is a shortcut to the corresponding method in the Image class. *************** *** 158,162 **** virtual coeff variance (int subband, area channel, bool abs = false) const; ! /** Returns the standard deviation for a particular area in a subband * inside the image. * This is a shortcut to the corresponding method in the Image class. --- 158,162 ---- virtual coeff variance (int subband, area channel, bool abs = false) const; ! /** Returns the standard deviation for a particular area in a subband * inside the image. * This is a shortcut to the corresponding method in the Image class. *************** *** 166,175 **** * @return the standard deviation. */ virtual coeff sdeviation (int subband, area channel, bool abs = false) const; ! /** Return the ratio resulting from the zerotree relationship between ! * two subbands (e.g. 1:4 from subband 1 to 2). This method depends on the ! * geometry associated with the `Pyramid' decomposition. ! * Decomposition schemes using a different geometries, like e.g. the ! * Packet transform may have to implement their own version of that * method. * @param subband1 the first subband --- 166,175 ---- * @return the standard deviation. */ virtual coeff sdeviation (int subband, area channel, bool abs = false) const; ! /** Return the ratio resulting from the zerotree relationship between ! * two subbands (e.g. 1:4 from subband 1 to 2). This method depends on the ! * geometry associated with the `Pyramid' decomposition. ! * Decomposition schemes using a different geometries, like e.g. the ! * Packet transform may have to implement their own version of that * method. * @param subband1 the first subband *************** *** 177,208 **** * @return the ratio, e.g. 4 for 1:4 */ virtual coeff ratio (int subband1, int subband2); ! ! /** Get a subpicture containing the LL subband. * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ inline Image *ll (int steps = -1) { return subband (LL, steps); } ! /** Get a subpicture containing the HL subband. * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ inline Image *hl (int steps = -1) { return subband (HL, steps); } ! /** Get a subpicture containing the LH subband. * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ inline Image *lh (int steps = -1) { return subband (LH, steps); } ! /** Get a subpicture containing the HH subband. * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ inline Image *hh (int steps = -1) { return subband (HH, steps); } /** Get a reference to the image * @return the reference to the image */ inline Image &image (void) const { return *m_image; } ! /** Get a subpicture containing one of the subbands. * @param what ! * the subband, out of LL, HL, LH, HH * @param steps * assume number of transform steps instead of those computed from --- 177,216 ---- * @return the ratio, e.g. 4 for 1:4 */ virtual coeff ratio (int subband1, int subband2); ! ! /** Get a subpicture containing the LL subband. * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ inline Image *ll (int steps = -1) { return subband (LL, steps); } ! /** Get a subpicture containing the HL subband. * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ inline Image *hl (int steps = -1) { return subband (HL, steps); } ! /** Get a subpicture containing the LH subband. * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ inline Image *lh (int steps = -1) { return subband (LH, steps); } ! /** Get a subpicture containing the HH subband. * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ inline Image *hh (int steps = -1) { return subband (HH, steps); } + /** + * Get an image consisting of the given subband's highpass components + * maxima. + * @param steps + * assume number of transform steps instead of those computed from + * @return a new image object containing the maxima as coefficients + */ + Image *highMax(int steps = -1); /** Get a reference to the image * @return the reference to the image */ inline Image &image (void) const { return *m_image; } ! /** Get a subpicture containing one of the subbands. * @param what ! * the subband, out of LL, HL, LH, HH * @param steps * assume number of transform steps instead of those computed from *************** *** 210,217 **** virtual Image *subband (area what, int steps = -1); ! /** Get the subband of a given position in the image. This ! * default method of calculation refers to the Pyramid transform and due ! * to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the * Packet transform may have to implement their own version of that method. * @param ypos --- 218,225 ---- virtual Image *subband (area what, int steps = -1); ! /** Get the subband of a given position in the image. This ! * default method of calculation refers to the Pyramid transform and due ! * to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the * Packet transform may have to implement their own version of that method. * @param ypos *************** *** 221,232 **** * @param steps * the number of steps we assume the image to have been transformed ! * @return * the position's subband */ virtual int getSubband (int ypos, int xpos, int steps = -1); /** Get the subband of a given position in the image denoted by a ! * {\em CoeffInformation} object. ! * This default method of calculation refers to the Pyramid transform and ! * due * to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the * Packet transform may have to implement their own version of that method. * @param c --- 229,240 ---- * @param steps * the number of steps we assume the image to have been transformed ! * @return * the position's subband */ virtual int getSubband (int ypos, int xpos, int steps = -1); /** Get the subband of a given position in the image denoted by a ! * {\em CoeffInformation} object. ! * This default method of calculation refers to the Pyramid transform and ! * due * to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the * Packet transform may have to implement their own version of that method. * @param c *************** *** 234,238 **** * @param steps * the number of steps we assume the image to have been transformed ! * @return * the position's subband */ inline int getSubband (CoeffInformation &c, int steps = -1) { --- 242,246 ---- * @param steps * the number of steps we assume the image to have been transformed ! * @return * the position's subband */ inline int getSubband (CoeffInformation &c, int steps = -1) { *************** *** 240,247 **** } ! /** Get the area of a given position in the image. This ! * default method of calculation refers to the Pyramid transform and due ! * to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the * Packet transform may have to implement their own version of that method. * @param ypos --- 248,255 ---- } ! /** Get the area of a given position in the image. This ! * default method of calculation refers to the Pyramid transform and due ! * to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the * Packet transform may have to implement their own version of that method. * @param ypos *************** *** 251,262 **** * @param steps * the number of steps we assume the image to have been transformed ! * @return * the position's subband */ virtual area getArea (int ypos, int xpos, int steps = -1); /** Get the area of a given position in the image denoted by a ! * {\em CoeffInformation} object. ! * This default method of calculation refers to the Pyramid transform and ! * due * to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the * Packet transform may have to implement their own version of that method. * @param c --- 259,270 ---- * @param steps * the number of steps we assume the image to have been transformed ! * @return * the position's subband */ virtual area getArea (int ypos, int xpos, int steps = -1); /** Get the area of a given position in the image denoted by a ! * {\em CoeffInformation} object. ! * This default method of calculation refers to the Pyramid transform and ! * due * to the lack of alternatives also to the Standard transform. ! * Decomposition schemes using a different geometries, like e.g. the * Packet transform may have to implement their own version of that method. * @param c *************** *** 264,268 **** * @param steps * the number of steps we assume the image to have been transformed ! * @return * the position's subband */ inline area getArea (CoeffInformation &c, int steps = -1) { --- 272,276 ---- * @param steps * the number of steps we assume the image to have been transformed ! * @return * the position's subband */ inline area getArea (CoeffInformation &c, int steps = -1) { *************** *** 270,274 **** } ! /** Import a subpicture containing one of the subbands. * @exception invalid_argument * the imported image does not match the calculated subband size --- 278,282 ---- } ! /** Import a subpicture containing one of the subbands. * @exception invalid_argument * the imported image does not match the calculated subband size *************** *** 276,280 **** * the image containing the subband * @param what ! * the subband, out of LL, HL, LH, HH * @param steps * assume number of transform steps instead of those computed from --- 284,288 ---- * the image containing the subband * @param what ! * the subband, out of LL, HL, LH, HH * @param steps * assume number of transform steps instead of those computed from *************** *** 282,286 **** virtual void import (Image &img, area what, int steps = -1); ! /** Fill one of the subbands with one particular value. * @exception invalid_argument * the imported image does not match the calculated subband size --- 290,294 ---- virtual void import (Image &img, area what, int steps = -1); ! /** Fill one of the subbands with one particular value. * @exception invalid_argument * the imported image does not match the calculated subband size *************** *** 288,304 **** * the value to be inserted * @param what ! * the subband, out of LL, HL, LH, HH * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ virtual void fill (coeff value, area what, int steps = -1); ! ! /** Return the current number of decomposition steps * @return the number of decomposition steps */ ! inline int steps (void) const { return m_image->anasteps () - m_image->synsteps (); } #ifdef USE_DEPRECATED_API ! inline void import (Image &img, area what, int steps = -1) { import &img, what, steps); } #endif --- 296,312 ---- * the value to be inserted * @param what ! * the subband, out of LL, HL, LH, HH * @param steps * assume number of transform steps instead of those computed from * the previous transforms */ virtual void fill (coeff value, area what, int steps = -1); ! ! /** Return the current number of decomposition steps * @return the number of decomposition steps */ ! inline int steps (void) const { return m_image->anasteps () - m_image->synsteps (); } #ifdef USE_DEPRECATED_API ! inline void import (Image &img, area what, int steps = -1) { import &img, what, steps); } #endif *************** *** 320,331 **** int m_cols; ! /** Perform a Wavelet transform on the image. * @param steps * the number of transform steps */ virtual void doanalysis (int steps) = 0; ! /** Perform an inverse Wavelet transform on the image. * @param steps ! * the number of inverse transform steps ! * @param prevSteps * if greater than 0, the number of previous decomposition steps * to assume. This is necessary to reconstruct images that are --- 328,339 ---- int m_cols; ! /** Perform a Wavelet transform on the image. * @param steps * the number of transform steps */ virtual void doanalysis (int steps) = 0; ! /** Perform an inverse Wavelet transform on the image. * @param steps ! * the number of inverse transform steps ! * @param prevSteps * if greater than 0, the number of previous decomposition steps * to assume. This is necessary to reconstruct images that are |