Changeset 3420
- Timestamp:
- Mar 14, 2005, 5:00:57 PM (21 years ago)
- Location:
- trunk/doc/pslib
- Files:
-
- 2 edited
-
ChangeLogSDRS.tex (modified) (2 diffs)
-
psLibSDRS.tex (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/ChangeLogSDRS.tex
r3340 r3420 1 %%% $Id: ChangeLogSDRS.tex,v 1.7 2 2005-02-28 21:37:15price Exp $1 %%% $Id: ChangeLogSDRS.tex,v 1.73 2005-03-15 03:00:52 price Exp $ 2 2 3 3 \subsection{Changes from version 00 to version 01} … … 481 481 from a file. 482 482 \item \code{psMetadataAddV} changed to use \code{va_list} parameter (bug 312). 483 \end{itemize} 483 \item Added \code{psPixels} structure, \code{psPixelsToMask}, 484 \code{psMaskToPixels}, \code{psPixelsConcatenate} and 485 \code{psPixelsTransform}. 486 \item Modified \code{psImageTransform} in preparation for image combination. 487 \item Added \code{psPlaneTransformDeriv}. 488 \end{itemize} -
trunk/doc/pslib/psLibSDRS.tex
r3340 r3420 1 %%% $Id: psLibSDRS.tex,v 1.18 4 2005-02-28 21:36:35price Exp $1 %%% $Id: psLibSDRS.tex,v 1.185 2005-03-15 03:00:57 price Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 2846 2846 2847 2847 \begin{verbatim} 2848 // Transform an image --- different from current version, nothing major 2849 psImage *psImageTransform(psImage *output, psPixels **blankPixels, const psImage *input, 2850 const psImage *inputMask, int inputMaskVal, const psPlaneTransform *outToIn, 2851 const psRegion *region, const psPixels *pixels, psImageInterpolateMode mode, 2852 double exposedValue); 2853 \begin{verbatim} 2848 2854 psImage *psImageTransform(psImage *output, const psImage *input, const psImage *inputMask, int inputMaskVal, 2849 2855 const psPlaneTransform *outToIn, const psImage *combineMask, int combineMaskVal); 2850 2856 \end{verbatim} 2851 2857 Transform the \code{input} image according the supplied 2852 transformation. In the event that the \code{output} is \code{NULL}, 2853 the smallest possible image capable of containing the entire 2854 transformed \code{input} image is to be returned; otherwise only the 2855 image size specified in the \code{output} image is to be used. If the 2856 \code{inputMask} is not \code{NULL}, those pixels in the 2858 transformation. The size of the transformed image is defined by the 2859 supplied \code{output} image, if non-\code{NULL}, or the \code{region} 2860 otherwise (size \code{region->x1 - region->x0} by \code{region->y1 - 2861 region->y0}, with \code{out->x0 = region->x0} and \code{out->y0 = 2862 region->y0}). 2863 2864 If the \code{inputMask} is non-\code{NULL}, those pixels in the 2857 2865 \code{inputMask} matching \code{inputMaskVal} are to be ignored in the 2858 2866 transformation. The \code{inputMask} must be of type \code{psU8}, and … … 2862 2870 in the output image --- note that this is the reverse of what might be 2863 2871 naively expected, but it is what is required in order to use 2864 \code{psImagePixelInterpolate}. If \code{combineMask} is not 2865 \code{NULL}, then those pixels that match \code{combineMaskVal} are 2866 not transformed. \code{combineMask} must be of type \code{psU8} and 2867 of the same size as the \code{output}, otherwise the function shall 2868 generate an error and return \code{NULL}. This function must be 2872 \code{psImagePixelInterpolate}. If \code{pixels} is non-\code{NULL}, 2873 then only those pixels in the output image are transformed; otherwise, 2874 the entire image is generated. The interpolation is performed using 2875 the specified interpolation \code{mode}. Where a pixel in the output 2876 image does not correspond to a pixel in the input image (or all 2877 appropriate pixels in the input image are masked), the value shall be 2878 set to \code{exposed}, and the pixel added to the list of 2879 \code{blankPixels} for return to the user. This function must be 2869 2880 capable of handling the following types for the \code{input} (with 2870 2881 corresponding types for the \code{output}): \code{psF32}, … … 4875 4886 the fit shall be rejected. 4876 4887 4888 \paragraph{Derivatives} 4889 4890 In order to simply calculate which pixels in one coordinate frame 4891 overlap those in another coordinate frame tied by a 4892 \code{psPlaneTransform}, we need to calculate the derivative of a 4893 transformation with respect to each coordinate. 4894 4895 \begin{verbatim} 4896 psPlane *psPlaneTransformDeriv(psPlane *out, const psPlaneTransform *transformation, const psPlane *coord); 4897 \end{verbatim} 4898 4899 \code{psPlaneTransformDeriv} shall return the derivatives of the 4900 \code{transformation} at the specified coordinates, \code{coord}. 4901 Both the derivatives with respect to $x$ and $y$ shall be returned. 4902 If \code{out} is non-\code{NULL}, it shall be modified and returned; 4903 otherwise a new \code{psPlane} shall be allocated and returned. In 4904 the event that either \code{transformation} or \code{coord} are 4905 \code{NULL}, the function shall generate an error and return 4906 \code{NULL}. 4907 4908 4877 4909 \subsubsection{Celestial Coordinate Conversions} 4878 4910 … … 5032 5064 %%% Astronomical Images and Astrometry 5033 5065 \include{psLibSDRS_Astrom} 5066 5067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5068 5069 \subsection{Pixel Lists} 5070 5071 Usually an image mask is the best way to carry information about what 5072 pixels mean what. However, in the case where the number of pixels in 5073 which we are interested is limited, it is more efficient to simply 5074 carry a list of pixels. An example of this is in the image 5075 combination code, where we want to perform an operation on a 5076 relatively small fraction of pixels, and it is inefficient to go 5077 through an entire mask image checking each pixel. 5078 5079 \begin{verbatim} 5080 typedef struct { 5081 psVector *x; // x coordinate 5082 psVector *y; // y coordinate 5083 } psPixels; 5084 \end{verbatim} 5085 5086 Of course, the size of each of the vectors should match. In the event 5087 that they do not match, any function which detects the problem shall 5088 generate a warning and use the size of the shorter of the vectors as 5089 the size. The order in which the pixels are kept is not considered 5090 important. 5091 5092 \begin{verbatim} 5093 psImage *psPixelsToMask(psImage *out, const psPixels *pixels, const psRegion *region, unsigned int maskVal); 5094 psPixels *psMaskToPixels(psPixels *out, const psImage *mask, unsigned int maskVal); 5095 \end{verbatim} 5096 5097 \code{psPixelsToMask} shall return an image of type U8 with the 5098 \code{pixels} lying within the specified \code{region} set to the 5099 \code{maskVal}. The \code{out} image shall be modified if supplied, 5100 or allocated and returned if \code{NULL}. The size of the output 5101 image shall be \code{region->x1 - region->x0} by \code{region->y1 - 5102 region->y0}, with \code{out->x0 = region->x0} and \code{out->y0 = 5103 region->y0}. In the event that either of \code{pixels} or 5104 \code{region} are \code{NULL}, the function shall generate an error 5105 and return \code{NULL}. 5106 5107 \code{psMaskToPixels} shall return a \code{psPixels} consisting of the 5108 coordinates in the \code{mask} that match the \code{maskVal}. The 5109 \code{out} pixel list shall be modified if supplied, or allocated and 5110 returned if \code{NULL}. In hte event that \code{mask} is 5111 \code{NULL}, the function shall generate an error and return 5112 \code{NULL}. 5113 5114 \begin{verbatim} 5115 psPixels *psPixelsConcatenate(psPixels *out, const psPixels *pixels); 5116 \end{verbatim} 5117 5118 \code{psPixelsConcatenate} shall concatenate \code{pixels} onto 5119 \code{out}. In the event that \code{out} is \code{NULL}, a new 5120 \code{psPixels} shall be allocated, and the contents of \code{pixels} 5121 simply copied in. If \code{pixels} is \code{NULL}, the function shall 5122 generate an error and return \code{NULL}. The function shall take 5123 care to ensure that there are no duplicate pixels in \code{out} (since 5124 the order in which the pixels are stored is not important, the values 5125 may be sorted, allowing the use of a faster algorithm than a linear 5126 scan). 5127 5128 \begin{verbatim} 5129 psPixels *psPixelsTransform(psPixels *out, const psPixels *input, const psPlaneTransform *inToOut); 5130 \end{verbatim} 5131 5132 \code{psPixelsTransform} shall generate a list of pixels in the output 5133 coordinate frame that overlap the \code{input} pixels in the input 5134 coordinate frame through the specified transformation, \code{inToOut}. 5135 Note that this is more complicated than simply transforming the 5136 \code{input} pixels, but requires the evaluation of the derivatives of 5137 the transformation in order to obtain the list of all pixels in the 5138 output coordinate frame that possibly overlap the pixel in the input 5139 coordinate frame (assuming that $x' + \Delta x' = f(x) + \Delta x 5140 \times \partial f(x) / \partial x$, where $x'$ is the coordinate in 5141 the output coordinate frame, $\Delta x'$ is the size of the region in 5142 the output coordinate frame in the positive direction that overlaps 5143 the input pixel, $x$ is the coordinate in the input coordinate frame, 5144 $f(x)$ is the transformation from the input to the output coordinate 5145 frames, and $\Delta x$ is the size of a pixel; care should be taken 5146 with half-pixel problems). In the event that \code{input} or 5147 \code{inToOut} are \code{NULL}, the function shall generate an error 5148 and return \code{NULL}. 5034 5149 5035 5150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note:
See TracChangeset
for help on using the changeset viewer.
