diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/imStats.m')
| -rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/imStats.m | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/imStats.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/imStats.m deleted file mode 100755 index 3d79b4c..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/imStats.m +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | % imStats(IM1,IM2) | ||
| 2 | % | ||
| 3 | % Report image (matrix) statistics. | ||
| 4 | % When called on a single image IM1, report min, max, mean, stdev, | ||
| 5 | % and kurtosis. | ||
| 6 | % When called on two images (IM1 and IM2), report min, max, mean, | ||
| 7 | % stdev of the difference, and also SNR (relative to IM1). | ||
| 8 | |||
| 9 | % Eero Simoncelli, 6/96. | ||
| 10 | |||
| 11 | function [] = imStats(im1,im2) | ||
| 12 | |||
| 13 | if (~isreal(im1)) | ||
| 14 | error('Args must be real-valued matrices'); | ||
| 15 | end | ||
| 16 | |||
| 17 | if (exist('im2') == 1) | ||
| 18 | difference = im1 - im2; | ||
| 19 | [mn,mx] = range2(difference); | ||
| 20 | mean = mean2(difference); | ||
| 21 | v = var2(difference,mean); | ||
| 22 | if (v < realmin) | ||
| 23 | snr = Inf; | ||
| 24 | else | ||
| 25 | snr = 10 * log10(var2(im1)/v); | ||
| 26 | end | ||
| 27 | fprintf(1, 'Difference statistics:\n'); | ||
| 28 | fprintf(1, ' Range: [%c, %c]\n',mn,mx); | ||
| 29 | fprintf(1, ' Mean: %f, Stdev (rmse): %f, SNR (dB): %f\n',... | ||
| 30 | mean,sqrt(v),snr); | ||
| 31 | else | ||
| 32 | [mn,mx] = range2(im1); | ||
| 33 | mean = mean2(im1); | ||
| 34 | var = var2(im1); | ||
| 35 | stdev = sqrt(real(var))+sqrt(imag(var)); | ||
| 36 | kurt = kurt2(im1, mean, stdev^2); | ||
| 37 | fprintf(1, 'Image statistics:\n'); | ||
| 38 | fprintf(1, ' Range: [%f, %f]\n',mn,mx); | ||
| 39 | fprintf(1, ' Mean: %f, Stdev: %f, Kurtosis: %f\n',mean,stdev,kurt); | ||
| 40 | end | ||
| 41 | |||
