?? dwtrans2d_package.c
字號:
/*..........................................................................*//* *//* L a s t W a v e P a c k a g e 'dwtrans2d' 2.1 *//* *//* Copyright (C) 1998-2002 E.Bacry, J.Fraleu, J.Kalifa, E. Le Pennec, *//* W.L. Hwang , S.Mallat, S.Zhong *//* emails : lastwave@cmap.polytechnique.fr *//* fraleu@cmap.polytechnique.fr *//* kalifa@cmap.polytechnique.fr *//* lepennec@cmap.polytechnique.fr *//* mallat@cmap.polytechnique.fr *//* whwang@iis.sinica.edu.tw *//* szhong@chelsea.princeton.edu *//* *//*..........................................................................*//* *//* This program is a free software, you can redistribute it and/or *//* modify it under the terms of the GNU General Public License as *//* published by the Free Software Foundation; either version 2 of the *//* License, or (at your option) any later version *//* *//* This program is distributed in the hope that it will be useful, *//* but WITHOUT ANY WARRANTY; without even the implied warranty of *//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *//* GNU General Public License for more details. *//* *//* You should have received a copy of the GNU General Public License *//* along with this program (in a file named COPYRIGHT); *//* if not, write to the Free Software Foundation, Inc., *//* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *//* *//*..........................................................................*/#include "lastwave.h"#include "dwtrans2d.h" /* * The file that contains CProcs for DWtrans2 * *//* In filter2.c */extern void C_DWt2f(char **);/*In wtrans2_alloc.c */extern void C_PrintFilter2(char **), C_DW2Info(char **),C_DW2Read(char **),C_DW2Write(char **);/* In fast_ddecomp.c */extern void C_DDecomp2(char **), C_DRecons2(char **);static CProc Wtrans2Commands[] = { "dw2read", C_DW2Read,"{{{[<dwtrans2>=objCur] (<filename> | <stream>)} \{Reads a wavelet transform from a file named <filename> or a <stream>.}}}", "dw2write", C_DW2Write,"{{{[<dwtrans2>=objCur] (<filename> | <stream>)} \{Writes a wavelet transform in a file named <filename> or a <stream>.}}}", "dwt2f",C_DWt2f,"{{{<filterFileName>} \{Specifies the filename of the filters that must be used in case a new dyadic \wavelet decomposition is performed (using the 'dwt2d' command). \The filter directory (defined in the file 'scripts/dwtrans2d/dwtrans2d.pkg') contains all the filter available files. \The filenames ending by the '.1' suffixes correspond to decomposition filters and the ones ending with the '.2' suffixes \correspond to reconstruction filters. For this command, you must specify the name without the suffix (it will load both \the reconstruction and decomposition filters at the same time). \For now, only one pair of decomposition/reconstruction filters are available? Its name is 'p3'. \More details about filters can be found in the Appendix A \of the paper : \n\Characterization of signals from multiscale edges \n\by Stephane Mallat and Sifen Zhong, \n\IEEE Transactions on Pattern Analysis and Machine Intelligence,\n\Vol. 14, No. 7, p. 710-732, July 1992.\n\As described in the Appendix of the paper, filter p3 corresponds to the H(w) defined in (97) with n = 1.}}}", "dwt2d",C_DDecomp2,"{{{[<dwtrans2>=objCur] <noct> [-N] [-m]} \{Performs a dyadic wavelet decomposition on the current <dwtrans2> on <noct> octaves. \The image to be analyzed is supposed to be in the image 0 of the <dwtrans2>. If \the number of columns and the number of rows are N = 2^p, then <noct> must range \from 1 to p+1. When <oct> is equal to p+1, the coarsest is a constant. Options are :\n\-N : Does not use the default periodization of the image.}}}", "dwt2r",C_DRecons2,"{{{[<dwtrans2>=objCur] [-N]} \{Performs a dyadic wavelet reconstruction from a dyadic wavelet decomposition (made with the 'dwt2d' command). \It reconstructs the image which corresponds to the dyadic wavelet transform stored in <dwtrans2>. \It uses the same number of octaves as the decomposition has been made with. The reconstructed image is put in image 0 of <dwtrans2>.}}}", NULL,NULL,NULL};CProcTable wtrans2Table = {Wtrans2Commands, "dwtrans2d","Commands related to wavelet 2D transform "};extern void C_PInfo2(char **);extern void C_Point2Compute(char **),C_PointReprNormalize2(char **),C_PointReprDenormalize2(char **);extern void C_Point2Thresh(char **),C_Point2Print(char **),C_Point2ProPrint(char **),C_Point2Recons(char **), C_Point2Count(char **);extern void C_PointPicCopy(char **), C_P2Clear(char **), C_PointPic2Image(char **), C_Image2PointPic(char **);extern void C_PointReprRead(char **), C_PointReprWrite(char **),C_ComputeGrad(char **);CProc Point2Commands[] = { "extrema2",C_Point2Compute,"{{{[<dwtrans2>=objCur] [-o] [-n] [-N]} \ {Computes the extrema representation of the current wavelet transform. \The extrema are defined as the modulus local maxima along some gradient direction. The command returns the number of extrema found. \Options are :\n\-n : Due to the discretization of the filter values, the wavelet modulus maxima of a step edge do not have the same amplitude at all scales. In the extrema computation, we have correlated the extremas modulus such that the extremas of a step edge in each scale will have the same values. We called this process the 'normalization process'. With -n, we eliminate the normalization process in the computation of the extrema. \n\-o : The extrema are defined as the modulus local maxima in any gradient direction. It is possible that, for example, the modulus at location (x,y) is bigger than the modulus at (x-1,y) but less than that at (x+1,y), however the gradient at location (x+1,y) is opposite to the gradient at (x,y). We would expect in this case that the intensity at the location (x,y) is a local maxima and include the (x,y) as a extrema location. With -o, we will eliminate this inclusion.Properties of the extrema are described in the paper : \n\Remark : The periodization of the image is used if necessary.}}}", "e2image",C_PointPic2Image,"{{{[<dwtrans2>=objCur] <octaveNumber> <modImage> <phaseImage> [-p]} \{Copies the modulus and phase of extrema at octave number <octaveNumber> to the images <modImage> for the modulus and <phaseImage> for the phase. If \'-p' is set then the <modImage> is just made of 1 (to indicate an extrema) or 0.}}}", "e2thresh",C_Point2Thresh,"{{{[<dwtrans2>=objCur] <octaveNumber> <threshold>} {Thresholds the extrema at scale <octaveNumber> and whose modulus are smaller than \<threshold>2^(<octaveNumber>/2)/3. If <octaveNumber> is 0 then all the scales are thresholded.}}}", "e2recons",C_Point2Recons,"{{{[<dwtrans2>=objCur] <iteration> [-N][-i][-n]} \{Reconstructs the image from the extrema of the wavelet transform (computing using the 'extrema2' command). \The algorithm reconstructs an approximation of the original image, by alternatively projecting between two affine spaces. \The reconstructed image is in image 0 of <dwtrans2>. The parameter <iteration> gives the number of alternative projection \desired for the reconstruction. 20 iterations are sufficient to reconstruct an approximation with an SNR larger than 25 db. \Options are : \n\ -i : Does not initialize the reconstruction algorithm. It begins the iterations from an image (in 0) obtained after <n> iterations \previously performed and from the associated extrema. \The resultant image is stored in 0 and corresponds to an approximation of the original image after <n>+<iteration> iterations.\n\ -n : Reconstruction without denormalization of the extrema modulus.}}}", /*-e <error file> : After each iteration, we compute at each scale the SNR of the errors between the original wavelet transform \ and the current sequence of functions, stored them in the file <error file>. The original wavelet transform are copied \ to wtrans2 d when the reconstruction begins.\n\ */ "e2reconsgrad",C_ComputeGrad,"{{{[<dwtrans2>=objCur] <iterations> [<threshold>=0]} \{Reconstruction from the wavelet maxima with the conjugate gradient algorithm. Before the reconstruction is performed, the extrema are thresholded using <threshold>.}}}", "e2write",C_PointReprWrite,"{{{[<dwtrans2>=objCur] (<file> | <stream>)} \{Writes an extrema representation in a <file> or a <stream>}}}", "e2read",C_PointReprRead,"{{{[<dwtrans2>=objCur] (<file> | <stream>)} \{Reads an extrema representation in a <file> or a <stream>}}}",/* "imagee2",C_Image2PointPic,"{{{<mag_image> <arg_image> <level> [<orientation> =1] [<wtrans2> = objCur]} {Convert magnitude and argument representation to a extlis }}}", "e2clear",C_P2Clear,"{{{[<wtrans2> = objCur]} \{e2clear clear all extremas with all pointers and chain included }}}",
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -