我用opencvpython得到了一些视频帧,可以将其转换成灰度。在
现在我想做一些类似的事情来计算ssim_多尺度
i1 = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
i2 = cv2.cvtColor(frame2,cv2.COLOR_BGR2GRAY)
i1 = np.array(i1, dtype=np.float64)
i2 = np.array(i2,dtype=np.float64)
print(tf.image.ssim_multiscale(i1,i2,255))
但我有个错误
shape1 = img1.get_shape().with_rank_at_least(3). AttributeError: 'numpy.ndarray' object has no attribute 'get_shape'
我已经检查了np.数组它有get_shape属性。如何将Mat传递到ssim_multiscale参数?在
^{pr2}$
终于找到了答案
如果使用print函数打印ms ssim值,它将显示奇怪的错误
相关问题 更多 >
编程相关推荐