RETRO (vipl) functions


LIBRARY ROUTINE

lvmos2band - Convert a mosaic input image to a multiband output image

LIBRARY CALL

int lvmos2band(
	xvimage *image,
	xvimage **img1,
	int sub_rows,
	int sub_cols,
	int sub_border,
	int img_border,
	int sub_x_off,
	int sub_y_off,
	int sub_skip,
	int num_flag,
	int num_subs)

INPUT

OUTPUT

RETURN VALUE

TRUE (1) on success, FALSE (0) on failure

DESCRIPTION

lvmos2band converts a mosaic input image to an output image in which each subimage of the input mosaic constitutes a band of the output image.

The output image generated by lvmos2band, img1, will be (r-2*bs) rows by (c-2*bs) columns with n bands, where r and c are the number of rows and columns per subimage, bs is the subimage border size, and n is the number of subimages that are to be put into band format. Lvmos2band assumes that all subimages are same size (r*c) and all subimages have the same border size (bs). Subimages from the input mosaic image (image) are assigned to bands in the multiband output image (img1) in the following manner:

The first subimage specified is assigned to the first band in img1. Subsequent bands are assigned subsequent subimages indexed from left to right, top to bottom. Lvmos2band accepts VIFF data_types (excluding VFF_TYP_BIT) and returns that same data_type. If a map is associated with the input mosaic image, the same map will be assigned to the output multiband image.

Number of columns and number of rows in subimages:

The sub_rows and sub_cols parameters are used to specify the number of rows and the number of columns, respecively, per subimage. Lvmos2band assumes that all subimages in the mosaic image are the same size. The sub_rows and sub_cols values SHOULD include any borders associated with the subimages.

Subimage border size:

The sub_border parameter specifies the subimage border size in pixels. Again, this parameter will be applied to all subimages in the mosaic. When lvmos2band converts the mosaic image to a multiband image, the subimage borders will be removed from the subimages before storing them in bands. The size of the output image, img1, will therefore be (sub_rows-2*sub_border) rows by (sub_cols-2*sub_border) columns by n bands.

Overall mosaic image border size

The img_border parameter specifies, in pixels, the size of an outer border that should be removed from the mosaic image before extracting the subimages. The overall mosaic image border and the subimage borders are independent.

Horizontal and vertical offset of first subimage to be banded

The the first subimage in the mosaic that will be put into the multiband output image is specified by sub_x_off (horizontal offset) and sub_y_off (vertical offset). The specified subimage will then be the first band in the output image. The indices, x and y, index through the subimages (they are NOT indices through the input mosaic image rows and columns). Therefore, if a mosaic image contained 9 4-row by 4-col subimages arranged as 3 subimages in the horizontal direction by 3 subimages in the vertical direction, the center subimage would be indexed by sub_x_offset=1, sub_y_offset=1 (not by sub_x_offset=4, sub_y_offset=4).

Number of subimages to be put into band format

Two parameters are passed to lvmos2band to indicate the number of subimages that should be put into band format, starting with the first subimage described by sub_x_offset and sub_y_offset. The num_flag is set if the user specifies the number of subimages option. In the case that num_flag is TRUE, the value passed in by num_subs is used. If the specified number of subimages cannot be extracted, lvmos2band will return an error and the output image will not be created. If num_flag is FALSE, lvmos2band calculates the number of subimages that will be banded, taking into account both the subimage skip value and the subimage offsets.

Subimage skip value

The subimage skip value parameter (sub_skip) specifies the number of subimages to be skipped each time a subimage is stored as a band. For example, a skip value of sub_skip=1 in a 3x3 subimage mosaic would band the subimages in a checkerboard pattern (every other subimage is a band in the output image). When applying the subimage skip value, lvmos2band looks at the series of subimages as a linear array. Therefore, the row/column arrangement of subimages does not affect how the skipping occurs.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

Vmos2band does not work on explicit location data and will return an error when such an image is encountered. No output image will be created.

MODIFICATION

none

FILES

$RETRO/objects/library/vipl/src/lvmos2band.c

SEE ALSO

vipl(3)

COPYRIGHT

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