Skip to content

About

Loosely coupled MVP monolith for the digital image processing domain. Additionally, it provides a cross-platform engine for running console applications and static or XAML/XML-based forms

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Disclaimer: The software provided in this repository was developed without the use of generative AI. Generative AI may only be used to verify grammatical correctness and syntax.

The application was originally developed as an R&D project between 2017 and 2019.

The original purpose was to investigate the potential advantages of optimizing the contrast of grayscale images using a normal distribution compared with a uniform distribution. Two parameters - the expectation and standard derivation - allow to the relative luminance and contrast, respectively, to be controlled.

Microkernel Guide&Demo for WPF (SDI), Winforms (MDI/SDI/TDI) and Console processes

Image-Processing

  1. Overview
  2. Microkernel
  3. Application
  4. Integration tests
  5. Managing Grayscale Images
  6. Created With
  7. Benchmarks
  8. NuGet

Overview

The application consists of a desktop window with a main viewport implemented as a PictureBox where the sequentially transformed images are rendered. The menu on the top allows users to generate views, which are appended to the bottom. The toolbar below the menu allows to undo or redo transformations, restore the originally loaded image, and capture a custom area within the viewport. Two trackbars apply rotation or scaling transformations without rendering an image.

Each generated view produces a tab below the viewport, allowing users to apply algorithms or manage related parameters.

application window

Fig. 1 - The main view and transient/singleton views are displayed as tabs. The opened affine transformation tab is a transient view. The settings tab is a singleton view. The frame is taken from the "Thomas the Tank Engine" series and processed using the following algorithm chain: Grayscale->Inversion->Laplacian Operator 5x5->Inversion->Shear Rotation 20°->Bicubic Interpolation (0.2, 0.2)->Cyclic Translation (33, 33) (hold) [cpu].

Hierarchy of modules

The project is built around two major namespaces: Microkernel and App . As discussed below, this hierarchy allows an application to scale vertically, from views to presenters to service/provider/factory components, and horizontally, by adding subsystems within these categories. Decoupling the UI does not limit the application to static forms; it also allows to apply XML/XAML-based interfaces or console applications to use the same set of event handlers and domain modules. Additionally, as demonstrated in this application, the hierarchy supports comprehensive integration testing of any component, including the verification of incoming arguments and function calls.

hierarchy-of-modules

Fig. 2 Hierarchy of modules.

Microkernel

Navigation by using a DI Container

Linking a Transient Presenter and a View

Application

Closures Propagation by using a Pipeline and Event Aggregator

Reference a Microkernel from a Presentation to Move a Domain

Integration tests

Partials Mocks and a DI Container

Managing Grayscale Images

Initially, a group of underexposed images was chosen for experimental puproses.

original underexposed image

Fig. 3 - The original underexposed image.

After optimization using a uniform distribution, there is redundancy in bright areas of the relative luminance. However, using a normal distribution it's possible to minimize this effect and achieve better detail distinctiveness.

image transformed by uniform distribution

Fig. 4 - Histogram transformation using a uniform distribution.

An image transformed by a normal distribution with the expectation = 90 and std = 60

Fig. 5 - Histogram transformation using a normal distribution, where µ = 90 and σ = 60.

To determine which image has better contrast, one may use the definition of conditional variance:

where [z1, z2] is an interval of relative luminance.

By splitting the interval `[0, 255]` to 16 subintervals, we can use the definition above. Since contrast is defined as statistical scattering, conditional variance can be used to measure the level of contrast within each specified interval.

application window

Fig. 6 - Using the definition of conditional variance over 16 intervals of relative luminance.

Thus, one may conclude that a normal distribution may produce better results than a uniform distribution for a group of underexposed images.

Created With

.NET 4.8, netstandard2.0

Windows Forms

MetroModernUI

LightInject, Ninject

Serilog, Microsoft.Extensions.Logging

Microsoft.Extensions.Configuration

Microsoft.Extensions.Caching.Memory

NUnit, NSubstitute

MessageLoop.Common

Benchmarks [CPU]

RGB Filters

Convolution

NuGet

ImageProcessing.Microkernel.MVP

About

Loosely coupled MVP monolith for the digital image processing domain. Additionally, it provides a cross-platform engine for running console applications and static or XAML/XML-based forms

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages