CropBalanced not getting correct type of file

The method getHighestEnergyPoint not get the correct type of file.