From 8d2f342a2172f263eb59c049b65d152447676992 Mon Sep 17 00:00:00 2001 From: Rodrigo Silva Date: Sun, 16 Mar 2025 20:54:54 -0300 Subject: [PATCH 1/2] adicionando projeto --- README.md | 21 +++++++++++---------- requirements.txt | 3 +++ setup.py | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f984923c6..163758a7a 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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/) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e69de29bb..aedfba4e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1,3 @@ +matplotlib +numpy +scikit-image >= 0.16.1 \ No newline at end of file diff --git a/setup.py b/setup.py index e69de29bb..d78ce6d8d 100644 --- a/setup.py +++ b/setup.py @@ -0,0 +1,20 @@ +from setuptools import setup, find_packages + +with open("README.mb", "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="link github", + packages=find_packages(), + install_requires=requirements, + python_requires=">=3.5", +) \ No newline at end of file From df29a02daef398c2c89d0c5f5055964e9553c524 Mon Sep 17 00:00:00 2001 From: Rodrigo Silva Date: Sun, 16 Mar 2025 21:28:48 -0300 Subject: [PATCH 2/2] Finalizando com Pypi --- build/lib/image_processing/__init__.py | 0 .../image_processing/processing/__init__.py | 0 .../processing/combination.py | 17 +++++++ .../processing/transformation.py | 8 ++++ build/lib/image_processing/utils/__init__.py | 0 build/lib/image_processing/utils/io.py | 8 ++++ build/lib/image_processing/utils/plot.py | 28 +++++++++++ dist/image_proccesing-0.0.1-py3-none-any.whl | Bin 0 -> 3764 bytes dist/image_proccesing-0.0.1.tar.gz | Bin 0 -> 2700 bytes image_proccesing.egg-info/PKG-INFO | 45 ++++++++++++++++++ image_proccesing.egg-info/SOURCES.txt | 14 ++++++ .../dependency_links.txt | 1 + image_proccesing.egg-info/requires.txt | 3 ++ image_proccesing.egg-info/top_level.txt | 1 + setup.py | 4 +- 15 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 build/lib/image_processing/__init__.py create mode 100644 build/lib/image_processing/processing/__init__.py create mode 100644 build/lib/image_processing/processing/combination.py create mode 100644 build/lib/image_processing/processing/transformation.py create mode 100644 build/lib/image_processing/utils/__init__.py create mode 100644 build/lib/image_processing/utils/io.py create mode 100644 build/lib/image_processing/utils/plot.py create mode 100644 dist/image_proccesing-0.0.1-py3-none-any.whl create mode 100644 dist/image_proccesing-0.0.1.tar.gz create mode 100644 image_proccesing.egg-info/PKG-INFO create mode 100644 image_proccesing.egg-info/SOURCES.txt create mode 100644 image_proccesing.egg-info/dependency_links.txt create mode 100644 image_proccesing.egg-info/requires.txt create mode 100644 image_proccesing.egg-info/top_level.txt diff --git a/build/lib/image_processing/__init__.py b/build/lib/image_processing/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/build/lib/image_processing/processing/__init__.py b/build/lib/image_processing/processing/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/build/lib/image_processing/processing/combination.py b/build/lib/image_processing/processing/combination.py new file mode 100644 index 000000000..a75ecbd27 --- /dev/null +++ b/build/lib/image_processing/processing/combination.py @@ -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 \ No newline at end of file diff --git a/build/lib/image_processing/processing/transformation.py b/build/lib/image_processing/processing/transformation.py new file mode 100644 index 000000000..a726ada29 --- /dev/null +++ b/build/lib/image_processing/processing/transformation.py @@ -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 \ No newline at end of file diff --git a/build/lib/image_processing/utils/__init__.py b/build/lib/image_processing/utils/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/build/lib/image_processing/utils/io.py b/build/lib/image_processing/utils/io.py new file mode 100644 index 000000000..12d396ffc --- /dev/null +++ b/build/lib/image_processing/utils/io.py @@ -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) \ No newline at end of file diff --git a/build/lib/image_processing/utils/plot.py b/build/lib/image_processing/utils/plot.py new file mode 100644 index 000000000..a59c55696 --- /dev/null +++ b/build/lib/image_processing/utils/plot.py @@ -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() \ No newline at end of file diff --git a/dist/image_proccesing-0.0.1-py3-none-any.whl b/dist/image_proccesing-0.0.1-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..6a0e21919ffc886ffd8743bd57670994b1e5c7d9 GIT binary patch literal 3764 zcma)-jy#XINOFAP|THw46q; z0&YOeYd^p^08FeW#>ELuAmSaINF*%IMFx$=;;>{i8bR=50U2+*R(z|qKZiMHKSI}F z0)ck0fIvt71>=DCw8!EwWGo&B1Vp*sf(w@Aem<#6tK~fOTroP%H+($$Q9soE9sOo< zoZ70XmbJkXFA(NSd5e#ITQd=)fISvGb-^a1%WVpsR?F*-)onZ(_IA*PPzfE zMe-X&2>*%`7V-!ws>oCV!$)NDcB|_-*?2a z9O+jltX_3F@~DKxvZiuKv2DT}TJ!US@%6+Mea@YIQ1E-+r;KUuj8XsT6ZB58W3IU@ zxkZf!+f;>-T3j;HFRDr=Vv{3-GWqzE%G!&y*xdHLSO^w3?1-)p5ecX;s64{Kk`sGy zhAaMU*wOeRff4o+@q~vClC|m!_BPq|sx^%>Mar2qBXaX4&Le?x&2FFF5B2(7!1zb@ z?HT?=lj(-pA{0K9cxGmuL^%i_=Wrlgj&?_1^r_gWrcvwg;uGNbEdeQ{|3wBe5rZQ+ zMRC99wLQtB4UQ!4(v`987PT#+qa_L0|Cwz`Ue!ci5pgUi% z@(mWM79UM}bZdy$RWb3Ptkorl>v|u`N&D-h=9sz1XrkFO6z1}fqW9jg1Bva!Gg%Nl zIvD@wA19xgsp{o~NtW$3@k=+}Ju1J$hs9Jw*)?!J&CyVLT$uaz1IUMtPt-g5Wf;EP zk||K(wCv-$s<{)0h!Gv~OGrh+-3}Rq)cx|~(;=;)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EaMl(+GC45{VR8U|JM}|e-Uuxp1Xe37` z=rkbGK0-Do1;agL+y+PnYhc2ECMhiRbaV{aD&@GUWx3fHwwa7B9(f)b*q_>#9l~fv z__qbd1WE0DOzB%*354T)`;ZWn#48rAT#Q|*=yP7@>{+Ms%$qZDdkU_(+~_0}u39Vm z2X>Uf)SHv;Nu-VH&#|w^2LqCJp-ahx4~UBwn24W=kBldvJ)C@;JP>4Ga$^(H5EUhJ zxB+D(jc9H4!KNH{AKulFljL;7Q~sA9O^l79QyjE9CVOB4O5lN#Q}vF{{2P7n>21qW7OS|PkN zLfe~!ay{1bez6(wsczFE7fe;v%ha&*e%Q3&J79CsiYMdp>X!DrJhN8^>=+lP0|vy~ z4)7Ws7Wr5yR7UKjcX7Ch-#j8&iAY>I@Y;^#bym#!VcwHPNbfzVYYJv@U)-raoD&Ld zN`0bpD$eH%_YO`ocMJGD%ZW5Uh_@AsrIo*vR%NjE`3-zfNIkSFxc6|@asZ(P#UH~i zr`$>8=XNeWP{l!~`L9e}NN%BC@f{`;A4)=;%YXox$3B49-l^^=j z_gR+&QZi~{#4fSKfKA_9Z1sTtm21j8uw~zXNYqT>_uDPOYMSG>HS zbs*Jb6>OxXT21^T``2u=u3AaiX#OB?=pA)B>$555Sd85jASsxbp`h)(FpzkEk7DZD z-;bQ}k4S3?_H`6fRe{^@NL%~l&Ctz0c^w-3FVKyyc{6vj@muF|0bd3`3idl2xEZ~M z`ucUT=BB=mV(KoS^u9xX=dCvLHhZgep6T|yzn#`*(q`MUPGVx+HnRVjpl?}Qy<*o{ z18m>2wrMV3U$~pGo164Hc7gpTuz$DgZ<$*))^%n)$4@XfwApXjTXog1>_Y1N&#?dL VvBqcEz-tR3!1WuTDHmkz>A%whv-$u4 literal 0 HcmV?d00001 diff --git a/dist/image_proccesing-0.0.1.tar.gz b/dist/image_proccesing-0.0.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4afe8e749d8e1b2c6c59c0f4094acfc20a77bb09 GIT binary patch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eYP`j_uv#>EYq|AHXe| A2mk;8 literal 0 HcmV?d00001 diff --git a/image_proccesing.egg-info/PKG-INFO b/image_proccesing.egg-info/PKG-INFO new file mode 100644 index 000000000..66e1f51d2 --- /dev/null +++ b/image_proccesing.egg-info/PKG-INFO @@ -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/) diff --git a/image_proccesing.egg-info/SOURCES.txt b/image_proccesing.egg-info/SOURCES.txt new file mode 100644 index 000000000..b95c1ceab --- /dev/null +++ b/image_proccesing.egg-info/SOURCES.txt @@ -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 \ No newline at end of file diff --git a/image_proccesing.egg-info/dependency_links.txt b/image_proccesing.egg-info/dependency_links.txt new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/image_proccesing.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/image_proccesing.egg-info/requires.txt b/image_proccesing.egg-info/requires.txt new file mode 100644 index 000000000..9c62440d9 --- /dev/null +++ b/image_proccesing.egg-info/requires.txt @@ -0,0 +1,3 @@ +matplotlib +numpy +scikit-image>=0.16.1 diff --git a/image_proccesing.egg-info/top_level.txt b/image_proccesing.egg-info/top_level.txt new file mode 100644 index 000000000..9e9fe703a --- /dev/null +++ b/image_proccesing.egg-info/top_level.txt @@ -0,0 +1 @@ +image_processing diff --git a/setup.py b/setup.py index d78ce6d8d..10173f1f2 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -with open("README.mb", "r") as f: +with open("README.md", "r") as f: page_description = f.read() with open("requirements.txt") as f: @@ -13,7 +13,7 @@ description="", long_description=page_description, long_description_content_type="text/markdown", - url="link github", + url="https://github.com/yDigss/image-processing-package.git", packages=find_packages(), install_requires=requirements, python_requires=">=3.5",