我正在使用一个空间光调制器(SLM),它被连接成第二个蒙比特器。SLM具有tzo接收8位灰度图像。 我目前正在与vispy合作,在SLM上显示图像,但如果显示正确的话,我不支持shore。 有没有可能用vispy在灰度上显示图像?在
我用这个代码显示图像
import sys
from vispy import scene
from vispy import app
import numpy as np
canvas = scene.SceneCanvas(keys='interactive')
canvas.size = 800, 600
canvas.show()
# Set up a viewbox to display the image with interactive pan/zoom
view = canvas.central_widget.add_view()
# Create the image
img_data = *my image*
image = scene.visuals.Image(img_data, parent=view.scene)
# Set 2D camera (the camera will scale to the contents in the scene)
view.camera = scene.PanZoomCamera(aspect=1)
if __name__ == '__main__' and sys.flags.interactive == 0:
app.run()
来自http://vispy.readthedocs.io/en/stable/examples/basics/scene/image.html
谢谢你的帮助,很抱歉英语不好
您可以将图片从RGB转换为灰色(请参见this post),然后使用“grays”颜色映射。在
相关问题 更多 >
编程相关推荐