-
Notifications
You must be signed in to change notification settings - Fork 0
Luma Time Series
The Luma Times series is a series, that is generated when vertically measuring the
A Luma Time Series is a time series L(y) indexed by
row and gives the value of the Luma of the left-most or right-most
pixel of that row. For each shred there exists a Luma time series for
the left and for the right-hand sides (Ll(y) and Lr(y) respectively).
The Luma Series is computed for an image of a single shred.
The Luma series is calculated alongside the left, right, top or bottom side of an image.
For the purposes of implementation, we assume that the input image contains three types of pixels.
-
Background Pixels : Transparent pixels that have maximum
ALPHAvalues and are to be ignored - Residue Pixels: Pixels that are not transparent but do belong to background and could not be removed via preprocessing are considered to be residual, and don't offer any signal. The first 1-3 pixels tend to be residual.
- Signal Pixels: Signal pixels are those that belong the shred itself and are what we are looking for.
To consolidate the luminosity from the 3 RGB Channels, we reduce the three channels of the RGB picture into a single channel The Luma of a given pixel is given by the following formula
L(x) = 0.3*(X.RED) + 0.59*(x.BLUE) + 0.11*(x.GREEN)
The aim of the luma is to find a representative value of the color informatino at the edge of a shred.
Given the edge of a shred in image, the boundary of the edge is first non transparent pixel in a given row or column.
However, to ensure that residual pixels (see definition above) are ignored a buffer parameter can be included.
buffer : Number of pixels at boundary to ignore.
Often a single pixel won't be representative of the color information at a given edge, therefore we define another parameter to indicate the number of pixels to be sampled to create a representative pixel, signal_size
signal_size : Represents the Number of pixels to sample when calculating the representative pixel
To calculate the representative pixel, a uniformly decreasing weighting is applied across the set of sample pixels, to give those close to the boundary greater weighting and those further in less weighting.
The following pseudo code shows the luma time series for a row of pixels
Luma( Image, row , buffer, signal_size)
boundary_position = first non transparent pixel on image[row]
signal_start = buffer + boundary_position
sample_set = { L(x) for each pixel x in Image[ row, signal_start .. signal_stop ] }
luma_series = Average( Weighted( sample_set ) )
return luma_series
Given an image, we can calculate a Luma series from the left, right, top and bottom.
To calculate the luma series for the LEFT side of an image. See Above for Luma Definition
LumaSeries( Image , buffer, signal_size )
luma_series = []
for row = 0 .. Image.Height
luma_series[row] = Luma( Image , row , buffer, signal_size )
In practice,
-
buffer_size = 3: Works well -
signal_size = 5: Samples well