yoshiri / imregpoc Goto Github PK
View Code? Open in Web Editor NEWFFT based image registration tool for Python and MATLAB
License: Other
FFT based image registration tool for Python and MATLAB
License: Other
Hello Yoshi,
I believe that lines (456-457) in imregpoc.py
:
ref = cv2.imread('../testref1.png',0)
cmp = cv2.imread('../testcmp1.png',0)
should be:
ref = cv2.imread('ref.png',0)
cmp = cv2.imread('cmp.png',0)
In other words, the names of the image files need to be changed, as the ones provided in the code directory have different names than the ones mentioned in the code, and are in the current directory of the code.
Thanks.
Abder
When I execute your readme example
import cv2
import numpy as np
import imregpoc
# read monocular image
ref = cv2.imread('video//frames//0.png')
cmp = cv2.imread('video//frames//1.png')
result = imregpoc.imregpoc(ref,cmp)
result.stitching()
ValueError Traceback (most recent call last)
<ipython-input-11-31c6d193ac86> in <module>
7 cmp = cv2.imread('video//frames//1.png')
8
----> 9 result = imregpoc.imregpoc(ref,cmp)
10 result.stitching()
C:\Anaconda3\envs\LSTM_2\lib\site-packages\imregpoc-1.0-py3.6.egg\imregpoc.py in __init__(self, iref, icmp, threshold, alpha, beta)
32 self.perspective = np.float32([1,0,0,0,1,0,0,0,0]).reshape(3,3)
33
---> 34 self.match()
35
36
C:\Anaconda3\envs\LSTM_2\lib\site-packages\imregpoc-1.0-py3.6.egg\imregpoc.py in match(self)
36
37 def match(self):
---> 38 height,width = self.ref.shape
39 self.hanw = cv2.createHanningWindow((height, width),cv2.CV_64F)
40
ValueError: too many values to unpack (expected 2)
This issue is present in python 3.8 but not in older versions.
I'm guessing python 3.8 is using an older version of your files.
I understand recommended python version is 3.5, but it would be nice if it worked up to the recent python versions.
The algorithm assumes that the width and height are equals.
you need to modify as follows:
self.hanw = cv2.createHanningWindow((width, height),cv2.CV_64F) --> line 40
When I execute your example that you have on read me I get
# read monocular image
ref = cv2.imread('video//frames//0.png')
cmp = cv2.imread('video//frames//1.png')
# initialization (SIFT can be changed to other descriptor)
matcher = imregpoc.TempMatcher(ref,'SIFT')
I get
error: OpenCV(4.2.0) ..\opencv_contrib\modules\xfeatures2d\src\sift.cpp:1210: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SIFT::create'
Hello Yoshi,
Maybe adding a method that ensures that the images are square images would be nice, since the code seems to accept only square images at the moment?
Thanks.
Abder
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.