@Jarvis73
您好,您的工作很棒。
我有个问题想要请教您,当使用index = pyvips.Image.xyz(width, height)新建一个索引图后,在函数体中设定 height的值为558,width的值为800,再将这张图放到mls_rigid_deformation_inv(image, p, q, alpha=1.0, density=1.0)中,程序会出现如下错误:
Exception in Tkinter callback
Traceback (most recent call last):
File "/home/fl/Python-3.6.4/Lib/tkinter/init.py", line 1699, in call
return self.func(*args)
File "/home/fl/MLS/images/makeindex.py", line 208, in deformPicture
transformed_image = run(mls_rigid_deformation_inv)
File "/home/fl/MLS/images/makeindex.py", line 201, in run
transformed_index = fun_inv(index, p, q, alpha=1, density=1)
File "/home/fl/MLS/images/makeindex.py", line 183, in mls_rigid_deformation_inv
transformed_image = image[tuple(transformers.astype(np.int16))] # [grow, gcol]
File "/home/fl/.local/lib/python3.6/site-packages/pyvips/vimage.py", line 981, in getitem
raise TypeError
TypeError
而这种错误在对图片扭曲的时候是不会发生的,看报错类型应该是格式的问题,而且报错的地方貌似出现在 transformed_image = image[tuple(transformers.astype(np.int16))] # [grow, gcol]这句话上。请问如何优化解决?麻烦您指点一下,不胜感激,谢谢。