note 28656 added to function.imagecopyresized
| From: | jou at NOSPAM dot kordi dot Res dot kr | Date: | Mon, 20 Jan 2003 01:36:57 +0000 |
| Subject: | note 28656 added to function.imagecopyresized | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42400@lists.php.net to get a copy of this message | ||
Re: Numerical filtering
Sampling theoem (including filtering, sinc ftn, anti-aliasing, fft...) can only be applied to
"time series".
"Time series" generally have the following features:
1. Stationary (finite train)
2. Band-limited
3. zero Average
These features can make that time series can be approximated
as sinusodial functions (aka fourier sum).
Hm...
I think Image data does NOT belong to time series.
(Not Stationary, Not Band-limited, Not Zero avr.)
I also think using float is not a mistake but a rough calculation.
Generally Time series data can be resampled with the following steps:
1. Anti-aliasing filter (A kind of smoothing)
2. Resample
In ImageCopyResampleBicubic(), just averaging summation of pixel values around is also a kind of
smoothing (called Moving[Running] Average in time series analysis).
And I'd like to comment ImageCopyResampleBicubic() can be
modified with more accurate calculation using integer calculation and weighted-summation of four
different pixel values around.
Example for "Image is Not a Time series": 1-D case:
original: 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30
---15 data are resampled to 11 data---
1. using sinc function (sampling theorem)
10 9.3 10.4 11.4 21.8 20 17.8 29.0 30.4 28.1 30
(fluctuationg due to Gibbs phenomenon)
2. using ImageCopyResampleBicubic() algorithm
10 10 10 15 20 20 20 25 30 30 30
Good day.
jou
--
http://www.php.net/manual/en/function.imagecopyresized.php
http://master.php.net/manage/user-notes.php?action=edit+28656
http://master.php.net/manage/user-notes.php?action=delete+28656
http://master.php.net/manage/user-notes.php?action=reject+28656