Re: Similarity between integers in a list
Re: Similarity between integers in a list
- Subject: Re: Similarity between integers in a list
- From: BJ Terry <email@hidden>
- Date: Tue, 18 May 2004 23:25:38 -0700
Sorry, didn't realize at first that the abs operator is from satimage's
osax. You could use a handler like this to replace it:
on abs(val)
if (val < 0)
return -val
else
return val
end
end
On May 18, 2004, at 7:04 PM, BJ Terry wrote:
on neutralp(pixelList)
set totalDiff to 0
repeat with x from 1 to count pixelList
set currentPixel to item x of pixelList
set diff to abs ((item 1 of currentPixel) - (item 2 of currentPixel))
set diff to diff + (abs ((item 1 of currentPixel) - (item 3 of
currentPixel)))
set diff to diff + (abs ((item 2 of currentPixel) - (item 3 of
currentPixel)))
set totalDiff to totalDiff + diff
end repeat
return (totalDiff / (count pixelList)) < imageThreshold
end neutralp
neutralp(image1)
BJ
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.