Project

General

Profile

UML Diagrams » History » Version 8

Joseph Eugene PELC, 11/07/2024 01:10 PM

1 1 Faiq Sayyidan SETIAWAN
---
2
3 4 Faiq Sayyidan SETIAWAN
*[[/|Home]]*   |   *[[Team Members]]*   |   *[[Project Description]]*   |   *[[Code]]*   |   *[[UML Diagrams]]*   |   *[[Results]]*   |
4 1 Faiq Sayyidan SETIAWAN
5
---
6 3 Faiq Sayyidan SETIAWAN
7
h1=. <pre>
8
UML Diagrams </pre>
9 5 Faiq Sayyidan SETIAWAN
10
11
table{width: 100%}.
12 7 Faiq Sayyidan SETIAWAN
|={width: 100%; background-color:  #FF5733  ;}. *Project UML Diagram* |
13 6 Faiq Sayyidan SETIAWAN
14
!PBL4_UML.png!
15 8 Joseph Eugene PELC
16
* Classes *
17
1. ConfigReader
18
   ○ Attributes:
19
     ■ config_path (str): The path to the configuration file.
20
     ■ config_parser (ConfigParser): An instance of a configuration parser.
21
22
   ○ Methods:
23
     ■ __init__(self, config_path=None, configName=None): Constructor to initialize with an optional config path.
24
     ■ getImageName(): Returns the image name.
25
     ■ getProjectedOverlayAlphaWidth(): Returns the width of the projected overlay alpha.
26
     ■ getProjectedImageWidth(): Returns the projected image width.
27
     ■ getTransparencyFactor(): Returns the transparency factor as a float.
28
     ■ saveConfig(path): Saves the configuration to the specified path.
29
     ■ getImageSide(): Gets the side of the image.
30
     ■ setParameters(parameters): Sets parameters for the configuration.
31
     ■ getGamma(): Returns the gamma value.
32
33
2. ProcessImage
34
   ○ Methods:
35
     ■ processImage(image_path, params, main_display): Processes the image located at image_path with specified params, using MainDisplay instance for display 
36
       purposes.
37
38
3. MainDisplay
39
   ○ Methods:
40
     ■ readImage(image_path): Reads an image from the specified path and returns it as an ndarray.
41
     ■ setImage(image): Sets the image to display as an ndarray.
42
43
4. MaskCreator
44
   ○ Attributes:
45
     ■ _image (ndarray): Stores the original image.
46
     ■ _alpha_gradient (ndarray): Stores the alpha gradient.
47
     ■ _gamma_corrected (ndarray): Holds the gamma-corrected version of the image.
48
     ■ _mask (int): Represents the mask value.
49
     ■ transparency_factor (float): Factor controlling the transparency.
50
     ■ result_image (ndarray): Holds the result after processing.
51
   ○ Methods:
52
     ■ __init__(_image, transparency_factor): Initializes with an image and transparency factor.
53
     ■ createMask(image_side, mask_width, image_width): Creates a mask for the specified image side and dimensions.
54
     ■ smoothStep(edge0, edge1, x): Returns a smooth transition between two edges.
55
     ■ gammaCorrection(gamma): Applies gamma correction.
56
     ■ alphaBlending(image_side): Performs alpha blending for the specified side.
57
58
5. ImageProcessingApp
59
   ○ Attributes:
60
     ■ left_image_path and right_image_path (str): Paths to the left and right images.
61
     ■ left_params and right_params (dict): Parameters for left and right images.
62
     ■ processed_images (dict): Dictionary to store processed images.
63
     ■ notebook (Notebook), tab_left, tab_right, tab_settings, tab_preview (Frame): UI components.
64
     ■ process_button (Button), progress_bar (Progressbar): UI elements for processing and progress indication.
65
     ■ left_image_label, right_image_label, original_image_label, processed_image_label (Label): Labels for displaying images.
66
   ○ Methods:
67
     ■ __init__(root): Constructor to initialize the application with a root UI element.
68
     ■ setupLeftTab(), setupRightTab(), setupSettingsTab(), setupPreviewTab(): Methods for setting up respective tabs in the UI.
69
     ■ selectLeftImage(): Allows selection of the left image.
70
     ■ saveConfiguration(), loadConfiguration(): Methods to save and load configuration.
71
     ■ processAndSave(): Processes and saves the image.
72
     ■ displayPreview(): Displays a preview of the processed images.
73
     ■ displayImage(processedImages): Displays an image from processed images.
74
75
Relationships
76
   ● ImageProcessingApp is the main application class and interacts with ConfigReader, ProcessImage, and MainDisplay classes.
77
   ● ConfigReader provides configuration details to ImageProcessingApp.
78
   ● ProcessImage uses MainDisplay to load and display images, possibly utilizing MaskCreator for mask and blending operations.
79
   ● MaskCreator handles the creation of masks and alpha blending, which may be used by ProcessImage to prepare images for display in MainDisplay.