• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Similarity between integers in a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Similarity between integers in a list
      • From: Martin Orpen <email@hidden>
References: 
 >Similarity between integers in a list (From: Martin Orpen <email@hidden>)
 >Re: Similarity between integers in a list (From: BJ Terry <email@hidden>)

  • Prev by Date: Running an FM script with an AppleScript
  • Next by Date: Re: Printing a table
  • Previous by thread: Re: Similarity between integers in a list
  • Next by thread: Re: Similarity between integers in a list
  • Index(es):
    • Date
    • Thread