Skip to content

Commit

Permalink
改进验证码
Browse files Browse the repository at this point in the history
  • Loading branch information
luyishisi committed Jan 12, 2017
1 parent 8e93024 commit 2a53ae8
Show file tree
Hide file tree
Showing 15 changed files with 11 additions and 7 deletions.
Binary file modified 1.验证码/num副本/L.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219502.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219536.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219553.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219554.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219726.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219763.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219780.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219781.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219794.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219795.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219822.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1.验证码/num副本/cat/1484219894.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions 1.验证码/num副本/recognise.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def magnitude(self,concordance):
else:
total += count ** 2
except Exception,e:
print type(total),total,type(count),count
#print type(total),total,type(count),count
print e
return math.sqrt(total)

Expand All @@ -89,9 +89,13 @@ def relation(self,concordance1, concordance2):
topvalue = 0
for word, count in concordance1.items():
if word in concordance2:
print type(topvalue),topvalue,count,concordance2[word]
time.sleep(1)
topvalue += count * concordance2[word][0]
#print type(topvalue),topvalue,count,concordance2[word]
#time.sleep(1)
if(type(concordance2[word]) == type(())):
topvalue += count * concordance2[word][0]
#print type(total),total,type(count),count ** 2
else:
topvalue += count * concordance2[word]
#time.sleep(10)
return topvalue / (self.magnitude(concordance1) * self.magnitude(concordance2))

Expand Down Expand Up @@ -127,7 +131,7 @@ def recognise(self,image):
name = os.path.join(root,file)
name_list.append(name)

print name_list
#print name_list
for i in name_list:
#name = '11'
name = i
Expand All @@ -137,8 +141,8 @@ def recognise(self,image):
# 设置图片路径
image=Image.open(name)
#image=Image.open('./temp/2.png')
print image.mode
#print image.mode
result=imageRecognize.recognise(image)
string=[''.join(item[1]) for item in result]
print(string)
break
#break
Binary file removed 1.验证码/num副本/temp/1.png
Binary file not shown.

0 comments on commit 2a53ae8

Please sign in to comment.