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

Sadie_Classify.c File Reference

A Tcl/Tk interface to the SADIE image classification functions. More...

#include <tcl.h>
#include <tk.h>
#include <stdio.h>
#include <string.h>
#include <sadie.h>
#include "tclsadie.h"
#include "Sadie_Index.h"
#include "tclSadie_ROI.h"

Go to the source code of this file.

Functions

int Sadie_Classify_LvlSliceCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Level-slice classifier (box classifier).
int Sadie_Classify_MinDistCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Minimum distance image classification, with several distance metric options.
int Sadie_Classify_MaxLikeCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 An interface to the MAXLIKE function in the SADIE library (not working).
int Sadie_Classify_ClusterCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Image classification by an iterative K-means clustering algorithm.
int Sadie_Classify_SegmentCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Segment an image into regions with similar greylevels.
int Sadie_Classify_SigMapCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Assign realistic mean values to an arbitrary label map.
int Sadie_Classify_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.

Variables

sad_doclistp_t global_doclist
 The global hash table structures, used for ROI storage.


Detailed Description

A Tcl/Tk interface to the SADIE image classification functions.

The SADIE library implements some of the classification operations described in Chapter 9 of R. A. Schowengerdt Remote Sensing (2nd. ed.) Academic Press: 1997. In addition to the images themselves, they require definitions of regions of interest, which are recorded neither within the SADIE library, nor within the Tcl code, but within an independent hash table (see Sadie_Index.c for the implementation details).

Author:
University of Arizona Digital Image Analysis Lab
Date:
1999, 2004
Version:
Id
Sadie_Classify.c,v 2.5 2005/03/22 22:07:11 mmunro Exp

Definition in file Sadie_Classify.c.


Function Documentation

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

Image classification by an iterative K-means clustering algorithm.

This is simply an interface to the SADIE library function CLUSTER. Starting with a certain number of arbitrarily defined clusters, we classify each point by assigning it to the cluster whose mean vector is closest in feature space. We then re-evaluate the cluster mean vectors and iterate the process, re-assigning points between the clusters. Adjustable parameters allow clusters whose means become close to merge, and clusters that end up holding too few points to vanish. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) raw image ID string.
  • tcl_array_name(iter) the maximum number of iterations.
  • tcl_array_name(classes) the number of initial clusters.
  • tcl_array_name(min) minimum number of points in a cluster.
  • tcl_array_name(incr) spacing of the points (pixel units).
  • tcl_array_name(merging) threshold for merging adjacent clusters.
  • tcl_array_name(outlier) threshold for excluding distant points.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) output image name.

Parameters:
[in] client_data (unused).
[in] interp the main 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 595 of file Sadie_Classify.c.

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

Referenced by Sadie_Classify_Init().

int Sadie_Classify_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 721 of file Sadie_Classify.c.

References Sadie_Classify_ClusterCmd(), Sadie_Classify_LvlSliceCmd(), Sadie_Classify_MaxLikeCmd(), Sadie_Classify_MinDistCmd(), Sadie_Classify_SegmentCmd(), and Sadie_Classify_SigMapCmd().

Referenced by Tcl_AppInit().

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

Level-slice classifier (box classifier).

The LVLSLICE function in the SADIE library performs a simple level-slice classification, but needs additional help computing the level ranges for each band and class from the mean vectors of a set of training areas; Note that "the level-slice classifier does not fit remote-sensing data particularly well." (R.A. Schowengerdt Remote Sensing (2nd. ed.) Academic Press: 1997: p. 412). The Tcl data should conform to the patterns:

  • main_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) raw image ID string.
  • main_array_name(numclasses) the overall number of classes.
  • main_array_name(thresh) box limits are +/- thresh sigma units.
  • main_array_name(inimg,array) classification array name.
  • main_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) output image name.

Please refer to set_class_summary_vec for details of the Tcl classification array.

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

Definition at line 160 of file Sadie_Classify.c.

References GetSadieDkeyFromObj2(), GetSadieImageFromObj2(), GetSadieIntFromObj2(), GetSadiePixelFromObj2(), sad_get_doc_property(), SetSadieImageObj2(), and thresh.

Referenced by Sadie_Classify_Init().

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

An interface to the MAXLIKE function in the SADIE library (not working).

The MAXLIKE function should provide a Bayesian probabilistic image classification, but at the moment is just a placeholder.

Definition at line 445 of file Sadie_Classify.c.

References GetSadieBooleanFromObj2(), GetSadieDkeyFromObj2(), GetSadieDoubleFromObj2(), GetSadieImageFromObj2(), GetSadieIntFromObj2(), sad_get_doc_property(), and SetSadieImageObj2().

Referenced by Sadie_Classify_Init().

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

Minimum distance image classification, with several distance metric options.

Given a set of regions within an image, a number of classes (not greater than the number of regions), an assignment table that shows which regions belong to which class, and a complete unclassified image, this uses the SADIE library function MINDIST to generate a classified image, where the class assigned to each pixel is the one whose mean vector is closest to the corresponding point in the unclassified image. The "closest" criterion is the minimum distance in feature space, according to a particular distance metric, and there are several options for this metric (including Euclidian, city block, and Mahalanobis). The Tcl data should conform to the patterns:

  • main_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) raw image ID string.
  • main_array_name(numclasses) the overall number of classes.
  • main_array_name(option) the distance metric code (see sadie.h ).
  • main_array_name(inimg,array) classification array name.
  • main_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) output image name.

The Tcl classification array follows the pattern classification_array_name(class,class_number,region_number) and has what are essentially Boolean values: for a particular class_number and region_number the array element is non-zero if the region is in the class.

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

Definition at line 310 of file Sadie_Classify.c.

References GetSadieBooleanFromObj2(), GetSadieDkeyFromObj2(), GetSadieImageFromObj2(), GetSadieIntFromObj2(), sad_get_doc_property(), and SetSadieImageObj2().

Referenced by Sadie_Classify_Init().

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

Segment an image into regions with similar greylevels.

As well as assigning labels to groupings of similar pixels, this will optionally downsample the image before a coarse segmentation, then refine the labelmap to the resolution of the original image: see the SADIE library SEGMENT and REFINE functions for details. The Tcl data should conform to the patterns:

  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) unclassified image ID.
  • tcl_array_name(steps) number of downsampling and upsampling steps.
  • tcl_array_name(sigma) the greylevel variance threshold.
  • tcl_array_name(thresh) the greylevel difference threshold.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) output label map name.

Parameters:
[in] client_data (unused).
[in] interp the main 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 648 of file Sadie_Classify.c.

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

Referenced by Sadie_Classify_Init().

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

Assign realistic mean values to an arbitrary label map.

Given an image and a label map defining regions within it, generate a new image, assigning values to all the pixels within a particular region the mean value from the corresponding region in the original image, using the SADIE library SIGMAP function. The Tcl data should conform to the patterns:

  • tcl_array_name(lblmap,addr) arbitrary label map image ID.
  • tcl_array_name(DEFAULT_IN_IMAGE_ADDR_INDEX) the original image ID.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) output map name.

Parameters:
[in] client_data (unused).
[in] interp the main 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 693 of file Sadie_Classify.c.

References GetSadieImageFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_Classify_Init().


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