In [2]:
%matplotlib qt
In [3]:
import numpy as np
from menpo.rasterize import GLRasterizer
import matplotlib.pyplot as plt
import menpo.io as pio
RENDERING A FACE
In [4]:
mesh = pio.import_mesh('/vol/hci2/Databases/video/BU-3DFE/F0001/F0001_AN01WH_F3D.wrl')
In [5]:
%matplotlib qt
viewer = mesh.view()
In [6]:
viewer_settings = viewer.renderer_settings
In [7]:
viewer_settings
Out[7]:
In [8]:
# build a rasterizer configured from the current view
r = GLRasterizer(**viewer_settings)
In [17]:
# rasterize to produce an RGB and shape image
rgb_img, shape_img = r.rasterize_mesh_with_f3v_interpolant(mesh, per_vertex_f3v=np.random.randn(mesh.n_points,3))
In [18]:
%matplotlib inline
rgb_img.view()
shape_img.view_new()
Out[18]:
In [14]:
rgb_img.mask.view()
Out[14]:
In [ ]: