YoshiRi/ImRegPOC

ValueError: too many values to unpack (expected 2)

LS4203 opened this issue · 1 comments

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)

Could you show the shape of ref and cmp?

This algorithm is assuming a gray-scale image.
You can read image as a gray-scale with following representation:

cmp = cv2.imread('video//frames//1.png',0) # read image as gray scale