-
Notifications
You must be signed in to change notification settings - Fork 0
Filters
This wiki page gives a high level overview of all of the filters implemented in this project.
-
AbstractBinaryFilterANDFilter
Performs a bitwise AND operation between the pixels of 2 images
ORFilter
Performs a bitwise OR operation between the pixels of 2 images
XORFilter
Performs a bitwise XOR operation between the pixels of 2 images
-
BrightnessFilterAdds a given value to each color channel of the pixels of the image in order to adjust the brightness
Note: the value can be negative in order to reduce brightness -
ColorDepthReductionFilterTrims down a given number of bits from all color channels in order to reduce color depth Note: bits can be removed either starting from MSB or LSB
-
ContrastFilterAdjusts the contrast of the image by performing the following operation on each color channel: value = (value - 128) * factor + 128,
where factor =$\frac{259 * (given contrast level + 255)}{255 * (259 - given contrast level)}$ -
ConvolutionFilterPerforms matrix convolution against the pixel matrix and various convolution masks.
Available convlution masks:- Blur Masks
- Box Blur (3x3 or 5x5)
- Gaussian Blur (3x3 or 5x5)
- Laplacian Mask (3x3)
- Prewitt Mask (3x3 horizontal or 3x3 vertical)
- Sharpen Mask (3x3 low/high intensity)
- Sobel Mask (3x3 horizontal or 3x3 vertical)
- Blur Masks
-
AbstractGrayLevelFilter-
LinearGrayLevelFilterThe linear transformations can be defined by this formula
value = 255 - value
It is basically the asme thing as aNegativeFilter -
LogarithmicGrayLevelFilterThe log transformations can be defined by this formula
value = c * log(value + 1)
for each color channel, where c is a given constant -
PoweLawGrayLevelFilterThe power law transformations can be defined by this formula
value = c * (value ^ y)
for each color channel, where c and y are given constants
-
-
AbstractGrayscaleFilter-
AverageGrayscaleFilteraverages all 3 color channels, by setting value = (red + green + blue) / 3
-
WeightedGrayscaleFilterApplies a given weight to each color channel, with the constraint that the 3 weights must add up to 1
value = (red * redWeight + green * greenWeight + blue * blueWeight) -
GrayscaleToBinaryFilterMakes all pixels of a grayscale image either black or white, depending on whether or not their color intensity is lower or greater than a given threshold
-
-
AbstractHistogramFilterKeeps track of how often each color intensity is encountered in an image and plots the result in a histogram
-
RedHistogramFilterConstructs a histogram for the red channel
-
GreenHistogramFilterConstructs a histogram for the green channel
-
BlueHistogramFilterConstructs a histogram for the blue channel
-
GrayHistogramFilterConstructs a histogram for the red channel on a grayscaled image
-
-
NegativeFilterSets value = 255-value for each color channel
-
MirrorFilterMirrors the pixel matrix either against he y axis or the x axis.
-
NormalizationFilterNormalizes the color intensities by setting: value = (value / (red + green + blue)) * 255 for each color channel
-
RotateFilterSimply performs matrix rotation on the pixel matrix
-
TranslateFilterMoves all pixels to the right and down by a given amount, basically enlarging the matrix and the image itself.
The newly generated whitespace is either filled with black or a custom color. -
AbstractZoomFilter-
KTimesZoomFilterLet K be the zoom level:
for each adjacent pixel, we call the bigger value max and smaller min:
for i = 0 : K-1
pixel[xK+i+1][yK] = min + (max - min) / K * i -
PixelReplicationZoomFilterIn this method, we just replicate the neighboring pixels for each given pixel firstly row-wise, and then column-wise
-
ZeroOrderHoldZoomFilterIn this method, we pick two adjacent elements and then place their average between them
-
Based on the list above, each base level filter, such as BrightnessFilter, ContrastFilter or NegativeFilter are standalone classes that extend the GenericFilter and override the filter(Image) method in order to apply their associated algorythms.
The entries that have sublists, such as AbstactBinaryFilter, AbstractHistogramFilter and AbstractGrayscaleFilter are implemented as abstract classes and provide a general implementation in the filter(Image) method, so that the child classes, such as ANDBinaryFilter etc can tweak various parameters to customize the algorythm.
-
Classes documentation
- 'App'
- 'objects.GenericJob'
- 'objects.filters.GenericFilter`
- 'objects.filters.IFilter`
- 'objects.filters.Filters`
- 'objects.image.BitmapImage'
- 'objects.image.Image'
- 'objects.image.Pixel'
- 'objects.runnables.Producer'
- 'objects.runnables.Consumer'
- 'objects.singletons.ArgParser'
- 'objects.singletons.BmpIO'
- 'objects.singletons.FilterBuilder'
- 'objects.singletons.Prompter'
- 'objects.singletons.Timer'
-
Overview of the homework requirements