2

I want to perform supervised classification in Python and in order to perform that I need to have a training sample raster and satellite image. My problem is the training sample raster file has a smaller size (rows X columns) as compared to my satellite image. I have tried to enlarge my training sample size image using PIL but that does not store geo-transformation and other coordinate related information. Is there any other library which performs resizing-increasing the image size to our original satellite image. Here is the code that I have tried-

from PIL import Image

img = Image.open('/your image path/alltraining.tiff')
new_width  = 4125
new_height = 6044
img = img.resize((new_width, new_height), Image.ANTIALIAS)
img.save('output image name.tiff')

enter image description here

satellite image of size- 4125X6144

enter image description here

Training sample of size- 4002X5894

If I try to perform classification with these rasters I get an error of dimensions does not match

0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.