Fixing some errors.
This commit is contained in:
18
swig/spt.i
18
swig/spt.i
@ -49,3 +49,21 @@ namespace std {
|
||||
// Parse the header file to generate wrappers
|
||||
%include "../spt/camera.hpp"
|
||||
%include "../spt/interface.hpp"
|
||||
|
||||
// Add additional Python code to the module
|
||||
%pythoncode %{
|
||||
def convert_cameras(cameras):
|
||||
"""Convert cameras from Python to C++."""
|
||||
c_cameras = []
|
||||
for cam in cameras:
|
||||
camera = Camera()
|
||||
camera.name = cam["name"]
|
||||
camera.K = cam["K"]
|
||||
camera.DC = cam["DC"]
|
||||
camera.R = cam["R"]
|
||||
camera.T = cam["T"]
|
||||
camera.width = cam["width"]
|
||||
camera.height = cam["height"]
|
||||
c_cameras.append(camera)
|
||||
return c_cameras
|
||||
%}
|
||||
|
||||
Reference in New Issue
Block a user