Hello all,
I'm trying to render an image of a point cloud seen from a pose, with certain intrinsics. However, I'm getting an image of zero width and height. I already loaded successfully the point cloud and also created a mesh for it. What am I doing wrong? Here's the code I'm using:
# running on GUI's console
# point cloud already imported into chunk1
doc = Metashape.app.document
chunks = doc.chunks
my_chunk = chunks[0]
sz = my_chunk.region.size
sz_new = sz
sz_new[0] = 20
sz_new[1] = 20
sz_new[2] = 20
my_chunk.region.size = sz_new
# create mesh via GUI
# point cloud is contained in: my_chunk.dense_cloud
# identity pose
my_pose = Metashape.Matrix( [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] )
my_calib = Metashape.Calibration()
my_calib.f = 1000
my_calib.cx = 500
my_calib.cy = 500
# my_calib.b1 = 0
# my_calib.b2 = 0
my_calib.k1 = 0
my_calib.k2 = 0
my_calib.k3 = 0
my_calib.k4 = 0
# my_calib.p1 = 0
# my_calib.p2 = 0
my_calib.width = 1000
my_calib.height = 1000
# my_calib.type = Metashape.Sensor.Type.Frame
img = my_chunk.model.renderImage(my_pose, my_calib)
print(img.width, img.height)
# This last statement returns 0, 0!!
Thanks for any help,
~ Dan