Tophat transform matlab code