Project

General

Profile

UML Diagram » History » Revision 16

Revision 15 (Areeba KHAN, 01/16/2025 02:05 PM) → Revision 16/17 (Kentaro HARATAKE, 01/16/2025 02:30 PM)

h1. UML Diagram 

 [[Wiki]] | [[About_Us]] | [[Project_Overview]] | [[UML_Diagram]] | [[Codes]] 


 | !PBL4UMLdiagram.png! | 

 h1.    **1. Config Class** 

 Represents configuration settings for image processing and display. 


 h2. **Attributes**: 

 - `projection_distance: float`: The distance of the projector. 

 - `projector_distance: float = prd`: Alias for `projection_distance`. 

 - `img_width: int`: Width of the image. 

 - `img_height: int`: Height of the image. 

 - `img_path: String`: Path to the image file. 

 - `gamma: float`: Gamma value for image correction. 

 - `overlapWidth: int`: Overlap width between two projected images. 

 - `side: String`: The side (e.g., left or right) of the image projection. 

 - `isDualMonitor: boolean`: Indicates if dual monitors are being used. 

 - `monitorWidth: int`: Width of the monitor. 


 h2. **Functions**: 
 - __init__(...)`: `__init__(...)`: Constructor to initialize configuration parameters such as projection distance, image dimensions, overlap width, etc. 

 - getProjectionDistance(): `getProjectionDistance(): float`: Returns the projection distance. 

 - getImgWidth(): `getImgWidth(): int`: Returns the width of the image. 

 - getImgHeight(): `getImgHeight(): int`: Returns the height of the image. 

 - getImgPath(): `getImgPath(): String`: Returns the path of the image. 

 - getGamma(): `getGamma(): float`: Returns the gamma value. 

 - getOverlapWidth(): `getOverlapWidth(): int`: Returns the overlap width. 

 - getSide(): `getSide(): String`: Returns the side (e.g., "left" or "right"). 

 - getIsDualMonitor(): `getIsDualMonitor(): boolean`: Indicates if dual monitors are used. 

 - getMonitorWidth(): `getMonitorWidth(): int`: Returns the width of the monitor. 

 - readConfigFile(): `readConfigFile(): Config`: Reads configuration details from a file and returns a Config object. 





 h1. **2. ImgProcessor Class** 

 Handles image processing tasks like blending, gamma correction, and cropping. 


 h2. **Attributes**: 

 - config: `config: Config`: Holds a reference to a Config object for accessing settings. 


 h2. **Functions**: 

 - __init__(config: `__init__(config: Config): void: void`: Constructor to initialize the ImgProcessor with a Config object. 

 - alphaBlend(l_img: `alphaBlend(l_img: byte[], r_img: byte[]): NDArray`: Blends two images (left and right) and returns the result as an array. 

 - GammaCorrection(img: `GammaCorrection(img: byte[]): byte[]: byte[]`: Applies gamma correction to the given image and returns the corrected image. 

 - CropImage(): `CropImage(): byte[]`: Crops the image as per configuration and returns the cropped image. 

 - operation0(): `operation0(): void`: A placeholder method for any additional operation (not detailed in the diagram). 





 h1. **3. DisplayImg Class** 

 Represents an image to be displayed, with attributes like width, height, overlap, and side. 


 h2. **Attributes**: 

 - `p_width: int`: Width of the image. 

 - `p_height: int`: Height of the image. 

 - `p_overlap: float`: Overlap area of the image. 

 - `img: byte[]`: The image data in byte format. 

 - `side: String`: The side (e.g., "left" or "right") where the image is displayed. 


 h2. **Functions**: 

 - `__init__(w: int, h: int, overlap: float, img: byte[], side: String): void`: Constructor to initialize the image dimensions, overlap, and side. 

 - `getImg(): byte[]`: Returns the image data. 

 - `getWidth(): int`: Returns the width of the image. 

 - `getHeight(): int`: Returns the height of the image. 

 - `getOverlap(): int`: Returns the overlap area. 

 - `getSide(): String`: Returns the side of the image. 




 h1. **4. MainStitcher Class** 

 Main controller class for image stitching and display. 


 h2. **Attributes**: 

 - `displayImg: DisplayImg`: Holds a reference to a DisplayImg object for managing image display. 


 h2. **Functions**: 

 - `__init__(dlImg: int): void`: Constructor to initialize the main stitcher with a DisplayImg object. 

 - `singleDisplay(): void`: Manages the display of a single image. 

 - `doubleDisplay(monitorWidth: int): void`: Manages the display of two images, considering the monitor width. 

 - `main(): void`: The main method that runs the entire program workflow. 





 h1.    Summary of Interactions: 

 - The Config class provides settings to other classes (`ImgProcessor` and `MainStitcher`). 

 - The ImgProcessor uses Config to process images. 

 - The DisplayImg class stores the image data and provides its properties to `MainStitcher`. 

 - The MainStitcher orchestrates the overall workflow, including image stitching and display management.