def reconstruct(self, ratio, method_type): """Reconstruct a SR image by the given SR method. @param ratio: reconstruct ratio @type ratio: float @param method_type: SR method type @type method_type: str @return: reconstructed SR image @rtype: L{sr_image.SRImage} """ sr_method = SRMethodFactory.create_method(method_type) return sr_method.reconstruct(ratio, self)
def test_create_sr_method(self): sr_method = SRMethodFactory.create_method("iccv09") self.assertEqual("iccv09", sr_method.get_method_type()) with self.assertRaises(SRException): SRMethodFactory.create_method("invalid method type")