% function that scales 2D image functions fin and hin % so that they have equal rms function [f, h] = scale_rms (fin, hin); rms_f = sqrt (mean(mean(fin.*fin))); rms_h = sqrt (mean(mean(hin.*hin))); beta = sqrt (rms_h / rms_f); % the scale parameter f = beta .* fin; h = hin ./ beta;