refactored the code for field detection to use MultiSpectralImages