UML Diagram » History » Version 14
Areeba KHAN, 01/16/2025 02:01 PM
| 1 | 1 | Chung Hsi LIN | h1. UML Diagram |
|---|---|---|---|
| 2 | 2 | Chung Hsi LIN | |
| 3 | 7 | Man Mong CHAN | [[Wiki]] | [[About_Us]] | [[Project_Overview]] | [[UML_Diagram]] | [[Codes]] |
| 4 | 5 | Mitsuki EIKI | |
| 5 | |||
| 6 | 10 | Kentaro HARATAKE | | !PBL4UMLdiagram.png! | |
| 7 | 12 | Areeba KHAN | |
| 8 | 13 | Areeba KHAN | h1. **1. Config Class** |
| 9 | Represents configuration settings for image processing and display. |
||
| 10 | 1 | Chung Hsi LIN | |
| 11 | 14 | Areeba KHAN | |
| 12 | 13 | Areeba KHAN | h2. **Attributes**: |
| 13 | - `projection_distance: float`: The distance of the projector. |
||
| 14 | - `projector_distance: float = prd`: Alias for `projection_distance`. |
||
| 15 | - `img_width: int`: Width of the image. |
||
| 16 | - `img_height: int`: Height of the image. |
||
| 17 | - `img_path: String`: Path to the image file. |
||
| 18 | - `gamma: float`: Gamma value for image correction. |
||
| 19 | - `overlapWidth: int`: Overlap width between two projected images. |
||
| 20 | - `side: String`: The side (e.g., left or right) of the image projection. |
||
| 21 | - `isDualMonitor: boolean`: Indicates if dual monitors are being used. |
||
| 22 | - `monitorWidth: int`: Width of the monitor. |
||
| 23 | 1 | Chung Hsi LIN | |
| 24 | 14 | Areeba KHAN | |
| 25 | 13 | Areeba KHAN | h2. **Functions**: |
| 26 | - `__init__(...)`: Constructor to initialize configuration parameters such as projection distance, image dimensions, overlap width, etc. |
||
| 27 | - `getProjectionDistance(): float`: Returns the projection distance. |
||
| 28 | - `getImgWidth(): int`: Returns the width of the image. |
||
| 29 | - `getImgHeight(): int`: Returns the height of the image. |
||
| 30 | - `getImgPath(): String`: Returns the path of the image. |
||
| 31 | - `getGamma(): float`: Returns the gamma value. |
||
| 32 | - `getOverlapWidth(): int`: Returns the overlap width. |
||
| 33 | - `getSide(): String`: Returns the side (e.g., "left" or "right"). |
||
| 34 | - `getIsDualMonitor(): boolean`: Indicates if dual monitors are used. |
||
| 35 | - `getMonitorWidth(): int`: Returns the width of the monitor. |
||
| 36 | - `readConfigFile(): Config`: Reads configuration details from a file and returns a Config object. |
||
| 37 | 1 | Chung Hsi LIN | |
| 38 | |||
| 39 | 13 | Areeba KHAN | |
| 40 | 14 | Areeba KHAN | |
| 41 | |||
| 42 | 13 | Areeba KHAN | h1. **2. ImgProcessor Class** |
| 43 | Handles image processing tasks like blending, gamma correction, and cropping. |
||
| 44 | |||
| 45 | 14 | Areeba KHAN | |
| 46 | 13 | Areeba KHAN | h2. **Attributes**: |
| 47 | - `config: Config`: Holds a reference to a Config object for accessing settings. |
||
| 48 | |||
| 49 | 14 | Areeba KHAN | |
| 50 | 13 | Areeba KHAN | h2. **Functions**: |
| 51 | - `__init__(config: Config): void`: Constructor to initialize the ImgProcessor with a Config object. |
||
| 52 | - `alphaBlend(l_img: byte[], r_img: byte[]): NDArray`: Blends two images (left and right) and returns the result as an array. |
||
| 53 | - `GammaCorrection(img: byte[]): byte[]`: Applies gamma correction to the given image and returns the corrected image. |
||
| 54 | - `CropImage(): byte[]`: Crops the image as per configuration and returns the cropped image. |
||
| 55 | - `operation0(): void`: A placeholder method for any additional operation (not detailed in the diagram). |
||
| 56 | |||
| 57 | |||
| 58 | |||
| 59 | 14 | Areeba KHAN | |
| 60 | |||
| 61 | 13 | Areeba KHAN | h1. **3. DisplayImg Class** |
| 62 | Represents an image to be displayed, with attributes like width, height, overlap, and side. |
||
| 63 | |||
| 64 | 14 | Areeba KHAN | |
| 65 | 13 | Areeba KHAN | h2. **Attributes**: |
| 66 | - `p_width: int`: Width of the image. |
||
| 67 | - `p_height: int`: Height of the image. |
||
| 68 | - `p_overlap: float`: Overlap area of the image. |
||
| 69 | - `img: byte[]`: The image data in byte format. |
||
| 70 | - `side: String`: The side (e.g., "left" or "right") where the image is displayed. |
||
| 71 | |||
| 72 | 14 | Areeba KHAN | |
| 73 | 13 | Areeba KHAN | h2. **Functions**: |
| 74 | - `__init__(w: int, h: int, overlap: float, img: byte[], side: String): void`: Constructor to initialize the image dimensions, overlap, and side. |
||
| 75 | - `getImg(): byte[]`: Returns the image data. |
||
| 76 | - `getWidth(): int`: Returns the width of the image. |
||
| 77 | - `getHeight(): int`: Returns the height of the image. |
||
| 78 | - `getOverlap(): int`: Returns the overlap area. |
||
| 79 | - `getSide(): String`: Returns the side of the image. |
||
| 80 | |||
| 81 | |||
| 82 | |||
| 83 | 14 | Areeba KHAN | |
| 84 | |||
| 85 | 13 | Areeba KHAN | h1. **4. MainStitcher Class** |
| 86 | Main controller class for image stitching and display. |
||
| 87 | |||
| 88 | 14 | Areeba KHAN | |
| 89 | 13 | Areeba KHAN | h2. **Attributes**: |
| 90 | - `displayImg: DisplayImg`: Holds a reference to a DisplayImg object for managing image display. |
||
| 91 | |||
| 92 | 14 | Areeba KHAN | |
| 93 | 13 | Areeba KHAN | h2. **Functions**: |
| 94 | - `__init__(dlImg: int): void`: Constructor to initialize the main stitcher with a DisplayImg object. |
||
| 95 | - `singleDisplay(): void`: Manages the display of a single image. |
||
| 96 | - `doubleDisplay(monitorWidth: int): void`: Manages the display of two images, considering the monitor width. |
||
| 97 | - `main(): void`: The main method that runs the entire program workflow. |
||
| 98 | 14 | Areeba KHAN | |
| 99 | |||
| 100 | 13 | Areeba KHAN | |
| 101 | |||
| 102 | |||
| 103 | h1. Summary of Interactions: |
||
| 104 | - The Config class provides settings to other classes (`ImgProcessor` and `MainStitcher`). |
||
| 105 | - The ImgProcessor uses Config to process images. |
||
| 106 | - The DisplayImg class stores the image data and provides its properties to `MainStitcher`. |
||
| 107 | - The MainStitcher orchestrates the overall workflow, including image stitching and display management. |