|
| 1 | +""" |
| 2 | +Images Schema Module |
| 3 | +-------------------- |
| 4 | +This module defines type annotations for image processing. |
| 5 | +
|
| 6 | +Attributes |
| 7 | +---------- |
| 8 | +ColorPatchType : numpy.typing.NDArray[np.uint8] |
| 9 | + Represents a color patch extracted from an image. Usually a mean of a region patch. |
| 10 | +
|
| 11 | + Example |
| 12 | + ------- |
| 13 | + ```python |
| 14 | + np.array( |
| 15 | + [ |
| 16 | + [68, 82, 115], # 1. Dark skin |
| 17 | + [128, 149, 195], # 2. Light skin |
| 18 | + [157, 123, 93], # 3. Blue sky |
| 19 | + [65, 108, 91], # 4. Foliage |
| 20 | + [175, 129, 130], # 5. Blue flower |
| 21 | + [171, 191, 99], # 6. Bluish green |
| 22 | + [46, 123, 220], # 7. Orange |
| 23 | + [168, 92, 72], # 8. Purplish blue |
| 24 | + [97, 84, 194], # 9. Moderate red |
| 25 | + [104, 59, 91], # 10. Purple |
| 26 | + [62, 189, 161], # 11. Yellow green |
| 27 | + [40, 161, 229], # 12. Orange yellow |
| 28 | + [147, 63, 42], # 13. Blue |
| 29 | + [72, 149, 72], # 14. Green |
| 30 | + [57, 50, 175], # 15. Red |
| 31 | + [22, 200, 238], # 16. Yellow |
| 32 | + [150, 84, 188], # 17. Magenta |
| 33 | + [166, 137, 0], # 18. Cyan |
| 34 | + [240, 245, 245], # 19. White 9.5 |
| 35 | + [201, 202, 201], # 20. Neutral 8 |
| 36 | + [162, 162, 161], # 21. Neutral 6.5 |
| 37 | + [121, 121, 120], # 22. Neutral 5 |
| 38 | + [85, 85, 83], # 23. Neutral 3.5 |
| 39 | + [51, 50, 50], # 24. Black 2 |
| 40 | + ], |
| 41 | + ) |
| 42 | + ``` |
| 43 | +ImageType : numpy.typing.NDArray[np.uint8] |
| 44 | + Represents an image 3D array with shape (H, W, C) in uint8 format. |
| 45 | +ImageBGR : numpy.typing.NDArray[np.uint8] |
| 46 | + Represents an image in BGR format (OpenCV default). |
| 47 | +ImageRGB : numpy.typing.NDArray[np.uint8] |
| 48 | + Represents an image in RGB format. |
| 49 | +
|
| 50 | +""" |
| 51 | + |
| 52 | +from typing import Literal |
| 53 | + |
| 54 | +import numpy as np |
| 55 | +from numpy.typing import NDArray |
| 56 | + |
| 57 | +LiteralModelCorrection = Literal[ |
| 58 | + "least_squares", |
| 59 | + "polynomial", |
| 60 | + "linear_reg", |
| 61 | + "affine_reg", |
| 62 | +] |
| 63 | + |
| 64 | +LiteralModelDetection = Literal["yolov8"] |
| 65 | + |
| 66 | +ColorPatchType = NDArray[np.uint8] |
| 67 | +ImageType = NDArray[np.uint8] |
| 68 | +ImageBGR = NDArray[np.uint8] |
| 69 | +ImageRGB = NDArray[np.uint8] |
| 70 | +ImageGray = NDArray[np.uint8] |
0 commit comments