Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-imreg for openSUSE:Factory checked in at 2024-01-07 21:39:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-imreg (Old) and /work/SRC/openSUSE:Factory/.python-imreg.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-imreg" Sun Jan 7 21:39:54 2024 rev:5 rq:1137304 version:2024.1.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-imreg/python-imreg.changes 2023-06-01 17:19:29.266148782 +0200 +++ /work/SRC/openSUSE:Factory/.python-imreg.new.28375/python-imreg.changes 2024-01-07 21:40:11.791788249 +0100 @@ -1,0 +2,7 @@ +Sat Jan 6 20:56:51 UTC 2024 - Dirk Müller <[email protected]> + +- update to 2024.1.2: + * Add type hints. + * Drop support for Python 3.8 and numpy < 1.23 (NEP29). + +------------------------------------------------------------------- Old: ---- imreg-2022.9.27.tar.gz New: ---- imreg-2024.1.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-imreg.spec ++++++ --- /var/tmp/diff_new_pack.xCmxNV/_old 2024-01-07 21:40:12.223803964 +0100 +++ /var/tmp/diff_new_pack.xCmxNV/_new 2024-01-07 21:40:12.227804109 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-imreg # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,13 +18,16 @@ %{?sle15_python_module_pythons} Name: python-imreg -Version: 2022.9.27 +Version: 2024.1.2 Release: 0 Summary: FFT based image registration License: BSD-3-Clause -URL: https://www.lfd.uci.edu/~gohlke/ +URL: https://github.com/cgohlke/imreg/ Source: https://files.pythonhosted.org/packages/source/i/imreg/imreg-%{version}.tar.gz +BuildRequires: %{python_module base >= 3.9} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-numpy >= 1.15 @@ -44,14 +47,15 @@ %setup -q -n imreg-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/imreg +%{python_sitelib}/imreg-%{version}.dist-info ++++++ imreg-2022.9.27.tar.gz -> imreg-2024.1.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/LICENSE new/imreg-2024.1.2/LICENSE --- old/imreg-2022.9.27/LICENSE 2022-09-27 21:30:34.000000000 +0200 +++ new/imreg-2024.1.2/LICENSE 2024-01-02 22:48:20.000000000 +0100 @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2011-2022, Christoph Gohlke +Copyright (c) 2011-2024, Christoph Gohlke All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/MANIFEST.in new/imreg-2024.1.2/MANIFEST.in --- old/imreg-2022.9.27/MANIFEST.in 2018-08-16 01:01:21.000000000 +0200 +++ new/imreg-2024.1.2/MANIFEST.in 2022-12-09 01:09:13.000000000 +0100 @@ -1,6 +1,12 @@ include LICENSE include README.rst +exclude *.cmd +recursive-exclude doc * +recursive-exclude docs * +recursive-exclude test * +recursive-exclude tests * + recursive-exclude * __pycache__ recursive-exclude * *.py[co] recursive-exclude * *Copy* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/PKG-INFO new/imreg-2024.1.2/PKG-INFO --- old/imreg-2022.9.27/PKG-INFO 2022-09-27 21:30:36.396435700 +0200 +++ new/imreg-2024.1.2/PKG-INFO 2024-01-02 22:48:21.616084300 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: imreg -Version: 2022.9.27 +Version: 2024.1.2 Summary: FFT based image registration Home-page: https://www.cgohlke.com Author: Christoph Gohlke @@ -15,13 +15,15 @@ Classifier: Intended Audience :: Developers Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 -Requires-Python: >=3.7 +Classifier: Programming Language :: Python :: 3.12 +Requires-Python: >=3.9 +Description-Content-Type: text/x-rst License-File: LICENSE +Requires-Dist: numpy +Requires-Dist: scipy FFT based image registration ============================ @@ -31,19 +33,41 @@ :Author: `Christoph Gohlke <https://www.cgohlke.com>`_ :License: BSD 3-Clause -:Version: 2022.9.27 +:Version: 2024.1.2 + +Quickstart +---------- + +Install the imreg package and all dependencies from the +`Python Package Index <https://pypi.org/project/imreg/>`_:: + + python -m pip install -U imreg + +See `Examples`_ for using the programming interface. + +Source code and support are available on +`GitHub <https://github.com/cgohlke/imreg>`_. Requirements ------------ -* `CPython >= 3.7 <https://www.python.org>`_ -* `Numpy 1.15 <https://www.numpy.org>`_ -* `Scipy 1.5 <https://www.scipy.org>`_ -* `Matplotlib 3.3 <https://www.matplotlib.org>`_ (optional for plotting) +This revision was tested with the following requirements and dependencies +(other versions may work): + +- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.7, 3.12.1 +- `NumPy <https://pypi.org/project/numpy/>`_ 1.26.2 +- `Scipy <https://pypi.org/project/scipy>`_ 1.11.4 +- `Matplotlib 3.8.2 <https://pypi.org/project/matplotlib>`_ + (optional for plotting) Revisions --------- +2024.1.2 + +- Add type hints. +- Drop support for Python 3.8 and numpy < 1.23 (NEP29). + 2022.9.27 - Fix scipy.ndimage DeprecationWarning. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/README.rst new/imreg-2024.1.2/README.rst --- old/imreg-2022.9.27/README.rst 2022-09-27 21:30:34.000000000 +0200 +++ new/imreg-2024.1.2/README.rst 2024-01-02 22:48:20.000000000 +0100 @@ -6,19 +6,41 @@ :Author: `Christoph Gohlke <https://www.cgohlke.com>`_ :License: BSD 3-Clause -:Version: 2022.9.27 +:Version: 2024.1.2 + +Quickstart +---------- + +Install the imreg package and all dependencies from the +`Python Package Index <https://pypi.org/project/imreg/>`_:: + + python -m pip install -U imreg + +See `Examples`_ for using the programming interface. + +Source code and support are available on +`GitHub <https://github.com/cgohlke/imreg>`_. Requirements ------------ -* `CPython >= 3.7 <https://www.python.org>`_ -* `Numpy 1.15 <https://www.numpy.org>`_ -* `Scipy 1.5 <https://www.scipy.org>`_ -* `Matplotlib 3.3 <https://www.matplotlib.org>`_ (optional for plotting) +This revision was tested with the following requirements and dependencies +(other versions may work): + +- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.7, 3.12.1 +- `NumPy <https://pypi.org/project/numpy/>`_ 1.26.2 +- `Scipy <https://pypi.org/project/scipy>`_ 1.11.4 +- `Matplotlib 3.8.2 <https://pypi.org/project/matplotlib>`_ + (optional for plotting) Revisions --------- +2024.1.2 + +- Add type hints. +- Drop support for Python 3.8 and numpy < 1.23 (NEP29). + 2022.9.27 - Fix scipy.ndimage DeprecationWarning. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/imreg/__init__.py new/imreg-2024.1.2/imreg/__init__.py --- old/imreg-2022.9.27/imreg/__init__.py 2020-01-01 03:39:29.000000000 +0100 +++ new/imreg-2024.1.2/imreg/__init__.py 2024-01-02 22:45:28.000000000 +0100 @@ -1,4 +1,4 @@ # imreg/__init__.py -from .imreg import __doc__, __all__, __version__ from .imreg import * +from .imreg import __all__, __doc__, __version__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/imreg/imreg.py new/imreg-2024.1.2/imreg/imreg.py --- old/imreg-2022.9.27/imreg/imreg.py 2022-09-27 21:28:06.000000000 +0200 +++ new/imreg-2024.1.2/imreg/imreg.py 2024-01-02 22:35:32.000000000 +0100 @@ -1,6 +1,6 @@ # imreg.py -# Copyright (c) 2011-2022, Christoph Gohlke +# Copyright (c) 2011-2024, Christoph Gohlke # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -36,19 +36,41 @@ :Author: `Christoph Gohlke <https://www.cgohlke.com>`_ :License: BSD 3-Clause -:Version: 2022.9.27 +:Version: 2024.1.2 + +Quickstart +---------- + +Install the imreg package and all dependencies from the +`Python Package Index <https://pypi.org/project/imreg/>`_:: + + python -m pip install -U imreg + +See `Examples`_ for using the programming interface. + +Source code and support are available on +`GitHub <https://github.com/cgohlke/imreg>`_. Requirements ------------ -* `CPython >= 3.7 <https://www.python.org>`_ -* `Numpy 1.15 <https://www.numpy.org>`_ -* `Scipy 1.5 <https://www.scipy.org>`_ -* `Matplotlib 3.3 <https://www.matplotlib.org>`_ (optional for plotting) +This revision was tested with the following requirements and dependencies +(other versions may work): + +- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.7, 3.12.1 +- `NumPy <https://pypi.org/project/numpy/>`_ 1.26.2 +- `Scipy <https://pypi.org/project/scipy>`_ 1.11.4 +- `Matplotlib 3.8.2 <https://pypi.org/project/matplotlib>`_ + (optional for plotting) Revisions --------- +2024.1.2 + +- Add type hints. +- Drop support for Python 3.8 and numpy < 1.23 (NEP29). + 2022.9.27 - Fix scipy.ndimage DeprecationWarning. @@ -90,9 +112,11 @@ """ -__version__ = '2022.9.27' +from __future__ import annotations -__all__ = ( +__version__ = '2024.1.2' + +__all__ = [ 'translation', 'similarity', 'similarity_matrix', @@ -100,22 +124,31 @@ 'highpass', 'imread', 'imshow', -) +] import math +import os +from typing import TYPE_CHECKING import numpy -from numpy.fft import fft2, ifft2, fftshift +from numpy.fft import fft2, fftshift, ifft2 +from scipy import ndimage + +if TYPE_CHECKING: + from typing import Any -try: - import scipy.ndimage as ndimage -except ImportError: - import ndimage # type: ignore + from numpy.typing import ArrayLike, NDArray -def translation(im0, im1): +def translation( + im0: ArrayLike, + im1: ArrayLike, + /, +) -> tuple[int, int]: """Return translation vector to register images.""" + im0 = numpy.asanyarray(im0) shape = im0.shape + assert len(shape) == 2 f0 = fft2(im0) f1 = fft2(im1) ir = abs(ifft2((f0 * f1.conjugate()) / (abs(f0) * abs(f1)))) @@ -124,11 +157,15 @@ t0 -= shape[0] if t1 > shape[1] // 2: t1 -= shape[1] - return [t0, t1] + return int(t0), int(t1) -def similarity(im0, im1): - """Return similarity transformed image im1 and transformation parameters. +def similarity( + im0: ArrayLike, + im1: ArrayLike, + /, +) -> tuple[NDArray[Any], float, float, tuple[int, int]]: + """Return similarity transformed image `im1` and transformation parameters. Transformation parameters are: isotropic scale factor, rotation angle (in degrees), and translation vector. @@ -137,16 +174,20 @@ scale and without shear. Limitations: - Image shapes must be equal and square. - All image areas must have same scale, rotation, and shift. - Scale change must be less than 1.8. - No subpixel precision. + + - Image shapes must be equal and square. + - All image areas must have same scale, rotation, and shift. + - Scale change must be less than 1.8. + - No subpixel precision. """ + im0 = numpy.asanyarray(im0) + im1 = numpy.asanyarray(im1) + if im0.shape != im1.shape: raise ValueError('images must have same shapes') if len(im0.shape) != 2: - raise ValueError('images must be 2 dimensional') + raise ValueError('images must be two-dimensional') f0 = fftshift(abs(fft2(im0))) f1 = fftshift(abs(fft2(im1))) @@ -159,19 +200,19 @@ f0, log_base = logpolar(f0) f1, log_base = logpolar(f1) - f0 = fft2(f0) - f1 = fft2(f1) + f0 = fft2(f0) # type: ignore + f1 = fft2(f1) # type: ignore r0 = abs(f0) * abs(f1) ir = abs(ifft2((f0 * f1.conjugate()) / r0)) i0, i1 = numpy.unravel_index(numpy.argmax(ir), ir.shape) - angle = 180.0 * i0 / ir.shape[0] - scale = log_base**i1 + angle: float = 180.0 * int(i0) / ir.shape[0] + scale: float = log_base ** int(i1) if scale > 1.8: ir = abs(ifft2((f1 * f0.conjugate()) / r0)) i0, i1 = numpy.unravel_index(numpy.argmax(ir), ir.shape) - angle = -180.0 * i0 / ir.shape[0] - scale = 1.0 / (log_base**i1) + angle = -180.0 * int(i0) / ir.shape[0] + scale = 1.0 / (log_base ** int(i1)) if scale > 1.8: raise ValueError('images are not compatible. Scale change > 1.8') @@ -190,8 +231,8 @@ elif im2.shape > im0.shape: im2 = im2[: im0.shape[0], : im0.shape[1]] - f0 = fft2(im0) - f1 = fft2(im2) + f0 = fft2(im0) # type: ignore + f1 = fft2(im2) # type: ignore ir = abs(ifft2((f0 * f1.conjugate()) / (abs(f0) * abs(f1)))) t0, t1 = numpy.unravel_index(numpy.argmax(ir), ir.shape) @@ -211,10 +252,14 @@ t0, t1 = d + t1, d + t0 scale = (im1.shape[1] - 1) / (int(im1.shape[1] / scale) - 1) - return im2, scale, angle, [-t0, -t1] + return im2, scale, angle, (int(-t0), int(-t1)) -def similarity_matrix(scale, angle, vector): +def similarity_matrix( + scale: float, + angle: float, + vector: ArrayLike, +) -> NDArray[Any]: """Return homogeneous transformation matrix from similarity parameters. Transformation parameters are: isotropic scale factor, rotation angle @@ -235,8 +280,15 @@ return numpy.dot(T, numpy.dot(R, S)) -def logpolar(image, angles=None, radii=None): +def logpolar( + image: ArrayLike, + /, + *, + angles: int | None = None, + radii: int | None = None, +) -> tuple[NDArray[Any], float]: """Return log-polar transformed image and log base.""" + image = numpy.asanyarray(image) shape = image.shape center = shape[0] / 2, shape[1] / 2 if angles is None: @@ -259,8 +311,8 @@ return output, log_base -def highpass(shape): - """Return highpass filter to be multiplied with fourier transform.""" +def highpass(shape: tuple[int, ...]) -> NDArray[Any]: + """Return highpass filter to be multiplied with Fourier transform.""" x = numpy.outer( numpy.cos(numpy.linspace(-math.pi / 2.0, math.pi / 2.0, shape[0])), numpy.cos(numpy.linspace(-math.pi / 2.0, math.pi / 2.0, shape[1])), @@ -268,22 +320,40 @@ return (1.0 - x) * (2.0 - x) -def imread(fname, norm=True): +def imread( + fname: str | os.PathLike, + /, + *, + norm: bool = True, +) -> NDArray[Any]: """Return image data from img&hdr uint8 files.""" - with open(fname + '.hdr') as fh: + fname = os.fspath(fname) + with open(fname + '.hdr', encoding='utf-8') as fh: hdr = fh.readlines() img = numpy.fromfile(fname + '.img', numpy.uint8, -1) img.shape = int(hdr[4].split()[-1]), int(hdr[3].split()[-1]) if norm: - img = img.astype('float64') - img /= 255.0 + img = img.astype(numpy.float64) + img /= 255.0 # type: ignore return img -def imshow(im0, im1, im2, im3=None, cmap=None, **kwargs): +def imshow( + im0: ArrayLike, + im1: ArrayLike, + im2: ArrayLike, + im3: ArrayLike | None = None, + /, + *, + cmap: str | None = None, + **kwargs, +) -> None: """Plot images using matplotlib.""" from matplotlib import pyplot + im0 = numpy.asanyarray(im0) + im1 = numpy.asanyarray(im1) + im2 = numpy.asanyarray(im2) if im3 is None: im3 = abs(im2 - im0) pyplot.subplot(221) @@ -298,7 +368,6 @@ if __name__ == '__main__': - import os import doctest try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/imreg.egg-info/PKG-INFO new/imreg-2024.1.2/imreg.egg-info/PKG-INFO --- old/imreg-2022.9.27/imreg.egg-info/PKG-INFO 2022-09-27 21:30:35.000000000 +0200 +++ new/imreg-2024.1.2/imreg.egg-info/PKG-INFO 2024-01-02 22:48:21.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: imreg -Version: 2022.9.27 +Version: 2024.1.2 Summary: FFT based image registration Home-page: https://www.cgohlke.com Author: Christoph Gohlke @@ -15,13 +15,15 @@ Classifier: Intended Audience :: Developers Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 -Requires-Python: >=3.7 +Classifier: Programming Language :: Python :: 3.12 +Requires-Python: >=3.9 +Description-Content-Type: text/x-rst License-File: LICENSE +Requires-Dist: numpy +Requires-Dist: scipy FFT based image registration ============================ @@ -31,19 +33,41 @@ :Author: `Christoph Gohlke <https://www.cgohlke.com>`_ :License: BSD 3-Clause -:Version: 2022.9.27 +:Version: 2024.1.2 + +Quickstart +---------- + +Install the imreg package and all dependencies from the +`Python Package Index <https://pypi.org/project/imreg/>`_:: + + python -m pip install -U imreg + +See `Examples`_ for using the programming interface. + +Source code and support are available on +`GitHub <https://github.com/cgohlke/imreg>`_. Requirements ------------ -* `CPython >= 3.7 <https://www.python.org>`_ -* `Numpy 1.15 <https://www.numpy.org>`_ -* `Scipy 1.5 <https://www.scipy.org>`_ -* `Matplotlib 3.3 <https://www.matplotlib.org>`_ (optional for plotting) +This revision was tested with the following requirements and dependencies +(other versions may work): + +- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.7, 3.12.1 +- `NumPy <https://pypi.org/project/numpy/>`_ 1.26.2 +- `Scipy <https://pypi.org/project/scipy>`_ 1.11.4 +- `Matplotlib 3.8.2 <https://pypi.org/project/matplotlib>`_ + (optional for plotting) Revisions --------- +2024.1.2 + +- Add type hints. +- Drop support for Python 3.8 and numpy < 1.23 (NEP29). + 2022.9.27 - Fix scipy.ndimage DeprecationWarning. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/imreg.egg-info/SOURCES.txt new/imreg-2024.1.2/imreg.egg-info/SOURCES.txt --- old/imreg-2022.9.27/imreg.egg-info/SOURCES.txt 2022-09-27 21:30:36.000000000 +0200 +++ new/imreg-2024.1.2/imreg.egg-info/SOURCES.txt 2024-01-02 22:48:21.000000000 +0100 @@ -1,6 +1,7 @@ LICENSE MANIFEST.in README.rst +imreg_example.py setup.py imreg/__init__.py imreg/imreg.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/imreg.egg-info/requires.txt new/imreg-2024.1.2/imreg.egg-info/requires.txt --- old/imreg-2022.9.27/imreg.egg-info/requires.txt 2022-09-27 21:30:35.000000000 +0200 +++ new/imreg-2024.1.2/imreg.egg-info/requires.txt 2024-01-02 22:48:21.000000000 +0100 @@ -1,2 +1,2 @@ -numpy>=1.15.1 -scipy>=1.4 +numpy +scipy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/imreg_example.py new/imreg-2024.1.2/imreg_example.py --- old/imreg-2022.9.27/imreg_example.py 1970-01-01 01:00:00.000000000 +0100 +++ new/imreg-2024.1.2/imreg_example.py 2024-01-02 22:45:22.000000000 +0100 @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# imreg_examples.py + +"""Imreg examples.""" + +import time + +import imreg +import numpy +from matplotlib import pyplot + +if 1: + im0 = imreg.imread('data/t400') + im1 = imreg.imread('data/Tr19s1.3') + +if 0: + im1 = imreg.imread('data/t350380ori') + im0 = imreg.imread('data/t350380shf') + +if 0: + im0 = pyplot.imread('data/im1.png')[..., 0] + im1 = pyplot.imread('data/im2.png')[..., 0] + +if 0: + im0 = pyplot.imread('data/im2.png')[..., 0] + im1 = pyplot.imread('data/temp_1_1.png')[..., 0] + im2 = numpy.zeros_like(im0) + im2[: im1.shape[0], : im1.shape[1]] = im1 + im1 = im2 + +if 0: + im0 = pyplot.imread('data/im2.png')[..., 0] + im1 = pyplot.imread('data/temp_18_23.png')[..., 0] + im2 = numpy.zeros_like(im0) + im2[: im1.shape[0], : im1.shape[1]] = im1 + im1 = im2 + +if 0: + im0 = pyplot.imread('data/1.png')[..., 0] + im1 = pyplot.imread('data/2.png')[..., 0] + im2 = numpy.zeros_like(im1) + im2[: im0.shape[0], : im0.shape[1]] = im0 + im0 = im2 + +if 0: + im0 = pyplot.imread('data/1_.png')[..., 0] + im1 = pyplot.imread('data/2_.png')[..., 0] + +t = time.perf_counter() +if 0: + t0, t1 = imreg.translation(im0, im1) + im2 = imreg.ndii.shift(im1, [t0, t1]) + print(t0, t1) +else: + im2, scale, angle, (t0, t1) = imreg.similarity(im0, im1) + print(t0, t1, scale, angle) +print(time.perf_counter() - t) + +imreg.imshow(im0, im1, im2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imreg-2022.9.27/setup.py new/imreg-2024.1.2/setup.py --- old/imreg-2022.9.27/setup.py 2022-09-27 21:20:28.000000000 +0200 +++ new/imreg-2024.1.2/setup.py 2024-01-02 20:03:08.000000000 +0100 @@ -2,8 +2,8 @@ """Imreg package Setuptools script.""" -import sys import re +import sys from setuptools import setup @@ -16,15 +16,15 @@ return match.groups()[0] -with open('imreg/imreg.py') as fh: +with open('imreg/imreg.py', encoding='utf-8') as fh: code = fh.read() -version = search(r"__version__ = '(.*?)'", code) +version = search(r"__version__ = '(.*?)'", code).replace('.x.x', '.dev0') description = search(r'"""(.*)\.(?:\r\n|\r|\n)', code) readme = search( - r'(?:\r\n|\r|\n){2}"""(.*)"""(?:\r\n|\r|\n){2}[__version__|from]', + r'(?:\r\n|\r|\n){2}"""(.*)"""(?:\r\n|\r|\n){2}from __future__', code, re.MULTILINE | re.DOTALL, ) @@ -42,10 +42,10 @@ license = license.replace('# ', '').replace('#', '') if 'sdist' in sys.argv: - with open('LICENSE', 'w') as fh: + with open('LICENSE', 'w', encoding='utf-8') as fh: fh.write('BSD 3-Clause License\n\n') fh.write(license) - with open('README.rst', 'w') as fh: + with open('README.rst', 'w', encoding='utf-8') as fh: fh.write(readme) setup( @@ -54,6 +54,7 @@ license='BSD', description=description, long_description=readme, + long_description_content_type='text/x-rst', author='Christoph Gohlke', author_email='[email protected]', url='https://www.cgohlke.com', @@ -63,8 +64,8 @@ # 'Documentation': 'https://', }, packages=['imreg'], - python_requires='>=3.7', - install_requires=['numpy>=1.15.1', 'scipy>=1.4'], + python_requires='>=3.9', + install_requires=['numpy', 'scipy'], platforms=['any'], classifiers=[ 'Development Status :: 7 - Inactive', @@ -73,10 +74,9 @@ 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], )
