Main Page | Data Structures | Directories | File List | Data Fields | Globals

Sadie_Filter.c File Reference

Local filtering operations (convolutions), Fourier and related transforms. More...

#include <tcl.h>
#include <tk.h>
#include <sadie.h>
#include "tclsadie.h"

Go to the source code of this file.

SADIE library globals

Global variables within the SADIE library that augment function arguments.

*uint32_t nlev
 Used by STRETCH, TFQUANT & WTFMAJ.
uint32_t csize
 Used by WINDOW & WTFCAVG.
double weight
 Used by WINDOW & WTFMAJ.
double * count
 Used by WTFMAJ.
PIXEL gmin
 Used by STRETCH, TFQUANT, TFSAT, TFSCALE & WTFMAJ.
PIXEL gmax
 Used by STRETCH, TFINVERT, TFQUANT, TFSAT & TFSCALE.
PIXEL thresh
 Used by STRETCH, TFTHRESH, WINDOW & WTFCAVG.

Defines

#define GRADIENT_KERNEL_SIZE   3
 The width of the gradient operator kernel, in pixels.
#define GRADIENT_KERNEL_AREA   9
 The storage required for the gradient operator kernel, in pixels.

Functions

int Sadie_Filter_PSpectCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Compute an image power spectrum, either 2D, or 1D (row or column averages).
int Sadie_Filter_FFTConvCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Convolve a image with a function via a Fast Fourier Transform.
int Sadie_Filter_FFTFiltCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Convolve an image with a pre-defined function.
int Sadie_Filter_FFTCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Compute a forward or inverse two-dimensional Fourier transform of an image.
int Sadie_Filter_FHTCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Compute a forward or inverse two-dimensional Hartley transform of an image.
int Sadie_Filter_MaskConvCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Convolve an image with a kernel defined in a Tcl array.
int Sadie_Filter_ImageConvCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Convolve an image with a spatial kernel defined in another image.
int Sadie_Filter_LibGradCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Convolve the image with one of a set of pre-defined gradient operators.
int Sadie_Filter_MaskGradCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Apply a gradient operator defined in Tcl array elements to an image.
int Sadie_Filter_ImageGradCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Apply a gradient operator defined by a pair of images to a third image.
int Sadie_Filter_VarMapCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Compute a local variance map from a sliding sub-window within an image.
int Sadie_Filter_MinFiltCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Compute minima for a sliding sub-window within an image.
int Sadie_Filter_MaxFiltCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Compute maxima for a sliding sub-window within an image.
int Sadie_Filter_DivMapCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Compute greylevel diversity for a sliding sub-window within an image.
int Sadie_Filter_MajFiltCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Apply a local majority filter to an image.
int Sadie_Filter_MedFiltCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Apply a median filter to an image.
int Sadie_Filter_CAvgFiltCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Determine the conditional average of an image.
int Sadie_Filter_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.


Detailed Description

Local filtering operations (convolutions), Fourier and related transforms.

Here are Tcl/Tk interfaces to most of the local convolution kernel-based filtering operations provided by the SADIE library, as well as the Fourier and Hartley transforms and the operations derived from them (such as frequency-domain convolutions and power spectrum determinations). Please note that some of the operations are not thread-safe or even re-entrant, using shared global variables in the SADIE library (see the list of external variable declarations for details).

Author:
University of Arizona Digital Image Analysis Lab
Date:
1999, 2004
Version:
Id
Sadie_Filter.c,v 2.6 2005/03/22 21:41:38 mmunro Exp

Definition in file Sadie_Filter.c.


Function Documentation

int Sadie_Filter_CAvgFiltCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Determine the conditional average of an image.

The SADIE library function WTFCAVG implements a conditional average operation within a fixed-sized window. If none of the conditions are met, this is identical to the value of the pixel at the center of the window. If there is no limit on the number of divergent pixels, it is the simple mean of all those pixels whose values are less than the specified threshold from the value of the center pixel. If there are pixels whose values lie beyond this threshold from the center pixel (divegent pixels), the total count of divergent pixels is greater than the limit, and the range of their values is less than the threshold, it is the simple mean of the divergent pixels. We set the parameters from Tcl variables, assign all the necessary global variables (and should maintain the convention that the csize variable is zero if there is no limit on the number of divergent pixels), and let the standard SADIE library function WINDOW apply the filter to the image via a sliding window. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of the input image.
  • tcl_array_name(lines) the number of lines in the sliding window.
  • tcl_array_name(pix) the number of pixels per line in the window.
  • tcl_array_name(size) zero, or the divergent pixel count limit.
  • tcl_array_name(thresh) threshold for comparing pixel values.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) output image name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 923 of file Sadie_Filter.c.

References csize, GetSadieImageFromObj2(), GetSadiePixelFromObj2(), GetSadieUintFromObj2(), SetSadieImageObj2(), and thresh.

Referenced by Sadie_Filter_Init().

int Sadie_Filter_DivMapCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Compute greylevel diversity for a sliding sub-window within an image.

The SADIE library function WTFDIVER computes greylevel diversity within a window: use the WINDOW function to apply it, via the apply_sadie_window() function.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 781 of file Sadie_Filter.c.

Referenced by Sadie_Filter_Init().

int Sadie_Filter_FFTCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Compute a forward or inverse two-dimensional Fourier transform of an image.

The SADIE library function FFT2D implements a two-dimensional Fast Fourier Transform algorithm, using the codes FORWARD or INVERSE (defined in sadie.h ) to show the direction of the transform. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of image to filter.
  • tcl_array_name(option) the direction selection code.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) transform result name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 251 of file Sadie_Filter.c.

References GetSadieImageFromObj2(), GetSadieIntFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_FFTConvCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Convolve a image with a function via a Fast Fourier Transform.

We use the SADIE library function FCONVL to convolve one (arbitrary) image with another whose values represent either a set of spatial weights (such as a sampled point spread function), or a sampled frequency-domain transfer function. The codes PSF and OTF defined in sadie.h specify which option to use. The Tcl data should conform to the patterns:

  • tcl_array_name(inimg,addr1) input image ID string.
  • tcl_array_name(inimg,addr2) ID string for sampled function image.
  • tcl_array_name(option) spatial or frequency-domain function.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) convolution result name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 130 of file Sadie_Filter.c.

References GetSadieImageFromObj2(), GetSadieIntFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_FFTFiltCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Convolve an image with a pre-defined function.

The SADIE library includes a function FILTER that uses a Fast Fourier Transform to convolve an image with members of a family of filter functions that specify an amplitude for a particular combination of two parameters giving x and y spatial frequencies, defined in the interval [0, 1/2], and two scaling parameters giving the radii of the filter in the frequency domain, in cycles per pixel. It also pre-defines some such functions, so here we just select one from several of these pre-defined functions, and convolve the image with it. Note that the filter selection codes differ from those in sadie.h:

  1. FLTCONE cone filter.
  2. FLTEXP negative exponential filter.
  3. FLTGAUSS Gaussian filter.
  4. FLTBOX box filter.
  • FLTCYL cylinder filter is the default for all other values.

The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of image to filter.
  • tcl_array_name(option) the filter selection code.
  • tcl_array_name(xradius) the filter x radius.
  • tcl_array_name(yradius) the filter y radius.
  • tcl_array_name(parameter) subtract the filter from this, if non-zero.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) convolution result name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 186 of file Sadie_Filter.c.

References GetSadieDoubleFromObj2(), GetSadieImageFromObj2(), GetSadieIntFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_FHTCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Compute a forward or inverse two-dimensional Hartley transform of an image.

The SADIE library function FHT2D implements a two-dimensional Fast Hartley Transform algorithm, using the codes FORWARD or INVERSE (defined in sadie.h ) to show the direction of the transform. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of image to filter.
  • tcl_array_name(option) the direction selection code.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) transform result name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 289 of file Sadie_Filter.c.

References GetSadieImageFromObj2(), GetSadieIntFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_ImageConvCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Convolve an image with a spatial kernel defined in another image.

The SADIE library function SCONVL convolves an image with a two- dimensional spatial kernel. Here we feed it the kernel weights from another SADIE image, first dividing them by a constant we specify, and apply it to the specified image. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of image to filter.
  • tcl_array_name(kimg,addr) the ID of the kernel image.
  • tcl_array_name(normalize) whether to normalize weights to sum to 1.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) convolved result name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 404 of file Sadie_Filter.c.

References GetSadieBooleanFromObj2(), GetSadieImageFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_ImageGradCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Apply a gradient operator defined by a pair of images to a third image.

We interpret the pixel values in a pair of SADIE images as discrete versions of the functions that define the gradient in the orthogonal x (horizontal) and y (vertical) directions: the paired square convolution kernels the SADIE function GRADIENT can use to derive paired gradient magnitude and direction images from the input image. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of image to filter.
  • tcl_array_name(himg,addr) ID of the image holding horizontal weights.
  • tcl_array_name(vimg,addr) ID of the image holding vertical weights.
  • tcl_array_name(magname) name for resulting gradient magnitude image.
  • tcl_array_name(dirname) name for resulting gradient direction image.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 593 of file Sadie_Filter.c.

References GetSadieImageFromObj2(), and SetSadieComponentObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 957 of file Sadie_Filter.c.

References Sadie_Filter_CAvgFiltCmd(), Sadie_Filter_DivMapCmd(), Sadie_Filter_FFTCmd(), Sadie_Filter_FFTConvCmd(), Sadie_Filter_FFTFiltCmd(), Sadie_Filter_FHTCmd(), Sadie_Filter_ImageConvCmd(), Sadie_Filter_ImageGradCmd(), Sadie_Filter_LibGradCmd(), Sadie_Filter_MajFiltCmd(), Sadie_Filter_MaskConvCmd(), Sadie_Filter_MaskGradCmd(), Sadie_Filter_MaxFiltCmd(), Sadie_Filter_MedFiltCmd(), Sadie_Filter_MinFiltCmd(), Sadie_Filter_PSpectCmd(), and Sadie_Filter_VarMapCmd().

Referenced by Tcl_AppInit().

int Sadie_Filter_LibGradCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Convolve the image with one of a set of pre-defined gradient operators.

The SADIE library includes a generic gradient function, GRADIENT, and a small set of 3 X 3 gradient kernels that the EDGE function can supply to it to provide some well-known gradient operators. Here we apply EDGE to an image, generating both a magnitude and a direction image, and specify the particular gradient operator by a code that should be one of the constants SOBEL, SOBEL2, SOBEL3, ROBERTS, ROBERTS2, or PREWITT, defined in the sadie.h header. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of image to filter.
  • tcl_array_name(option) the operator selection code.
  • tcl_array_name(magname) name for resulting gradient magnitude image.
  • tcl_array_name(dirname) name for resulting gradient direction image.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 482 of file Sadie_Filter.c.

References GetSadieImageFromObj2(), GetSadieIntFromObj2(), and SetSadieComponentObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_MajFiltCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Apply a local majority filter to an image.

The SADIE library function WTFMAJ implements a local majority filter (a little more elaborate than a modal filter, using the specified weighting parameter to handle the treatment of the mid-point of the distribution of values within a fixed-size window). It requires some messy initialization of global variables within the SADIE library, including allocating an array in which to summarize the value distribution. We set the parameters from Tcl variables, assign all the necessary global variables, and let the standard SADIE library function WINDOW apply the filter to the image via a sliding window. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of the input image.
  • tcl_array_name(lines) the number of lines in the sliding window.
  • tcl_array_name(pix) the number of pixels per line in the window.
  • tcl_array_name(weight) for the mid-range distribution bin total.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) output image name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 812 of file Sadie_Filter.c.

References count, GetSadieDoubleFromObj2(), GetSadieImageFromObj2(), GetSadieUintFromObj2(), gmax, gmin, nlev, SetSadieImageObj2(), and weight.

Referenced by Sadie_Filter_Init().

int Sadie_Filter_MaskConvCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Convolve an image with a kernel defined in a Tcl array.

The SADIE library function SCONVL convolves an image with a two- dimensional spatial kernel. Here we feed it the kernel weights from Tcl array elements, first dividing them by a constant we specify, and apply it to the specified image. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of image to filter.
  • tcl_array_name(lines) the diameter of the kernel in lines.
  • tcl_array_name(pix) the diameter of the kernel in pixels.
  • tcl_array_name(factor) divide the kernel weights by this factor.
  • tcl_array_name(mask,(line_number),(pixel_number)) individual weights.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) convolved result name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 331 of file Sadie_Filter.c.

References GetSadieDoubleFromObj2(), GetSadieImageFromObj2(), GetSadieUintFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_MaskGradCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Apply a gradient operator defined in Tcl array elements to an image.

The SADIE library function GRADIENT generates paired gradient direction and magnitude images from an input image and two square convolution kernels, defining the components of the gradient in the x and y (horizontal and vertical) directions. Here we apply it to an image, taking the kernel weights from Tcl array elements. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of image to filter.
  • tcl_array_name(hmask,(row_index),(column_index)) horizontal weights.
  • tcl_array_name(vmask,(row_index),(column_index)) vertical weights.
  • tcl_array_name(magname) name for resulting gradient magnitude image.
  • tcl_array_name(dirname) name for resulting gradient direction image.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 530 of file Sadie_Filter.c.

References GetSadieDoubleFromObj2(), GetSadieImageFromObj2(), GRADIENT_KERNEL_AREA, and SetSadieComponentObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_MaxFiltCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Compute maxima for a sliding sub-window within an image.

The SADIE library function WTFMAX finds the maximum value within a fixed-size window: use the WINDOW function to apply it, via the apply_sadie_window() function, to every sliding window position in an image.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 762 of file Sadie_Filter.c.

Referenced by Sadie_Filter_Init().

int Sadie_Filter_MedFiltCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Apply a median filter to an image.

The SADIE library function MEDIAN finds the median of the values for each position of a sliding window within an image. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of the input image.
  • tcl_array_name(lines) the number of lines in the sliding window.
  • tcl_array_name(pix) the number of pixels per line in the window.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) output image name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 867 of file Sadie_Filter.c.

References GetSadieImageFromObj2(), GetSadieUintFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_MinFiltCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Compute minima for a sliding sub-window within an image.

The SADIE library function WTFMIN finds the minimum value within a fixed-size window: use the WINDOW function to apply it, via the apply_sadie_window() function, to every sliding window position in an image.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 742 of file Sadie_Filter.c.

Referenced by Sadie_Filter_Init().

int Sadie_Filter_PSpectCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Compute an image power spectrum, either 2D, or 1D (row or column averages).

We use either the SADIE library function PSPECT (for the two-dimensional spectrum) or PSPECT1D (for one-dimensional row or column averages), which in turn use a Fast Fourier Transform-derived power spectrum. The option codes to select 2-D, 1-D rows, or 1-D columns are NOR_PSPECT, ROW_PSPECT, or COL_PSPECT respectively, defined in sadie.h. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) ID of image to analyse.
  • tcl_array_name(option) select 2-D, 1-D rows, or 1-D columns.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) the spectrum image name.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 86 of file Sadie_Filter.c.

References GetSadieImageFromObj2(), GetSadieIntFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_Filter_Init().

int Sadie_Filter_VarMapCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Compute a local variance map from a sliding sub-window within an image.

The SADIE library function WTFVAR computes the variance within a window: use the WINDOW function to apply it, via the apply_sadie_window() function.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the Tcl array name).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 722 of file Sadie_Filter.c.

Referenced by Sadie_Filter_Init().


Generated on Fri Jul 8 14:55:02 2005 for tclSadie by  doxygen 1.4.2