Hyperspectral imaging under transmittance mode has shown potential for detecting internal defect, however, the technique still cannot meet the online speed requirement because of the need to acquire and analyze a large amount of image data. This study was carried out to select important wavebands for further development of an online inspection system to detect internal defect in pickling cucumbers and whole pickles. Hyperspectral transmittance/reflectance images were acquired from normal and defective cucumbers and whole pickles using a prototype hyperspectral reflectance (400–740 nm)/transmittance (740–1000 nm) imaging system. Up to four-waveband subsets were determined by a branch and bound algorithm combined with the k-nearest neighbor classifier. Different waveband binning operations were also compared to determine the bandwidth requirement for each waveband combination. The highest classification accuracies of 94.7 and 82.9% were achieved using the optimal four-waveband sets of 745, 805, 965, and 985 nm at 20 nm spectral resolution for cucumbers and of 745, 765, 885, and 965 nm at 40 nm spectral resolution for whole pickles, respectively. The selected waveband sets will be useful for online quality detection of pickling cucumbers and pickles.