image-processing-laranjodupy 0.0.1__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.
- image_processing_laranjodupy-0.0.1/MANIFEST.in +1 -0
- image_processing_laranjodupy-0.0.1/PKG-INFO +51 -0
- image_processing_laranjodupy-0.0.1/README.md +30 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy/__init__.py +0 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy/processing/__init__.py +0 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy/processing/combination.py +23 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy/processing/transformation.py +12 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy/utils/__init__.py +0 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy/utils/io.py +8 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy/utils/plot.py +30 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy.egg-info/PKG-INFO +51 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy.egg-info/SOURCES.txt +16 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy.egg-info/dependency_links.txt +1 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy.egg-info/requires.txt +3 -0
- image_processing_laranjodupy-0.0.1/image_processing_laranjodupy.egg-info/top_level.txt +1 -0
- image_processing_laranjodupy-0.0.1/requirements.txt +4 -0
- image_processing_laranjodupy-0.0.1/setup.cfg +4 -0
- image_processing_laranjodupy-0.0.1/setup.py +24 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include requirements.txt
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: image-processing-laranjodupy
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Projeto de processamento de imagens
|
|
5
|
+
Home-page: https://github.com/laranjodupy/image_processing_with_python
|
|
6
|
+
Author: laranjodupy
|
|
7
|
+
Author-email: vianalimadaniel@gmail.com
|
|
8
|
+
Requires-Python: >= 3.8
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: numpy
|
|
11
|
+
Requires-Dist: scikit-image
|
|
12
|
+
Requires-Dist: matplotlib
|
|
13
|
+
Dynamic: author
|
|
14
|
+
Dynamic: author-email
|
|
15
|
+
Dynamic: description
|
|
16
|
+
Dynamic: description-content-type
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: requires-dist
|
|
19
|
+
Dynamic: requires-python
|
|
20
|
+
Dynamic: summary
|
|
21
|
+
|
|
22
|
+
# image_processing
|
|
23
|
+
|
|
24
|
+
Description.
|
|
25
|
+
The package image_processing is used to:
|
|
26
|
+
Processing:
|
|
27
|
+
- Histogram matching
|
|
28
|
+
- Structural similarity
|
|
29
|
+
- Resize image
|
|
30
|
+
|
|
31
|
+
Utils:
|
|
32
|
+
- Read image
|
|
33
|
+
- Save image
|
|
34
|
+
- Plot image
|
|
35
|
+
- Plot result
|
|
36
|
+
- Plot histogram
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install image_processing
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install image_processing
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Author
|
|
48
|
+
Laranjodupy
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# image_processing
|
|
2
|
+
|
|
3
|
+
Description.
|
|
4
|
+
The package image_processing is used to:
|
|
5
|
+
Processing:
|
|
6
|
+
- Histogram matching
|
|
7
|
+
- Structural similarity
|
|
8
|
+
- Resize image
|
|
9
|
+
|
|
10
|
+
Utils:
|
|
11
|
+
- Read image
|
|
12
|
+
- Save image
|
|
13
|
+
- Plot image
|
|
14
|
+
- Plot result
|
|
15
|
+
- Plot histogram
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install image_processing
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install image_processing
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Author
|
|
27
|
+
Laranjodupy
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
def find_difference(image1, image2):
|
|
7
|
+
'''Função que converte as imagens para um tipo padrão (gray) e retorna a imagem de diferença.
|
|
8
|
+
|
|
9
|
+
Retorna
|
|
10
|
+
-----------
|
|
11
|
+
normalized_difference_image -> A imagem de diferença tratada, onde nela está destacada as cores que mais se divergem entre as imagens.'''
|
|
12
|
+
assert image1.shape == image2.shape, "Tem que ser duas imagens com o mesmo tamanho." #o assert não vai rodar o programa caso dê o erro na condicional e retorna o erro após a vírgula
|
|
13
|
+
gray_image1 = rgb2gray(image1)
|
|
14
|
+
gray_image2 = rgb2gray(image2)
|
|
15
|
+
(score, difference_image) = structural_similarity(gray_image1, gray_image2, full=True) #aqui ele vai ver o nível de similaridade entre as imagens e gerar a imagem de diferença
|
|
16
|
+
print("Similarity of the images:", score)
|
|
17
|
+
normalized_difference_image = (difference_image - np.min(difference_image)) / (np.max(difference_image) - np.min(difference_image)) #aqui é onde a imagem de diferença vai ser tratada para ser melhor visualizada em imagem, pois vai sobrar apenas as cores mais diferentes entre as imagens.
|
|
18
|
+
return normalized_difference_image
|
|
19
|
+
|
|
20
|
+
def transfer_histogram(image1, image2):
|
|
21
|
+
matched_image = match_histograms(image1, image2, multichannel=True) #faz, de um jeito bem abstraído, a transferência de cor da segunda imagem para a primeira. e retorna a image1 com as cores principais da image2
|
|
22
|
+
return matched_image
|
|
23
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from skimage.transform import resize
|
|
2
|
+
|
|
3
|
+
def resize_image(image,proportion):
|
|
4
|
+
assert 0 <= proportion <= 1, "Especifique uma proporção válida entre 0 e 1"
|
|
5
|
+
height = round(image.shape[0] * proportion)
|
|
6
|
+
width = round(image.shape[1] * proportion) #aqui nós multiplicamos pela proporção e utilizamos o round para que retorne um valor inteiro, pois precisamos que seja inteiro para passar ao resize.
|
|
7
|
+
image_resized = resize(image, (height, width), anti_aliasing=True)
|
|
8
|
+
return image_resized
|
|
9
|
+
|
|
10
|
+
#Aviso: pelo que eu entendi, essa é apenas uma das outras alternativas:
|
|
11
|
+
#Por exemplo, você pode utilizar o resize de uma imagem utilizando outra como referência.
|
|
12
|
+
# Outro exemplo é você poder criar uma proporção automaticamente utilizando algo como base.
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from skimage.io import imread, imsave
|
|
2
|
+
|
|
3
|
+
def read_image(path, isgray=False):
|
|
4
|
+
image = imread(path, as_gray=isgray)
|
|
5
|
+
return image
|
|
6
|
+
|
|
7
|
+
def save_image(image,path): #KKKKKKKKKKKKKKK chega a ser engraçado essa função chamar outra pra fazer o trabalho dele, mas da para entender o porquê disso.
|
|
8
|
+
imsave(path,image)
|
|
@@ -0,0 +1,30 @@
|
|
|
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, fig_size=(12,4))
|
|
12
|
+
names_lst = [f'Image {i}' for i in range(1, number_images)]
|
|
13
|
+
names_lst.append('Result')
|
|
14
|
+
|
|
15
|
+
for ax, name, image in zip(axis, names_lst, args):
|
|
16
|
+
ax.set_title(name)
|
|
17
|
+
ax.imshow(image, cmap='gray')
|
|
18
|
+
ax.axis('off')
|
|
19
|
+
|
|
20
|
+
fig.tight_layout()
|
|
21
|
+
plt.show()
|
|
22
|
+
|
|
23
|
+
def plot_histogram(image):
|
|
24
|
+
fig, axis = plt.subplots(nrows=1, ncols=3, figsize=(12,4), sharex=True, sharey=True)
|
|
25
|
+
color_lst = ['red', 'green', 'blue']
|
|
26
|
+
for index, (ax, color) in enumerate(zip(axis, color_lst)):
|
|
27
|
+
ax.set_title(f'{color.title()} histogram')
|
|
28
|
+
ax.hist(image[:, :, index].ravel(), bins=256, color=color, alpha=0.8)
|
|
29
|
+
fig.tight_layout()
|
|
30
|
+
plt.show()
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: image-processing-laranjodupy
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Projeto de processamento de imagens
|
|
5
|
+
Home-page: https://github.com/laranjodupy/image_processing_with_python
|
|
6
|
+
Author: laranjodupy
|
|
7
|
+
Author-email: vianalimadaniel@gmail.com
|
|
8
|
+
Requires-Python: >= 3.8
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: numpy
|
|
11
|
+
Requires-Dist: scikit-image
|
|
12
|
+
Requires-Dist: matplotlib
|
|
13
|
+
Dynamic: author
|
|
14
|
+
Dynamic: author-email
|
|
15
|
+
Dynamic: description
|
|
16
|
+
Dynamic: description-content-type
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: requires-dist
|
|
19
|
+
Dynamic: requires-python
|
|
20
|
+
Dynamic: summary
|
|
21
|
+
|
|
22
|
+
# image_processing
|
|
23
|
+
|
|
24
|
+
Description.
|
|
25
|
+
The package image_processing is used to:
|
|
26
|
+
Processing:
|
|
27
|
+
- Histogram matching
|
|
28
|
+
- Structural similarity
|
|
29
|
+
- Resize image
|
|
30
|
+
|
|
31
|
+
Utils:
|
|
32
|
+
- Read image
|
|
33
|
+
- Save image
|
|
34
|
+
- Plot image
|
|
35
|
+
- Plot result
|
|
36
|
+
- Plot histogram
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install image_processing
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install image_processing
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Author
|
|
48
|
+
Laranjodupy
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
MANIFEST.in
|
|
2
|
+
README.md
|
|
3
|
+
requirements.txt
|
|
4
|
+
setup.py
|
|
5
|
+
image_processing_laranjodupy/__init__.py
|
|
6
|
+
image_processing_laranjodupy.egg-info/PKG-INFO
|
|
7
|
+
image_processing_laranjodupy.egg-info/SOURCES.txt
|
|
8
|
+
image_processing_laranjodupy.egg-info/dependency_links.txt
|
|
9
|
+
image_processing_laranjodupy.egg-info/requires.txt
|
|
10
|
+
image_processing_laranjodupy.egg-info/top_level.txt
|
|
11
|
+
image_processing_laranjodupy/processing/__init__.py
|
|
12
|
+
image_processing_laranjodupy/processing/combination.py
|
|
13
|
+
image_processing_laranjodupy/processing/transformation.py
|
|
14
|
+
image_processing_laranjodupy/utils/__init__.py
|
|
15
|
+
image_processing_laranjodupy/utils/io.py
|
|
16
|
+
image_processing_laranjodupy/utils/plot.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
image_processing_laranjodupy
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
BASE_DIR = Path(__file__).resolve().parent
|
|
5
|
+
|
|
6
|
+
with open("README.md", 'r') as f:
|
|
7
|
+
page_description = f.read()
|
|
8
|
+
|
|
9
|
+
with open(BASE_DIR / "requirements.txt", 'r') as f:
|
|
10
|
+
requirements = f.read().splitlines()
|
|
11
|
+
|
|
12
|
+
setup(
|
|
13
|
+
name="image-processing-laranjodupy",
|
|
14
|
+
version="0.0.1",
|
|
15
|
+
author='laranjodupy',
|
|
16
|
+
author_email='vianalimadaniel@gmail.com',
|
|
17
|
+
description='Projeto de processamento de imagens',
|
|
18
|
+
long_description=page_description,
|
|
19
|
+
long_description_content_type="text/markdown",
|
|
20
|
+
url="https://github.com/laranjodupy/image_processing_with_python",
|
|
21
|
+
packages= find_packages(),
|
|
22
|
+
install_requires=requirements, #focar em passar apenas o que é necessário para utilizar o pacote
|
|
23
|
+
python_requires='>= 3.8',
|
|
24
|
+
)
|