RETRO commands


PROGRAM NAME

vlabel - Perform Labeling on Multiband or Cluster Image (K1)

DESCRIPTION

vlabel performs a labeling on a multiband image or a cluster image by attempting to merge connected pixels.

The principal of the algorithm is as follows: A pixel receives the same label as its neighbor if the likelihood distance between the two pixels is acceptable. The label process is propagated for a given region number until it is no longer possible to find a candidate.

Three different types of labeling choices exist:

1 First choice: uses a single or multi band image, where the data storage can be any of the following types: VFF_TYP_1_BYTE, VFF_TYP_2_BYTE, VFF_TYP_4_BYTE, or VFF_TYP_FLOAT.

The input image corresponds to the -i1 argument.

The distance is computed using all the bands of the image.

2. Second choice: uses a cluster number and cluster center image obtained from an algorithm like vkmeans or vquant. For this case, the cluster center represents the value of a class of pixels that have been grouped together. Therefore, the distance between two neighbors will be the distance between their clusters.

This case will require less computation time because the algorithm will only compute the inter-class distance, instead of computing the distance of two neighbors for the entire image.

An additional advantage with this choice, is that the output from algorithms such as vkmeans or vquant may be utilized, which may lead to better results.

The cluster center image corresponds to -i2 argument
The cluster number image corresponds to -i3 argument in the command line.

3. The final possibility is to use a single or multiband input image (argument -i1) associated with a cluster number image (argument -i3).

The advantage of this choice is that the results of a clustering algorithm are used to keep the neighbor pixels that have the same cluster number in the same class, and to rely on the distance in the single or multi band image to group two neighbors that do not belong to the same cluster.

In summary, the three possible choices are:

-i1 image.xv

-i2 cluster_center.xv -i3 cluster_number.xv

-i1 image.xv -i3 cluster_number.xv

The algorithm also requires the following parameters:

Metric distance: There are 2 different metric distances that can be used.

-d 1 uses Euclidean distance: sqrt[(x-s)^2 + (y-t)^2].

-d 2 uses City Block distance: |x-s| + |y-t|.

Connectivity: There are two possible neighborhoods:

-c 1 uses the 4 connectivity to link pixels together.

-c 2 uses the 8 connectivity.

Minimum size of a region:

-s (float_value) determines the number of pixels required for a region to be retained. The minimum number of pixels is equal to:
Total number of pixels in image * float_value / 100.0 (-s corresponds to a percentage of the total number of pixels in the image).

Border Size:
Each pixel in the image is updated except those outside of the border. The size of the border is specified by the -w argument.

Merging Process:
When the labeling process is computed, the user can expect that the small rejected region will be merged together in a bigger acceptable region or will be included inside another connected region.
This choice is selected by setting the logical argument -merge to TRUE. If -merge is set to FALSE, the small regions will be ignored and labeled as an UNDEFINED REGION (label number 0), the same as the border.

\fPThe AUTOMATIC or MANUAL OPTION:\fP
This option allows the user either to fix a threshold, or to give an approximate number of regions.
If the AUTOMATIC option is used, the algorithm will iterate on the threshold until the number of regions labeled by the process is comparable to the number of expected regions.
In fact, if the expected number is not reached after 30 iterations, the threshold that gives the closest number of regions is used for the final labeling.

Although this option is easy to use, the function:

number of regions = F(Threshold) is not a monotonically increasing function, and the convergence toward a solution may not exist.

-n int_value (AUTOMATIC OPTION) determines the approximate final number of regions expected.
-f float_value (MANUAL OPTION) determines the threshold used by the labeling process.

THESE TWO OPTIONS ARE MUTUALLY EXCLUSIVE

The default threshold value is 0.07. This value generally gives good results on noiseless images with large uniform regions.
Decreasing this value will increase the number of regions found during the labeling process, but these regions will get smaller and could be rejected by the minimum size threshold.
Increasing this value will decrease the number of regions found during the labeling process. At the same time, the number of small regions will decrease which means that this area of the curve, number of regions = F(Threshold), is more stable than the other one.

Once the user becomes accustomed to this routine, good results are generally obtained. One way to become familiar with the routine, is to use the automatic option and analyze the output ASCII file (Statistics on the iteration process). This file contains the number of regions labeled for each iteration, allowing the user to see how the number of regions changes as the THRESHOLD is changed.

Output Files

1 Output image: The resulting image, which corresponds to the -o1 argument, contains the labeled image in which every pixel has a region number as its value. This image is of data storage type VFF_TYP_4_BYTE.
The region label numbers are 1 to N. The region number 0 is reserved as an UNDEFINED label or for the border.

2 Output Statistic ASCII File: This file contains all the information relative to the labeling process.

REQUIRED ARGUMENTS

-o
type: outfile
desc: output image after the labeling process

Mutually Exclusive Group; you must specify ONE of:

-i1
type: infile
desc: input image
default: {none}
OR

ALL OF the Mutually Inclusive Group:

-i2
type: infile
desc: input image for cluster centers
default: {none}
AND
-i3
type: infile
desc: input image for cluster numbers
default: {none}

Mutually Exclusive Group; you must specify ONE of:

-n
type: integer
desc: Number of region to get from labeling process
default: 10
bounds: 2 < [-n] < 2500
OR
-f
type: float
desc: Split & Merge Factor: higher values result in finer regions
default: 0.07
bounds: 0 < [-f] < 1

OPTIONAL ARGUMENTS

-w
type: integer
desc: Specify the border width in pixels
default: 0
bounds: 0 < [-w] < 16
-m
type: integer toggle
desc: Distance Metric: 1 = Euclidean distance, 2 = city block
default: 1
allowed values:
-c
type: integer toggle
desc: Connectivity: 1 = 4-connectivity, 2 = 8-connectivity
default: 1
allowed values:
-s
type: float
desc: Minimum number of pixel to keep in label region
default: 1
bounds: 0 < [-s] < 100
-merge
type: boolean
desc: if flag= 1 the small regions will be merged together in connected regions, or will be included to existing labeled regions
default: false
-asc
type: outfile
desc: Output ASCII file for vlabel result display
default: {none}

EXAMPLES

vlabel -i1 image.xv -d 1 c 1 -merge 0 -f 0.07 -s 0.7 -w 2 -o image1.xv -asc stats

This command will label image.xv using the Euclidean distance, the 4 connectivity, a split and merge factor equal to 0.07, a minimum size for the regions equal to 0.7 percent of the total number of pixels in image.xv, and a border size of 2. The merge option is not used which means that the small regions will not be labeled. The labeled image will be stored in image1.xv and the statistics will be written in the ASCII file, stats.

SEE ALSO

lvkmeans(3), lvquant(3), vkmeans(1), vquant(1).

RESTRICTIONS

vlabel works only with cluster number and cluster center images conforming to the convention established by the set of clustering algorithms.

REFERENCES

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.