MaherUPM

Sobel edge detection

Discussion created by MaherUPM on Apr 17, 2014
Latest reply on Apr 17, 2014 by MaherUPM
Hello,
Can anybody tell what is wrong with this:
it works in python window, but when I make it script tool does not work
please help

..............................................

import scipy.ndimage
import numpy,arcpy
import string
import PIL.Image

arcpy.env.overwriteOutput = True

inpRaster=arcpy.GetParameterAsText(0)

desc = arcpy.Describe(inpRaster)
layersource = desc.catalogPath

imageread=scipy.ndimage.imread(layersource)
sobelimage=scipy.ndimage.sobel(imageread,0)

outimage=PIL.Image.fromarray(sobelimage)
Out=outimage.save('D:\Outputs\sobel.jpg')

Outcomes