Skip to content

Using matplotlib with python bindings #1365

Answered by SamFlt
sp7412 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Indeed, ViSP displays do not update the image directly: they store a buffer which contains the displayed image as well as the render overlay (the pose frame in your example)

To combine ViSP plots with matplotlib, you can use something like:

from visp.core import Display, ImageRGBa, RGBa, HomogeneousMatrix, CameraParameters, Color
import numpy as np
try:
  from visp.gui import DisplayX
  DisplayCls = DisplayX
except ImportError:
  from visp.gui import DisplayOpenCV
  DisplayCls = DisplayOpenCV

import matplotlib.pyplot as plt

# black image
I = ImageRGBa(240, 320, RGBa(0, 0, 0, 255))
d = DisplayCls()
d.init(I, win_x=0, win_y=0, win_title='ViSP display')
cTo = HomogeneousMatrix(0, 0.1, …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@sp7412
Comment options

Comment options

You must be logged in to vote
3 replies
@sp7412
Comment options

@SamFlt
Comment options

@sp7412
Comment options

Answer selected by sp7412
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants