Haar Wavelet Transforms (HWTs)
are used to detect significant changes in signal values. In two previous posts (here and here), I formalizied 1D Haar Wavelet up-down and down-up spikes that can be used to detect changes in signals. Specifically, four types of spikes were proposed: up-down
triangle, up-down trapezoid, down-up triangle, and down-up trapezoid. In this post, I will formally outline a method for using 1D Haar Wavelet Spikes to count changes in images.
Let us assume that we will be detecting changes in image rows. Image columns will work just as well. A spike pixel then is a pixel covered by an up-down or down-up spike detected in some row. Formally, when spikes are
computed for row
,
the column indices of the actual pixels covered by each spike at
scale j are computed by the formula in Eq. 1, where s and
e are the positions of the starting and ending wavelet
coefficients in the 1D HWT at scale j, respectively. For
up-down spikes
and
,
whereas, for down-up spikes,
and
Eq. 1. Column indices of pixels covered by spikes. |
Let n be the number of rows in an image and let
be
the set of up-down spikes in row
Then the set of pixel columns in row
covered by the up-down spikes in
is given in Eq. 2, where j is a given scale and
and
are
the beginning and end positions of an up-down spikedetected
in row
respectively.
Eq. 2. Set of pixel columns in row covered by up-down spikes. |
Letis
the set of down-up spikes in row
Then the set of pixel columns in
covered by the down-up spikes is Eq. 3, where j is a
given scale and
and
are
the beginning and end positions of a down-up spike
detected
in row
respectively.
Eq. 3. Set of pixel columns in row covered by down-up spikes. |
The number of unique column pixels covered by the up-down and down-up
spikes in row
is given in Eq. 4. The formula in Eq. 5 gives the actual number of
pixels covered by the up-down and down-up spikes in an image
with
n rows.
Eq. 4. Set of unique pixel columns in row covered by down-up spikes. |
Eq. 5. Number of unique pixel columns covered by up-down and down-up spikes in image with n rows. |