Skip to content

Projeto Finalizado #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

Description.
The package package_name is used to:
-
-
Processing
- Histogram matching
- Structural similary
- Resize image
Utils
- Read image
- Save image
- Plot image
- Plot result
- Plot histogram

## Installation

Expand All @@ -13,15 +21,8 @@ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install package
pip install package_name
```

## Usage

```python
from package_name.module1_name import file1_name
file1_name.my_function()
```

## Author
My_name
Rodrigo

## License
[MIT](https://choosealicense.com/licenses/mit/)
Empty file.
Empty file.
17 changes: 17 additions & 0 deletions build/lib/image_processing/processing/combination.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import numpy as np
from skimage.color import rgb2gray
from skimage.exposure import match_histograms
from skimage.metrics import structural_similarity

def find_difference(image1, image2):
assert image1.shape == image2.shape, "Specify 2 images with de same shape."
gray_image1 = rgb2gray(image1)
gray_image2 = rgb2gray(image2)
(score, difference_image) = structural_similarity(gray_image1, gray_image2, full=True)
print("Similarity of the images:", score)
normalized_difference_image = (difference_image-np.min(difference_image))/(np.max(difference_image)-np.min(difference_image))
return normalized_difference_image

def transfer_histogram(image1, image2):
matched_image = match_histograms(image1, image2, multichannel=True)
return matched_image
8 changes: 8 additions & 0 deletions build/lib/image_processing/processing/transformation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from skimage.transform import resize

def resize_image(image, proportion):
assert 0 <= proportion <= 1, "Specify a valid proportion between 0 and 1."
height = round(image.shape[0] * proportion)
width = round(image.shape[1] * proportion)
image_resized = resize(image, (height, width), anti_aliasing=True)
return image_resized
Empty file.
8 changes: 8 additions & 0 deletions build/lib/image_processing/utils/io.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from skimage.io import imread, imsave

def read_image(path, is_gray = False):
image = imread(path, as_gray = is_gray)
return image

def save_image(image, path):
imsave(path, image)
28 changes: 28 additions & 0 deletions build/lib/image_processing/utils/plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import matplotlib.pyplot as plt

def plot_image(image):
plt.figure(figsize=(12, 4))
plt.imshow(image, cmap='gray')
plt.axis('off')
plt.show()

def plot_result(*args):
number_images = len(args)
fig, axis = plt.subplots(nrows=1, ncols = number_images, figsize=(12, 4))
names_lst = ['Image {}'.format(i) for i in range(1, number_images)]
names_lst.append('Result')
for ax, name, image in zip(axis, names_lst, args):
ax.set_title(name)
ax.imshow(image, cmap='gray')
ax.axis('off')
fig.tight_layout()
plt.show()

def plot_histogram(image):
fig, axis = plt.subplots(nrows=1, ncols = 3, figsize=(12, 4), sharex=True, sharey=True)
color_lst = ['red', 'green', 'blue']
for index, (ax, color) in enumerate(zip(axis, color_lst)):
ax.set_title('{} histogram'.format(color.title()))
ax.hist(image[:, :, index].ravel(), bins = 256, color = color, alpha = 0.8)
fig.tight_layout()
plt.show()
Binary file added dist/image_proccesing-0.0.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/image_proccesing-0.0.1.tar.gz
Binary file not shown.
45 changes: 45 additions & 0 deletions image_proccesing.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Metadata-Version: 2.2
Name: image_proccesing
Version: 0.0.1
Home-page: https://github.com/yDigss/image-processing-package.git
Author: Rodrigo
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: scikit-image>=0.16.1
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python

# package_name

Description.
The package package_name is used to:
Processing
- Histogram matching
- Structural similary
- Resize image
Utils
- Read image
- Save image
- Plot image
- Plot result
- Plot histogram

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install package_name

```bash
pip install package_name
```

## Author
Rodrigo

## License
[MIT](https://choosealicense.com/licenses/mit/)
14 changes: 14 additions & 0 deletions image_proccesing.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
README.md
setup.py
image_proccesing.egg-info/PKG-INFO
image_proccesing.egg-info/SOURCES.txt
image_proccesing.egg-info/dependency_links.txt
image_proccesing.egg-info/requires.txt
image_proccesing.egg-info/top_level.txt
image_processing/__init__.py
image_processing/processing/__init__.py
image_processing/processing/combination.py
image_processing/processing/transformation.py
image_processing/utils/__init__.py
image_processing/utils/io.py
image_processing/utils/plot.py
1 change: 1 addition & 0 deletions image_proccesing.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions image_proccesing.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
matplotlib
numpy
scikit-image>=0.16.1
1 change: 1 addition & 0 deletions image_proccesing.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
image_processing
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
matplotlib
numpy
scikit-image >= 0.16.1
20 changes: 20 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from setuptools import setup, find_packages

with open("README.md", "r") as f:
page_description = f.read()

with open("requirements.txt") as f:
requirements = f.read().splitlines()

setup(
name="image_proccesing",
version="0.0.1",
author="Rodrigo",
description="",
long_description=page_description,
long_description_content_type="text/markdown",
url="https://github.com/yDigss/image-processing-package.git",
packages=find_packages(),
install_requires=requirements,
python_requires=">=3.5",
)