메소드 | 설명 | |
---|---|---|
Array2String ( int array, bool flag ) : string | ||
Binary ( |
二值化处理
|
|
CalcRate ( string t1, string t2 ) : int |
计算相似度
|
|
ComputeThresholdValue ( |
||
ConvertImgToArrayX ( Image img ) : ].int[ | ||
ConvertImgToArrayY ( Image img ) : ].int[ | ||
CutImage ( int RowNum, int ColNum, |
图片切割
|
|
CutImage ( Image img, int ww, int hh, bool is4Chars = true, int charWidth = 10 ) : List |
字符数目是四个,有切割后不是4个的话会做进一步处理
|
|
GetArrayX ( int input, int y ) : int[] | ||
GetArrayY ( int input, int x ) : int[] | ||
GetBinaryCode ( |
获取图片特征码
|
|
GetDgGrayValue ( Image img ) : int |
得到灰度图像前景背景的临界值 最大类间方差法
|
|
GetImgBoundaryList ( Image img, |
确定是四字符会有精细处理
|
|
GetPicValidByValue ( |
对切割后小图操作
|
|
GetPicValidByValue ( int dgGrayValue, |
获取有效区域
|
|
GetStartBoundaryY ( Image img, int start ) : int |
Y轴开始的边界
|
|
GetXBeyond ( int input ) : Point | ||
GetYBeyond ( int input ) : Point | ||
GetYZMCode ( Image img, string zimoPath, int charNum ) : string |
验证码识别
|
|
GetYZMCode ( Image img, string zimoPath, int maxNearPoints, int smallPicWidth, int smallPicHeight, int type = 2, bool is4Chars = true, int charWidth = 10 ) : string |
识别验证码(图片-->字符)
|
|
Gray ( |
图片灰度化处理指针法
|
|
Normalized ( |
把图片的宽高统一,归一
|
|
PBinary ( |
二值化处理
|
|
PreProcess ( Image img, int maxNearPoints, int smallPicWidth, int smallPicHeight, int type = 2, bool is4Chars = true, int charWidth = 10 ) : List |
验证码的前期处理
|
|
RemoveBg ( |
去除背景
|
|
RemoveNoise ( |
去除噪点
|
|
TrimBmp ( Image img ) : |
||
WriteZimo ( |
字模库维护
|
메소드 | 설명 | |
---|---|---|
GetEndBoundaryX ( Image img, int startX, int startY, int endY ) : int |
获得X轴结束边界
|
|
GetEndBoundaryY ( Image img, int start ) : int |
Y轴结束的边界
|
|
GetGrayValueByMax ( int r, int g, int b ) : int | ||
GetGrayValueByPingjunzhi ( int r, int g, int b ) : int | ||
GetGrayValueByQuanzhong ( int b, int g, int r ) : int | ||
GetStartBoundaryX ( Image img, int startY, int endY ) : int |
X轴开始的边界
|
|
NotFourChars ( Image img, |
对第一次切割后不是4张小图的做处理
|
public static Array2String ( int array, bool flag ) : string | ||
array | int | |
flag | bool | |
리턴 | string |
public static Binary ( |
||
img | ||
리턴 |
public static CalcRate ( string t1, string t2 ) : int | ||
t1 | string | |
t2 | string | |
리턴 | int |
public static ComputeThresholdValue ( |
||
img | ||
리턴 | int |
public static ConvertImgToArrayX ( Image img ) : ].int[ | ||
img | Image | |
리턴 | ].int[ |
public static ConvertImgToArrayY ( Image img ) : ].int[ | ||
img | Image | |
리턴 | ].int[ |
public static CutImage ( int RowNum, int ColNum, |
||
RowNum | int | |
ColNum | int | |
bm | ||
리턴 | System.Drawing.Bitmap[] |
public static CutImage ( Image img, int ww, int hh, bool is4Chars = true, int charWidth = 10 ) : List |
||
img | Image | |
ww | int | |
hh | int | |
is4Chars | bool | 是否是4个字 |
charWidth | int | |
리턴 | List |
public static GetArrayX ( int input, int y ) : int[] | ||
input | int | |
y | int | |
리턴 | int[] |
public static GetArrayY ( int input, int x ) : int[] | ||
input | int | |
x | int | |
리턴 | int[] |
public static GetBinaryCode ( |
||
img | ||
리턴 | string |
public static GetImgBoundaryList ( Image img, |
||
img | Image | |
_bmp | ||
is4Chars | bool | |
charWidth | int | |
리턴 | List |
public static GetPicValidByValue ( |
||
singlepic | ||
dgGrayValue | int | |
리턴 |
public static GetPicValidByValue ( int dgGrayValue, |
||
dgGrayValue | int | 灰度值 |
bm | 图片对象 | |
리턴 |
public static GetStartBoundaryY ( Image img, int start ) : int | ||
img | Image | |
start | int | |
리턴 | int |
public static GetYZMCode ( Image img, string zimoPath, int charNum ) : string | ||
img | Image | 验证码 |
zimoPath | string | 字模位置 |
charNum | int | 验证码字符个数 |
리턴 | string |
public static GetYZMCode ( Image img, string zimoPath, int maxNearPoints, int smallPicWidth, int smallPicHeight, int type = 2, bool is4Chars = true, int charWidth = 10 ) : string | ||
img | Image | 验证码图片 |
zimoPath | string | 字模数据库 |
maxNearPoints | int | 噪点最大粘连数目 |
smallPicWidth | int | 切分小图宽度 |
smallPicHeight | int | 切分小图高度 |
type | int | |
is4Chars | bool | |
charWidth | int | |
리턴 | string |
public static Gray ( |
||
img | 待处理图片 | |
type | int | 1:最大值;2:平均值;3:加权平均;默认平均值 |
리턴 | Image |
public static Normalized ( |
||
bitmap | 需要处理的图片 | |
ww | int | |
hh | int | |
리턴 |
public static PBinary ( |
||
src | ||
v | int | 二值化阈值 |
리턴 |
public static PreProcess ( Image img, int maxNearPoints, int smallPicWidth, int smallPicHeight, int type = 2, bool is4Chars = true, int charWidth = 10 ) : List |
||
img | Image | 验证码图片 |
maxNearPoints | int | 噪点最大粘连数目 |
smallPicWidth | int | 切分小图宽度 |
smallPicHeight | int | 切分小图高度 |
type | int | 灰度处理方式1:最大值2:平均值3:加权平均 |
is4Chars | bool | |
charWidth | int | |
리턴 | List |
public static RemoveBg ( |
||
img | 原图片 | |
dgGrayValue | int | 前景背景分界灰度值 |
리턴 | Image |
public static RemoveNoise ( |
||
img | 图片 | |
maxAroundPoints | int | 噪点的最大粘连数 |
리턴 | Image |
public static TrimBmp ( Image img ) : |
||
img | Image | |
리턴 |
public static WriteZimo ( |
||
smallPic | 小图片 | |
zimoPath | string | 字模路径 |
YZMCode | string | 验证码字符 |
리턴 | void |