调用Python的标准图像库里show()函数,有可能无法显示图片.因为他调用了xv,但xv在后面的ubuntu版本中xv都不装了.
sudo apt-get install imagemagick
安装完成后记得重新启动控制台.
在另一个Python函数的过程中,你可以去根据它的里面的函数定义域,如果没有定义的话,那么你可以先假设一个定义域,然后在求解的过程中就可以了.
Image.show()函数是这个样子的,必须先关了图片程序才往下走.
例如: imshow(~BW)
扩展资料:
不使用show函数来满足运行的需求:
import threading
import Image
class ThreadClass(threading.Thread):
def run(self):
im=Image.open('z.jpg')
im.show()
print (1)
t = ThreadClass()
t.start()
a=input('End')
#===============================
图像的表示原理:
最基本的物理图像是根据矩形网格抽样原理从连续图像域中抽取二维灰度阵列(矩阵)得到的.也可以用长向量表示二维灰度矩阵,它是按列(或行)扫描灰度矩阵,把下一列(或行)的头和前一列(或行)的尾相接而成.
它们的线性可逆变换同样可以用来表示图像.图像的每一行由行程(具有同一灰度的邻近像元集合)序列所组成,所以呢也可以用行程长度编码(见图像编码)表示图像.
I've done like this in the past, and i can tell it works. assuming your button is called "Button"
class Main(QtGui.QMainWindow):
''' some stuff '''
def on_Button_clicked(self, checked=None):
if checked==None: return
dialog = QDialog()
dialog.ui = Ui_MyDialog()
dialog.ui.setupUi(dialog)
dialog.setAttribute(QtCore.Qt.WA_DeleteOnClose)
dialog.exec_()
This works for my application, and I believe it should work with yours as well. hope it'll help, it should be pretty straight forward to do the few changes needed to apply it to your case. have a good day everybody.
以上就是土嘎嘎小编为大家整理的python函数show相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!