2つの画像が類似しているかどうかを判定するAppleScriptです。
CocoaImageHashing.framework (To ~/Library/Frameworks/)
AppleScript名:2つの画像が類似しているかを判定 |
— Created 2016-10-30 by Takaaki Naganoya — 2016 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "CocoaImageHashing" –https://github.com/ameingast/cocoaimagehashing –From Example: "Comparing two images for similarity" set aFile to POSIX path of (choose file {"public.image"}) set bFile to POSIX path of (choose file {"public.image"}) set aRes to checkSimiliality(aFile, bFile) of me –> true / false on checkSimiliality(aFile, bFile) set aURL to current application’s |NSURL|’s fileURLWithPath:aFile set bURL to current application’s |NSURL|’s fileURLWithPath:bFile set aData to current application’s NSData’s dataWithContentsOfURL:aURL set bData to current application’s NSData’s dataWithContentsOfURL:bURL set aRes to (current application’s OSImageHashing’s sharedInstance()’s compareImageData:aData |to|:bData) as boolean return aRes end checkSimiliality |
More from my site
(Visited 75 times, 1 visits today)
Keynoteで選択中の画像を特定する – AppleScriptの穴 says:
[…] まずは、サイズで比較を行い、同一のものがあれば画像同士の類似性を計算するといった方法も使えそうです。 […]
M1 Mac mini – AppleScriptの穴 says:
[…] 2つの画像が類似しているかを判定 […]