The objective of this research was to develop an optimal wavelength imaging system for detecting foreign fibers in the near infrared (NIR) region from 750 to 2500 nm. This method is based on the principle that different fibers have different spectral absorptions and reflectance characteristics. When subjected to a source of illumination at different wavelengths, foreign fibers present different reflectance values from those of cotton fibers. For simultaneously discriminating several types of foreign fibers from cotton, an optimal wavelength evaluation function for describing the cotton–foreign-fiber absorption discrimination was set up. Through a Fourier transform spectrometer experiment, the optimal wavelength for detecting these foreign fibers was determined and accordingly an optimal wavelength imaging system was developed. The wavelength selection experiment showed that 940 nm was the most appropriate wavelength for detection of a wide range of foreign fibers in cotton, and the 940-nm imaging system gave clear image features of these foreign fibers. The result suggests that NIR optimal wavelength imaging is a feasible and effective method to detect foreign fibers in cotton, which are currently difficult to detect.