Closed KangchengLiu closed 4 years ago
You have to change:
https://github.com/PRBonn/semantic-kitti-api/blob/69c51072f064c85627fc97f63a10e34cfb30baa1/auxiliary/laserscanvis.py#L38
and add the keyword argument bgcolor='white'
(see here in the vispy documentation))
For saving an image, one can use the render
method of the Canvas
to generate a numpy array (see vispy documentation). Using PIL, you should be able to save it as PNG. Something along the lines:
from PIL import Image
...
img_numpy = vis.canvas.render()
img = Image.fromarray(img_numpy)
img.save("scan.png")
See also the Pillow documentation for more information.
issue seems to be resolved. Reopen if you need further assistance.
Hi, I got 2 questions for visualization.
First, how to close the rendering of vispy? In the scan visualization interface, I find that the color of the point will change under the different perspective.
Second, I find that the way to save images which is provided in vispy cannot save high quality images. I tried two ways:
img_numpy = vis.canvas.render()
img = Image.fromarray(img_numpy)
img.save("scan.png")
and
from vispy.gloo.util import _screenshot
from matplotlib import pyplot as plt
img_numpy = _screenshot()
plt.imshow(img_numpy)
plt.savefig("scan.png", dpi=600)
But the saved images are both not clear enough. @jbehley
Hi, I got 2 questions for visualization.
First, how to close the rendering of vispy? In the scan visualization interface, I find that the color of the point will change under the different perspective.
Second, I find that the way to save images which is provided in vispy cannot save high quality images. I tried two ways:
img_numpy = vis.canvas.render()
img = Image.fromarray(img_numpy)
img.save("scan.png")
andfrom vispy.gloo.util import _screenshot
from matplotlib import pyplot as plt
img_numpy = _screenshot()
plt.imshow(img_numpy)
plt.savefig("scan.png", dpi=600)
But the saved images are both not clear enough. @jbehley
Hello, have you dealt with it?
How to save the visualization results as PNG files in the visualization of semantic-KITTI?