This paper describes a multi-spectral imaging near infrared (NIR) transflectance system developed for on-line determination of crude chemical composition of highly heterogeneous foods and other bio-materials. The system was evaluated for moisture determination in 70 dried salted coalfish (bacalao), an extremely heterogeneous product. A spectral image cube was obtained for each fish and different sub-sampling approaches for spectral extraction and partial least squares calibration were evaluated. The best prediction models obtained correlation R-2 values around 0.92 and root mean square error of cross-validation of 0.70%, which is much more accurate than today's traditional manual grading. The combination of non-contact NIR transflectance measurements with spectral imaging allows rather deep penetrating optical sampling as well as large flexibility in spatial sampling patterns and calibration approaches. The technique works well for moisture determination in heterogeneous foods and should, in principle, work for other NIR absorbing compounds such as fat and protein. A part of this study compares the principles of reflectance, contact transflectance and non-contact transflectance with regard to water determination in a set of 20 well-defined dried salted cod samples. Transflectance and non-contact transflectance performed equally well and were superior to reflectance measurements, since the measured light penetrated deeper into the sample.