Project

General

Profile

Actions

Project Description » History » Revision 64

« Previous | Revision 64/74 (diff) | Next »
Joseph Eugene PELC, 10/31/2024 02:09 PM



Home | Team Members | Project Description | Code | UML Diagrams | Results |


Project Description 

Overview

The aim of this project is to output two different projector images merged into one singular display. We used techniques such as gamma correction, alpha blending, and modification of intensities on the images, in order to get the final result. Our project will have a project manager, team leader, Doxygen documentation team, wiki team, coding team, and UML design team.

Software and Tools

Redmine - We used Redmine to track our progress and tasks we need to finish
Python / OpenCV - For image processing we used OpenCV within Python
Doxygen - We used Doxygen for the code documentation
Astah - To create UML diagrams of the code

Technology

We plan on using one flat-screen display using two projectors with two computers so we can simultaneously show the two images to appear on the large display to create one image. To achieve this, we will use techniques such as gamma correction method, alpha blending method, and intensity modification.

Alpha Blending Method

The code defines an image processing application using Tkinter for the GUI, OpenCV for image manipulation, and PIL for rendering. It allows users to load configuration files, process images with gamma correction and alpha blending, and display or save the results.

Gamma Correction Method

This project incorporates a method called gamma correction which adjusts the brightness of an image by altering its luminance values to each value of the pixel in a non-linear manner. This is helpful in matching to human perception of light. Compared to a camera, we are much more sensitive to changes in dark tones than we are to similar changes in bright tones. There's a biological reason for this peculiarity: it enables our vision to operate over a broader range of luminance.

Gamma correction involves applying a power-law function to the pixel values of an image. The formula used is described as below.

gamma_corrected = (image / 255.0)^gamma * 255

If the gamma is greater than 1, the image becomes darker; if it is less than 1, the image appears brighter.

Note: Gamma is the provided gamma value. Since pixel values range from 0 to 255, the original image is first normalized (divided by 255), then raised to the power of gamma, and finally rescaled to the 0-255 range.

Before Gamma Correction: After Gamma Correction
Intensity Modification

This method modifies the intensity at the edges of an image, using gamma correction and alpha blending techniques, based on image_side

-If image_side is 1 , the intensity is gradually reduced towards the left edge
-If image_side is 0 , the intensity is gradually reduced towards the right edge

The intensity is adjusted using gamma correction and alpha blending, creating a smooth fading effect at the edges, blending the image into the background or another image

Transparency

Gradient Mask Creation
- In the MaskCreator class, the method create_mask() generates a smooth transparency gradient using a smoothstep function. This gradient defines how transparent or opaque each part of the image will be within the masked region.
- The smoothstep() function provides a non-linear gradient to create a smooth transition from fully transparent to fully opaque (or vice versa), enhancing visual smoothness.

Transparency Factor
- The transparency_factor parameter is applied to the gradient. This factor scales the gradient values, affecting the overall transparency. A lower transparency_factor makes the gradient more transparent, while a factor closer to 1 maintains higher opacity.

Alpha Blending
- After generating the alpha_gradient (adjusted by transparency_factor), the alpha_blending() method applies it.
- The method defines a region of interest (ROI) on one side of the image (left or right) and blends the region with a black background using the alpha_gradient as a mask.
- Alpha values from self.__alpha_gradient determines how much of the ROI pixels and the black background are combined:
blended = (alpha * roi + (1 - alpha) * black_background)
- In this calculation:
alpha * roi applies the transparency gradient to the image.
(1 - alpha) * black_background ensures a gradual blend with the black background.

Transparency Side Control
- The transparency gradient can be applied from either left-to-right or right-to-left, controlled by the image_side parameter.
- Depending on the image_side, the method either keeps the gradient as-is (right side transparent) or reverses it (left side transparent).
- So, the transparency effect combines the smoothstep gradient, scaled by transparency_factor, with alpha blending to control the transparency on the chosen side.

Updated by Joseph Eugene PELC 6 months ago · 64 revisions