Project

General

Profile

Project Description » History » Version 73

Tomoki SAKAI, 11/07/2024 01:16 PM

1 1 Faiq Sayyidan SETIAWAN
2
---
3
4 34 Faiq Sayyidan SETIAWAN
*%{color:blue}[[/|Home]]%*   |   *[[Team Members]]*   |   *[[Project Description]]*   |   *[[Code]]*   |   *[[UML Diagrams]]*   |   *[[Results]]*   |
5 1 Faiq Sayyidan SETIAWAN
6
---
7 2 Faiq Sayyidan SETIAWAN
8 3 Faiq Sayyidan SETIAWAN
h1=. <pre>
9
Project Description </pre>
10 1 Faiq Sayyidan SETIAWAN
11 32 Faiq Sayyidan SETIAWAN
h2. *%{color:black}Overview%*
12 4 Joseph Eugene PELC
13 9 Joseph Eugene PELC
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.
14
15 57 MYAT Ma De May Phuu Ngon
h2. *%{color:black}Software and Tools%*
16 5 Joseph Eugene PELC
17 12 Joseph Eugene PELC
%{color: red}Redmine% - We used Redmine to track our progress and tasks we need to finish
18
%{color: green}Python / OpenCV% - For image processing we used OpenCV within Python 
19
%{color: blue}Doxygen% - We used Doxygen for the code documentation
20
%{color: purple}Astah% - To create UML diagrams of the code 
21 1 Faiq Sayyidan SETIAWAN
22 34 Faiq Sayyidan SETIAWAN
table{width: 100%}.
23
|={width: 100%; background-color: #00e5bf ;}.*%{color:black}Technology%*|
24 1 Faiq Sayyidan SETIAWAN
25 71 Tomoki SAKAI
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.
26 73 Tomoki SAKAI
!2024-11-0713.png!
27 34 Faiq Sayyidan SETIAWAN
table{width: 100%}.
28 35 Faiq Sayyidan SETIAWAN
|={width: 100%; background-color:#01cfe8 ;}.*%{color:black}Alpha Blending Method%* |
29 16 Joseph Eugene PELC
30 70 Tomoki SAKAI
Alpha blending is the process of combining two images based on a coefficient (alpha value). It is an essential technique in visual representation and video game development, commonly used to merge separately rendered elements, such as backgrounds and characters. Alpha blending is also applied in anti-aliasing for text and other graphical elements.
31 1 Faiq Sayyidan SETIAWAN
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.
32 13 Joseph Eugene PELC
33 37 Faiq Sayyidan SETIAWAN
!{width:50%}BlendModesSample.png!
34 30 Tomoki SAKAI
35 36 Faiq Sayyidan SETIAWAN
table{width: 100%}.
36 57 MYAT Ma De May Phuu Ngon
|={width: 100%; background-color: #ff8a48  ;}.*%{color:black}Gamma Correction Method%* |
37 22 MYAT Ma De May Phuu Ngon
38 17 MYAT Ma De May Phuu Ngon
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.
39 1 Faiq Sayyidan SETIAWAN
40
41 20 MYAT Ma De May Phuu Ngon
Gamma correction involves applying a power-law function to the pixel values of an image. The formula used is described as below.
42 17 MYAT Ma De May Phuu Ngon
43 20 MYAT Ma De May Phuu Ngon
*gamma_corrected = (image / 255.0)^gamma * 255*
44 1 Faiq Sayyidan SETIAWAN
45 22 MYAT Ma De May Phuu Ngon
If the gamma is greater than 1, the image becomes darker; if it is less than 1, the image appears brighter.
46 17 MYAT Ma De May Phuu Ngon
47
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. 
48
49 38 Faiq Sayyidan SETIAWAN
|={width: 50%;}.*%{color:black}Before Gamma Correction:%* |={width: 50%;}.*%{color:black}After Gamma Correction%*|
50
|!before_gamma.jpg!|!after_gamma.jpg!|
51 39 Faiq Sayyidan SETIAWAN
52
table{width: 100%}.
53 57 MYAT Ma De May Phuu Ngon
|={width: 100%; background-color: #f0ff33  ;}.*%{color:black}Intensity Modification%* |
54 39 Faiq Sayyidan SETIAWAN
55
This method modifies the intensity at the edges of an image, using gamma correction and alpha blending techniques, based on *image_side*
56
57
-If *image_side* is *1* , the intensity is gradually reduced towards the *left edge* 
58
-If *image_side* is *0* , the intensity is gradually reduced towards the *right edge* 
59
60
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
61 40 Joseph Eugene PELC
62 52 Joseph Eugene PELC
table{width: 100%}.
63
|={width: 100%; background-color: #ca162e ;}.*%{color:black}Transparency%*|
64 51 Joseph Eugene PELC
65 57 MYAT Ma De May Phuu Ngon
*Gradient Mask Creation*
66 68 Joseph Eugene PELC
- 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.
67
- 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.
68 53 Joseph Eugene PELC
69 57 MYAT Ma De May Phuu Ngon
*Transparency Factor*
70 67 Joseph Eugene PELC
- 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.
71 53 Joseph Eugene PELC
72 57 MYAT Ma De May Phuu Ngon
*Alpha Blending*
73 65 Joseph Eugene PELC
- After generating the *alpha_gradient* (adjusted by transparency_factor), the *alpha_blending()* method applies it.
74
- 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.
75 66 Joseph Eugene PELC
- Alpha values from *self.__alpha_gradient* determines how much of the ROI pixels and the black background are combined:
76 58 Joseph Eugene PELC
*blended = (alpha * roi + (1 - alpha) * black_background)*
77 53 Joseph Eugene PELC
- In this calculation:
78 58 Joseph Eugene PELC
     *alpha * roi* applies the transparency gradient to the image.
79 63 Joseph Eugene PELC
     *(1 - alpha)* ** black_background* ensures a gradual blend with the black background.
80 55 Joseph Eugene PELC
81 57 MYAT Ma De May Phuu Ngon
*Transparency Side Control*
82 55 Joseph Eugene PELC
- The transparency gradient can be applied from either left-to-right or right-to-left, controlled by the image_side parameter.
83 66 Joseph Eugene PELC
- Depending on the *image_side*, the method either keeps the gradient as-is (right side transparent) or reverses it (left side transparent).
84 69 Joseph Eugene PELC
- So, the transparency effect combines the smoothstep gradient, scaled by *transparency_factor*, with alpha blending to control the transparency on the chosen side.