Skip to content
Snippets Groups Projects
Commit 174f64df authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

unpack calibration

parent 164be53b
No related branches found
No related tags found
1 merge request!200python ftl-file v3
Pipeline #17352 passed
This commit is part of merge request !200. Comments created here will be created in the context of that merge request.
...@@ -195,8 +195,9 @@ class FTLStreamReader: ...@@ -195,8 +195,9 @@ class FTLStreamReader:
''' Update calibration. ''' ''' Update calibration. '''
if p.codec == ftl.codec_t.MSGPACK: if p.codec == ftl.codec_t.MSGPACK:
# TODO: What is in (unpacked) p.data[1:]? Contents discarded at the moment # TODO: channel and capabilities should be saved as well
self._calibration[sp.streamID] = ftl.Camera._make(msgpack.unpackb(p.data)[0]) calib, channel, capabilities = msgpack.unpackb(p.data)
self._calibration[sp.streamID] = ftl.Camera._make(calib)
elif p.codec == ftl.codec_t.CALIBRATION: elif p.codec == ftl.codec_t.CALIBRATION:
calibration = struct.unpack("@ddddIIdddd", p.data[:(4*8+2*4+4*8)]) calibration = struct.unpack("@ddddIIdddd", p.data[:(4*8+2*4+4*8)])
...@@ -363,7 +364,7 @@ class FTLStreamReader: ...@@ -363,7 +364,7 @@ class FTLStreamReader:
raise ValueError("source id %i not found" % source) raise ValueError("source id %i not found" % source)
def get_Q(self, source): def get_Q(self, source):
''' Disparity to depth matrix in OpenCV format ''' ''' Disparity to depth matrix (OpenCV) '''
calib = self.get_calibration(source) calib = self.get_calibration(source)
Q = np.identity(4, dtype=np.float64) Q = np.identity(4, dtype=np.float64)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment