image-processor-package 0.0.1__py3-none-any.whl
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.
- image_processor_package-0.0.1.dist-info/METADATA +105 -0
- image_processor_package-0.0.1.dist-info/RECORD +10 -0
- image_processor_package-0.0.1.dist-info/WHEEL +5 -0
- image_processor_package-0.0.1.dist-info/top_level.txt +2 -0
- processing/__init__.py +0 -0
- processing/compilation.py +18 -0
- processing/transformation.py +11 -0
- utils/__init__.py +0 -0
- utils/io.py +9 -0
- utils/visualization.py +28 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: image_processor_package
|
3
|
+
Version: 0.0.1
|
4
|
+
Summary: Pacote de processamento de imagens com funcionalidades avançadas.
|
5
|
+
Home-page: https://github.com/Jotabelde
|
6
|
+
Author: João Pedro Fialho Lopes
|
7
|
+
Author-email: jotabelde@gmail.com
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: Programming Language :: Python :: 3.8
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
12
|
+
Classifier: Operating System :: OS Independent
|
13
|
+
Requires-Python: >=3.8
|
14
|
+
Description-Content-Type: text/markdown
|
15
|
+
Requires-Dist: scikit-image>=0.18.3
|
16
|
+
Requires-Dist: numpy>=1.21.0
|
17
|
+
Requires-Dist: matplotlib>=3.4.3
|
18
|
+
Requires-Dist: scipy>=1.7.1
|
19
|
+
Dynamic: author
|
20
|
+
Dynamic: author-email
|
21
|
+
Dynamic: classifier
|
22
|
+
Dynamic: description
|
23
|
+
Dynamic: description-content-type
|
24
|
+
Dynamic: home-page
|
25
|
+
Dynamic: requires-dist
|
26
|
+
Dynamic: requires-python
|
27
|
+
Dynamic: summary
|
28
|
+
|
29
|
+
|
30
|
+
# 📷 Image Processor Package
|
31
|
+
|
32
|
+
Pacote Python para **processamento e análise de imagens**, com funcionalidades para leitura, salvamento, redimensionamento, comparação por similaridade, ajuste de histograma e visualização gráfica.
|
33
|
+
|
34
|
+
---
|
35
|
+
|
36
|
+
## ✨ Funcionalidades
|
37
|
+
|
38
|
+
- ✅ Leitura e salvamento de imagens (`.jpg`, `.png`, etc.)
|
39
|
+
- ✅ Conversão para escala de cinza
|
40
|
+
- ✅ Comparação de similaridade entre imagens (SSIM)
|
41
|
+
- ✅ Ajuste de histograma entre imagens
|
42
|
+
- ✅ Redimensionamento com suavização
|
43
|
+
- ✅ Visualização com gráficos e histogramas
|
44
|
+
|
45
|
+
---
|
46
|
+
|
47
|
+
## 📦 Instalação
|
48
|
+
|
49
|
+
```bash
|
50
|
+
pip install image-processor-package
|
51
|
+
```
|
52
|
+
|
53
|
+
> **Requisitos**: Python 3.8+
|
54
|
+
|
55
|
+
---
|
56
|
+
|
57
|
+
## 🧠 Estrutura do Projeto
|
58
|
+
|
59
|
+
```
|
60
|
+
image_processor_package/
|
61
|
+
├── main.py
|
62
|
+
├── processing/
|
63
|
+
│ ├── compilation.py # Funções de comparação e histograma
|
64
|
+
│ └── transformation.py # Funções de redimensionamento
|
65
|
+
├── utils/
|
66
|
+
│ ├── io.py # Leitura e salvamento de imagem
|
67
|
+
│ └── visualization.py # Funções de plotagem
|
68
|
+
```
|
69
|
+
|
70
|
+
---
|
71
|
+
|
72
|
+
## 🧪 Exemplo de Uso
|
73
|
+
|
74
|
+
```python
|
75
|
+
from processing.compilation import find_diference, match_histogram
|
76
|
+
from processing.transformation import resize_image
|
77
|
+
from utils.io import read_image, save_image
|
78
|
+
from utils.visualization import plot_result
|
79
|
+
|
80
|
+
image1 = read_image("caminho/para/imagem1.jpg")
|
81
|
+
image2 = read_image("caminho/para/imagem2.jpg")
|
82
|
+
|
83
|
+
image1_resized = resize_image(0.5, image1)
|
84
|
+
image2_resized = resize_image(0.5, image2)
|
85
|
+
|
86
|
+
image2_adjusted = match_histogram(image1_resized, image2_resized)
|
87
|
+
diferenca = find_diference(image1_resized, image2_adjusted)
|
88
|
+
|
89
|
+
plot_result(image1_resized, image2_adjusted, diferenca)
|
90
|
+
```
|
91
|
+
|
92
|
+
---
|
93
|
+
|
94
|
+
## 👨💻 Autor
|
95
|
+
|
96
|
+
**João Pedro Fialho Lopes**
|
97
|
+
📧 [jotabelde@gmail.com](mailto:jotabelde@gmail.com)
|
98
|
+
🔗 [LinkedIn](https://www.linkedin.com/in/joaopedrofialho)
|
99
|
+
📁 [GitHub](https://github.com/Jotabelde)
|
100
|
+
|
101
|
+
---
|
102
|
+
|
103
|
+
## 📝 Licença
|
104
|
+
|
105
|
+
Este projeto está licenciado sob os termos da **MIT License**.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
processing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
processing/compilation.py,sha256=Jlfy06bKhPdzuwu1SW2pHQNkYU5TjRUmXgxz43yDo_k,796
|
3
|
+
processing/transformation.py,sha256=gS1Qy6-zYbnCKiRgb8Su00ryl1QXi5hnohjz1_kfMjA,550
|
4
|
+
utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
utils/io.py,sha256=E9246RT2CCwv_IRwjBEm8eGMCUZbHNAwN08jtqNW5hc,281
|
6
|
+
utils/visualization.py,sha256=5ItdH6qOPwWIlJfotgiq8vDaPEOHSVoyuT36KG_YOGQ,979
|
7
|
+
image_processor_package-0.0.1.dist-info/METADATA,sha256=BvtnSGFu6cI0ulMS8vQr1B7Yrabqh7_yEpzSPDQ4zGk,2881
|
8
|
+
image_processor_package-0.0.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
9
|
+
image_processor_package-0.0.1.dist-info/top_level.txt,sha256=KhfL_5RtcNNVRR10g8GyDD_JLw_AHhOALziQsAPIJ7E,17
|
10
|
+
image_processor_package-0.0.1.dist-info/RECORD,,
|
processing/__init__.py
ADDED
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import numpy as np
|
2
|
+
from skimage.color import rgb2gray
|
3
|
+
from skimage.exposure import match_histograms
|
4
|
+
from skimage.metrics import structural_similarity
|
5
|
+
|
6
|
+
|
7
|
+
def find_diference (image1, image2):
|
8
|
+
assert image1.shape == image2.shape, "Please use Diferents Images"
|
9
|
+
image1_cinza = rgb2gray(image1)
|
10
|
+
image2_cinza = rgb2gray(image2)
|
11
|
+
(score,diference_image) = structural_similarity(image1_cinza, image2_cinza, full= True)
|
12
|
+
print("similarity of the two images is: "(score))
|
13
|
+
normalized_image_diference = (diference_image(diference_image-np.min(diference_image))/(np.max(diference_image)-np.min(diference_image)))
|
14
|
+
return normalized_image_diference
|
15
|
+
|
16
|
+
def match_histogram (image1, image2):
|
17
|
+
matched_images = match_histograms(image1, image2, multichanel = True)
|
18
|
+
return matched_images
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from skimage.transform import resize
|
2
|
+
|
3
|
+
def resize_image (proportion, image1, image2):
|
4
|
+
assert 0 <= proportion <= 1, "Proportion needs to be between 0 and 1"
|
5
|
+
heigth1 = round(image1.shape[0] * proportion)
|
6
|
+
heigth2 = round(image1.shape[0] * proportion)
|
7
|
+
width1 = round(image1.shape[1] * proportion)
|
8
|
+
width2 = round(image1.shape[1] * proportion)
|
9
|
+
image_resized1 = resize(image1, (heigth1, width1), anti_aliasing= True)
|
10
|
+
image_resized2 = resize(image2, (heigth2, width2), anti_aliasing= True)
|
11
|
+
return image_resized1, image_resized2
|
utils/__init__.py
ADDED
File without changes
|
utils/io.py
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
from skimage.io import imread, imsave
|
2
|
+
|
3
|
+
def read_image(image1_path, image2_path, is_gray = False):
|
4
|
+
image1 = imread(image1_path, as_gray = is_gray)
|
5
|
+
image2 = imread(image2_path, as_gray = is_gray)
|
6
|
+
return image1, image2
|
7
|
+
|
8
|
+
def save_image(image, path):
|
9
|
+
imsave(image, path)
|
utils/visualization.py
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
import matplotlib.pyplot as plt
|
2
|
+
|
3
|
+
def plot_image(image):
|
4
|
+
plt.figure(figsize=(12, 4))
|
5
|
+
plt.imshow(image, cmap='gray')
|
6
|
+
plt.axis('off')
|
7
|
+
plt.show()
|
8
|
+
|
9
|
+
def plot_result(*args):
|
10
|
+
number_images = len(args)
|
11
|
+
fig, axis = plt.subplots(nrows=1, ncols = number_images, figsize=(12, 4))
|
12
|
+
names_lst = ['Image {}'.format(i) for i in range(1, number_images)]
|
13
|
+
names_lst.append('Result')
|
14
|
+
for ax, name, image in zip(axis, names_lst, args):
|
15
|
+
ax.set_title(name)
|
16
|
+
ax.imshow(image, cmap='gray')
|
17
|
+
ax.axis('off')
|
18
|
+
fig.tight_layout()
|
19
|
+
plt.show()
|
20
|
+
|
21
|
+
def plot_histogram(image):
|
22
|
+
fig, axis = plt.subplots(nrows=1, ncols = 3, figsize=(12, 4), sharex=True, sharey=True)
|
23
|
+
color_lst = ['red', 'green', 'blue']
|
24
|
+
for index, (ax, color) in enumerate(zip(axis, color_lst)):
|
25
|
+
ax.set_title('{} histogram'.format(color.title()))
|
26
|
+
ax.hist(image[:, :, index].ravel(), bins = 256, color = color, alpha = 0.8)
|
27
|
+
fig.tight_layout()
|
28
|
+
plt.show()
|