  We describe the algorithm that selects the main sample of galaxies for
spectroscopy in the Sloan Digital Sky Survey from the photometric data obtained
by the imaging survey. Galaxy photometric properties are measured using the
Petrosian magnitude system, which measures flux in apertures determined by the
shape of the surface brightness profile. The metric aperture used is
essentially independent of cosmological surface brightness dimming, foreground
extinction, sky brightness, and the galaxy central surface brightness. The main
galaxy sample consists of galaxies with r-band Petrosian magnitude r < 17.77
and r-band Petrosian half-light surface brightness < 24.5 magnitudes per square
arcsec. These cuts select about 90 galaxy targets per square degree, with a
median redshift of 0.104. We carry out a number of tests to show that (a) our
star-galaxy separation criterion is effective at eliminating nearly all stellar
contamination while removing almost no genuine galaxies, (b) the fraction of
galaxies eliminated by our surface brightness cut is very small (0.1%), (c) the
completeness of the sample is high, exceeding 99%, and (d) the reproducibility
of target selection based on repeated imaging scans is consistent with the
expected random photometric errors. (abridged)
