def makeFrameTransform(region, binning): """Make a transform that maps from image coordinates to whole-sensor coordinates, given the region-of-interest and binning used to acquire the image.""" tr = SRTTransform3D() tr.translate(*region[:2]) tr.scale(binning[0], binning[1], 1) return tr
def __init__(self, data, info): object.__init__(self) self._data = data self._info = info ## Complete transform maps from image coordinates to global. if 'transform' not in info: info['transform'] = SRTTransform3D(self.deviceTransform() * self.frameTransform())
def globalTransform(self): """Return the transform that maps this frame's image coordinates to global coordinates. This is equivalent to (deviceTransform * frameTransform). """ return SRTTransform3D(self._info['transform'])
def frameTransform(self): """Return the transform that maps from this frame's image coordinates to its imager device coordinates. This transform takes into account the camera's region and binning settings. """ return SRTTransform3D(self._info['frameTransform'])
def deviceTransform(self): """Return the transform that maps from imager device coordinates to global.""" return SRTTransform3D(self._info['deviceTransform'])