\documentclass[11pt,onecolumn]{article}
\usepackage{epsfig}
\usepackage{color}

\title{Coordinates in Rebinned Images}
\author{C. Kankelborg, 2006 June 10}
\date{}

\begin{document}

\maketitle
\thispagestyle{empty} % suppress page numbers

\begin{figure*}[!b]
\resizebox{\textwidth}{!}{ \rotatebox{0}{\input{rebin_coords.pstex_t}} }
%\caption{Image coordinates for several example pixels. }
\end{figure*}


This note describes the change of pixel coordinates when an
image is rebinned to lower resolution by some integer factor $M$.

Suppose we have an image $\mathcal{I}$, of $M N_x \times M N_y$ pixels,
where $M$ is an integer. The coordinates in $\mathcal{I}$ are
$\mathbf{r}=(x,y)$, which denote zero offset indices for image pixels. The
\textit{center} of the lower left-hand pixel is at $(0,0)$, and the center of
the upper right-hand pixel is at $(M N_x-1, M N_y-1)$.

Now rebin the image to size $N_x \times N_y$, forming image $\mathcal{I'}$,
with its pixel coordinates $\mathbf{r'}$. The center of the lower left-hand
pixel in $\mathcal{I'}$ is at $\mathbf{r'}=(0,0)$, and the upper right-hand
pixel is at $(N_x-1, N_y-1)$. However, these do not correspond to the lower
left and upper right pixels of the original image $\mathcal{I}$. The figure
shows image coordinates for several example points. Note how rebinning
has moved the origin. Integer coordinates in $\mathcal{I'}$ do not, in
general, correspond to integer coordinates in $\mathcal{I}$. The two points at
the corners (in black) are easy to work out. From these, it can be shown that 
\[
   \mathbf{r} = M \mathbf{r'} + \frac{M}{2} - \frac{1}{2},
           \quad \mbox{or} \quad
   \mathbf{r'} = \frac{\mathbf{r}}{M} + \frac{1}{2M} - \frac{1}{2}.
\]




\end{document}
