Comment detail
モノクロ画像の類似検索 (Nested Flatten)This comment is reply for 1763 sumim: Squeak Smalltalk で。0...(モノクロ画像の類似検索). Go to thread root.
参考まで、#deltaForm: の中身はビット列の XOR で、#primCountBits の中身は popCount です。いずれも、Smalltalk システム(暫定ダイナブック環境、あるいは ALTO コンピュータ)発祥ということでよく知られている BitBlt という機構が下請けています。http://ja.wikipedia.org/wiki/Bitblt





sumim
#1765()
[
Smalltalk
]
Rating2/2=1.00
| indexOfRef refImage numOfImgs images | indexOfRef := 1. numOfImgs := 100. images := (1 to: numOfImgs) collect: [:idx | | name file | name := (idx printPaddedWith: $0 to: 3), '.png'. file := FileStream fileNamed: name. file binary. (PNGReadWriter createAFormFrom: file contentsOfEntireFile) first]. refImage := images at: indexOfRef. ((1 to: numOfImgs) copyWithout: indexOfRef) detectMin: [:idx | (refImage deltaFrom: (images at: idx)) primCountBits]Rating2/2=1.00-0+