ImagePRO-Python 1.0.5__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {imagepro_python-1.0.5/src/ImagePRO_Python.egg-info → imagepro_python-1.1.0}/PKG-INFO +2 -1
  2. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/pyproject.toml +2 -1
  3. imagepro_python-1.1.0/src/ImagePRO/pre_processing/histogram.py +84 -0
  4. {imagepro_python-1.0.5 → imagepro_python-1.1.0/src/ImagePRO_Python.egg-info}/PKG-INFO +2 -1
  5. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO_Python.egg-info/SOURCES.txt +1 -0
  6. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO_Python.egg-info/requires.txt +1 -0
  7. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/LICENSE +0 -0
  8. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/setup.cfg +0 -0
  9. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/__init__.py +0 -0
  10. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/__init__.py +0 -0
  11. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/body_analysis/__init__.py +0 -0
  12. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/body_analysis/body_pose_estimation.py +0 -0
  13. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/body_analysis/hand_tracking.py +0 -0
  14. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/face_analysis/__init__.py +0 -0
  15. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/face_analysis/eye_status_analysis.py +0 -0
  16. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/face_analysis/face_comparison.py +0 -0
  17. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/face_analysis/face_detection.py +0 -0
  18. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/face_analysis/face_mesh_analysis.py +0 -0
  19. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/human_analysis/face_analysis/head_pose_estimation.py +0 -0
  20. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/object_analysis/__init__.py +0 -0
  21. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/object_analysis/object_detection.py +0 -0
  22. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/pre_processing/__init__.py +0 -0
  23. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/pre_processing/blur.py +0 -0
  24. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/pre_processing/contrast.py +0 -0
  25. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/pre_processing/crop.py +0 -0
  26. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/pre_processing/dataset_generator.py +0 -0
  27. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/pre_processing/grayscale.py +0 -0
  28. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/pre_processing/resize.py +0 -0
  29. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/pre_processing/rotate.py +0 -0
  30. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/pre_processing/sharpen.py +0 -0
  31. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/utils/__init__.py +0 -0
  32. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/utils/image.py +0 -0
  33. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO/utils/result.py +0 -0
  34. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO_Python.egg-info/dependency_links.txt +0 -0
  35. {imagepro_python-1.0.5 → imagepro_python-1.1.0}/src/ImagePRO_Python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ImagePRO-Python
3
- Version: 1.0.5
3
+ Version: 1.1.0
4
4
  Summary: Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration.
5
5
  Author-email: Parsa Safaie <parsasafaie.2568@proton.me>
6
6
  License: MIT
@@ -24,6 +24,7 @@ Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  Requires-Dist: numpy<2.0,>=1.24
26
26
  Requires-Dist: opencv-python<5.0,>=4.8
27
+ Requires-Dist: matplotlib<3.9.0,>=3.7.0
27
28
  Provides-Extra: yolo
28
29
  Requires-Dist: ultralytics<9.0,>=8.2.0; extra == "yolo"
29
30
  Provides-Extra: mediapipe
@@ -7,7 +7,7 @@ where = ["src"]
7
7
 
8
8
  [project]
9
9
  name = "ImagePRO-Python"
10
- version = "1.0.5"
10
+ version = "1.1.0"
11
11
  description = "Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration."
12
12
  readme = "README.md"
13
13
  requires-python = "==3.10.*"
@@ -30,6 +30,7 @@ classifiers = [
30
30
  dependencies = [
31
31
  "numpy>=1.24,<2.0",
32
32
  "opencv-python>=4.8,<5.0",
33
+ "matplotlib>=3.7.0,<3.9.0"
33
34
  ]
34
35
 
35
36
  [project.optional-dependencies]
@@ -0,0 +1,84 @@
1
+ from __future__ import annotations
2
+
3
+ import cv2
4
+ import matplotlib.pyplot as plt
5
+
6
+ from ImagePRO.utils.image import Image
7
+ from ImagePRO.utils.result import Result
8
+
9
+ def show_histogram(image: Image) -> Result:
10
+ """
11
+ Displays the histogram of an image with customizable options.
12
+
13
+ This function visualizes the intensity distribution of an image. It handles both grayscale
14
+ and color images, with automatic detection of image type. For color images, it displays
15
+ histograms for each color channel (BGR or RGB) with appropriate colors.
16
+
17
+ Args:
18
+ image (Image):
19
+ Input image to convert. Must be BGR, RGB or Grayscale format.
20
+
21
+ Returns:
22
+ Result: Result object with histogram plot.
23
+ - image (np.ndarray): None
24
+ - data (None): matplotlib.pyplot object
25
+ - meta (dict): Contains source object and operation info
26
+
27
+ Raises:
28
+ TypeError: If image is not an Image instance
29
+ ValueError: If image colorspace is not defined.
30
+ """
31
+ if not isinstance(image, Image):
32
+ raise TypeError("'image' must be an Image instance.")
33
+
34
+ if image.colorspace == "BGR":
35
+ colors = ('blue', 'green', 'red')
36
+ plt.figure(figsize=(10, 6))
37
+
38
+ for i, color in enumerate(colors):
39
+ hist = cv2.calcHist([image._data], [i], None, [256], [0, 256])
40
+ plt.plot(hist, color=color)
41
+ plt.xlim([0, 256])
42
+
43
+
44
+ plt.title('Histogram of BGR Channels')
45
+ plt.xlabel('Pixel Intensity')
46
+ plt.ylabel('Frequency')
47
+ plt.legend(['Blue Channel', 'Green Channel', 'Red Channel'])
48
+
49
+
50
+ elif image.colorspace == "RGB":
51
+ colors = ('red', 'green', 'blue')
52
+ plt.figure(figsize=(10, 6))
53
+
54
+ for i, color in enumerate(colors):
55
+ hist = cv2.calcHist([image._data], [i], None, [256], [0, 256])
56
+ plt.plot(hist, color=color)
57
+ plt.xlim([0, 256])
58
+
59
+
60
+ plt.title('Histogram of RGB Channels')
61
+ plt.xlabel('Pixel Intensity')
62
+ plt.ylabel('Frequency')
63
+ plt.legend(['Red Channel', 'Green Channel', 'Blue Channel'])
64
+
65
+
66
+ elif image.colorspace == 'GRAY':
67
+ plt.figure(figsize=(10, 6))
68
+
69
+ hist = cv2.calcHist([image._data], [0], None, [256], [0, 256])
70
+ plt.plot(hist, color='black')
71
+ plt.xlim([0, 256])
72
+
73
+ else:
74
+ return ValueError('Unknown colorspace')
75
+
76
+
77
+ return Result(
78
+ image=None,
79
+ data=plt,
80
+ meta={
81
+ "source": image,
82
+ "operation": "show_histogram"
83
+ }
84
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ImagePRO-Python
3
- Version: 1.0.5
3
+ Version: 1.1.0
4
4
  Summary: Professional & modular image processing library with OpenCV, MediaPipe, and YOLO integration.
5
5
  Author-email: Parsa Safaie <parsasafaie.2568@proton.me>
6
6
  License: MIT
@@ -24,6 +24,7 @@ Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  Requires-Dist: numpy<2.0,>=1.24
26
26
  Requires-Dist: opencv-python<5.0,>=4.8
27
+ Requires-Dist: matplotlib<3.9.0,>=3.7.0
27
28
  Provides-Extra: yolo
28
29
  Requires-Dist: ultralytics<9.0,>=8.2.0; extra == "yolo"
29
30
  Provides-Extra: mediapipe
@@ -19,6 +19,7 @@ src/ImagePRO/pre_processing/contrast.py
19
19
  src/ImagePRO/pre_processing/crop.py
20
20
  src/ImagePRO/pre_processing/dataset_generator.py
21
21
  src/ImagePRO/pre_processing/grayscale.py
22
+ src/ImagePRO/pre_processing/histogram.py
22
23
  src/ImagePRO/pre_processing/resize.py
23
24
  src/ImagePRO/pre_processing/rotate.py
24
25
  src/ImagePRO/pre_processing/sharpen.py
@@ -1,5 +1,6 @@
1
1
  numpy<2.0,>=1.24
2
2
  opencv-python<5.0,>=4.8
3
+ matplotlib<3.9.0,>=3.7.0
3
4
 
4
5
  [insightface]
5
6
  insightface<1.0,>=0.7
File without changes