Import libraries


In [10]:
import otbApplication
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

Prepare and run application


In [16]:
file='obrazek.tiff'
Rescale = otbApplication.Registry.CreateApplication("Rescale")
Rescale.SetParameterString("in", file)
Rescale.SetParameterString("out", "rescaledImage.png")
Rescale.SetParameterOutputImagePixelType("out", 1)
Rescale.SetParameterFloat("outmin", 1)
Rescale.SetParameterFloat("outmax", 255)
Rescale.ExecuteAndWriteOutput()


Out[16]:
0

Plot results


In [17]:
image = mpimg.imread("rescaledImage.png")
plt.imshow(image)
plt.show()



In [ ]: