Changeset 1426 for trunk/psLib/src/image/psImageExtraction.h
- Timestamp:
- Aug 9, 2004, 12:44:25 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/image/psImageExtraction.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImageExtraction.h
r1407 r1426 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 7 00:06:06$12 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-09 22:44:25 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 /// @{ 27 27 28 /* Cut direction flag. Used with psImageCut function. 29 */ 28 30 typedef enum { 29 PS_CUT_X_POS, 30 PS_CUT_X_NEG, 31 PS_CUT_Y_POS, 32 PS_CUT_Y_NEG, 31 PS_CUT_X_POS, ///< Cut in the x dimension from left to right 32 PS_CUT_X_NEG, ///< Cut in the x dimension from rigth to left 33 PS_CUT_Y_POS, ///< Cut in the y dimension from bottom up 34 PS_CUT_Y_NEG, ///< Cut in the y dimension from top down. 33 35 } psImageCutDirection; 34 36 35 37 /** Create a subimage of the specified area. 36 * 37 * Uses psLib memory allocation functions to create an image based on a larger 38 * one. 39 * 40 * @return psImage*: Pointer to psImage. 41 * 42 */ 43 psImage *psImageSubset(psImage * out, // /< Subimage to return, or NULL. 44 psImage * image, // /< Parent image. 45 unsigned int numCols, // /< Subimage width (<= image.nCols - col0). 46 unsigned int numRows, // /< Subimage height (<= image.nRows - row0). 47 unsigned int col0, // /< Subimage col-offset (0 <= col0 < nCol). 48 unsigned int row0 // /< Subimage row-offset (0 <= row0 < nCol). 49 ); 38 * 39 * Uses psLib memory allocation functions to create an image based on a larger 40 * one. 41 * 42 * @return psImage*: Pointer to psImage. 43 * 44 */ 45 psImage* psImageSubset( 46 psImage* out, ///< image to recycle, or NULL. 47 psImage* image, ///< Parent image. 48 unsigned int numCols, ///< Subimage width (<= image.nCols - col0). 49 unsigned int numRows, ///< Subimage height (<= image.nRows - row0). 50 unsigned int col0, ///< Subimage col-offset (0 <= col0 < nCol). 51 unsigned int row0 ///< Subimage row-offset (0 <= row0 < nCol). 52 ); 50 53 51 54 /** Makes a copy of a psImage … … 55 58 * 56 59 */ 57 psImage *psImageCopy(psImage * restrict output, 60 psImage* psImageCopy( 61 psImage* restrict output, ///< if not NULL, a psImage that could be recycled. 62 const psImage* input, ///< the psImage to copy 63 psElemType type ///< the desired datatype of the returned copy 64 ); 58 65 59 /**< if not NULL, a psImage that could be recycled. If it can not be used,60 * it will be freed via psImageFree61 */62 const psImage * input,63 66 64 /**< the psImage to copy */ 65 psElemType type 67 /** Extract pixels from rectlinear region to a vector (array of floats). 68 * 69 * The output vector contains either nx or ny elements, based on the value of 70 * the direction: e.g., if direction is PS_CUT_X_POS, there are nx elements. 71 * The input region is collapsed in the perpendicular direction, and each 72 * element of the output vectors is derived from the statistics of the pixels 73 * at that direction coordinate. The statistic used to derive the output 74 * vector value is specified by stats. Only one of the statistics choices may 75 * be specified, otherwise the function must return an error. This function 76 * must be defined for the following types: psS8, psU16, psF32, psF64. 77 * 78 * @return psVector the resulting vector 79 */ 80 psVector *psImageSlice( 81 psVector* out, ///< psVector to recycle, or NULL. 82 psVector* slicePositions, 83 ///< If not NULL, it is populated with the coordinate in the slice dimension 84 ///< coorsponding to the output vector's value of the same position in the 85 ///< vector. This vector maybe resized and retyped as appropriate. 86 const psImage* restrict input, ///< the input image in which to perform the slice 87 const psImage* restrict mask, ///< the mask for the input image. 88 unsigned int maskVal, ///< the mask value to apply to the mask 89 unsigned int col, ///< the leftmost column of the slice region 90 unsigned int row, ///< the bottommost row of the slice region 91 unsigned int numCols, ///< the number of columns in the slice region 92 unsigned int numRows, ///< the number of rows in the slice region 93 psImageCutDirection direction, ///< the slice dimension and direction 94 const psStats* stats ///< the statistic to perform in slice operation 95 ); 66 96 67 /**< the desired datatype of the returned copy */ 68 ); 97 /** Extract pixels from an image along a line to a vector (array of floats). 98 * 99 * The vector (xs,ys) - (xe,ye) forms the basis of the output vector. Pixels 100 * are considered in a rectangular region of width dw about this vector. The 101 * input region is collapsed in the perpendicular direction, and each element 102 * of the output vector represents pixel-sized boxes, where the value is 103 * derived from the statistics of the pixels interpolated along the 104 * perpendicular direction. The specific algorithm which must be used is 105 * described in the PSLib ADD (PSDC-430-006). The statistic used to derive 106 * the output vector value is specified by stats. Only one of the statistics 107 * choices may be specified, otherwise the function must return an error. 108 * This function must be defined for the following types: psS8, psU16, psF32, 109 * psF64. 110 * 111 * @return psVector resulting vector 112 */ 113 psVector *psImageCut( 114 psVector* out, ///< psVector to recycle, or NULL. 115 const psImage* input, ///< the input image in which to perform the cut 116 const psImage* restrict mask, ///< the mask for the input image. 117 unsigned int maskVal, ///< the mask value to apply to the mask 118 float startCol, ///< the column of the start of the cut line 119 float startRow, ///< the row of the start of the cut line 120 float endCol, ///< the column of the end of the cut line 121 float endRow, ///< the row of the end of the cut line 122 float width, ///< the distance about the line to perform the statistics 123 const psStats* stats ///< the statistic to perform in operation 124 ); 69 125 70 psVector *psImageSlice(psVector * out, 71 psVector * slicePositions, 72 const psImage * restrict input, 73 const psImage * restrict mask, 74 unsigned int maskVal, 75 unsigned int col, 76 unsigned int row, 77 unsigned int numCols, 78 unsigned int numRows, psImageCutDirection direction, const psStats * stats); 79 80 psVector *psImageCut(psVector * out, 81 const psImage * input, 82 const psImage * restrict mask, 83 unsigned int maskVal, 84 float startCol, 85 float startRow, float endCol, float endRow, float width, const psStats * stats); 86 87 psVector *psImageRadialCut(psVector * out, 88 const psImage * input, 89 const psImage * restrict mask, 90 unsigned int maskVal, 91 float centerCol, float centerRow, const psVector * radii, const psStats * stats); 126 /** Extract radial region data to a vector. A vector is constructed where each 127 * vector elements is derived from the statistics of the pixels which land 128 * within one of a sequence of radii. The radii are centered on the image 129 * pixel coordinate x,y, and are defined by the sequence of values in the 130 * vector radii. The specific algorithm which must be used is described in 131 * the PSLib ADD (PSDC-430-006). The statistic used to derive the output 132 * vector value is specified by stats. Only one of the statistics choices 133 * may be specified, otherwise the function must return an error. This 134 * function must be defined for the following types: psS8, psU16, psF32, 135 * psF64. 136 * 137 * @return psVector resulting vector 138 */ 139 psVector* psImageRadialCut( 140 psVector* out, ///< psVector to recycle, or NULL. 141 const psImage* input, ///< the input image in which to perform the cut 142 const psImage* restrict mask, ///< the mask for the input image. 143 unsigned int maskVal, ///< the mask value to apply to the mask 144 float centerCol, ///< the column of the center of the cut circle 145 float centerRow, ///< the row of the center of the cut circle 146 const psVector* radii, ///< the radii of the cut circle 147 const psStats* stats ///< the statistic to perform in operation 148 ); 92 149 93 150 /// @}
Note:
See TracChangeset
for help on using the changeset viewer.
