<commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author:  hzsunshx
# Created: 2015-03-23 14:42

"""
sift
"""

import aircv as ac

def sift_test():
    t1 = ac.imread("testdata/1s.png")
    t2 = ac.imread("testdata/1s-rotate.png")
    print ac.sift_count(t1), ac.sift_count(t2)

    print ac.find_sift(t1, t2, min_match_count=ac.sift_count(t1)*0.4) # after many tests, 0.4 may be best

if __name__ == '__main__':
    sift_test()
<commit_msg>update example<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author:  hzsunshx
# Created: 2015-03-23 14:42

"""
sift
"""

import aircv as ac

def sift_test():
    t1 = ac.imread("testdata/1s.png")
    t2 = ac.imread("testdata/1s-rotate.png")
    print ac.sift_count(t1), ac.sift_count(t2)

    result = ac.find_sift(t1, t2, min_match_count=ac.sift_count(t1)*0.4) # after many tests, 0.4 may be best
    if result:
        print 'Same'
    else:
        print 'Not same'

if __name__ == '__main__':
    sift_test()

{'fraction_non_alphanumeric': 0.16683518705763398, 'fraction_numerical': 0.0525783619817998, 'mean_word_length': 3.2127659574468086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7163610', 'n_tokens_mistral': 449, 'n_tokens_neox': 428, 'n_words': 87}