图片识别库

基于opencv封装

Created on 2014-12-15 @author: LiWei

class nd.rest.image.ImageRecognize.ImageRecognize

Image.resize can not satisfy me ,have to change another way.

static imageComparison(templatePath, sourcePath, targetPath, defaultAccurate=0.5, defaultMethod='cv2.TM_CCOEFF_NORMED')
Parameters:
  • templatePath
  • sourcePath
  • targetPath
  • defaultAccurate – 匹配精确度
  • defaultMethod
Returns:

static proxy(templatePath, sourcePath, targetPath, srcX=720, srcY=1280, orientation=0, defaultAccurate=0.5)
Parameters:
  • templatePath
  • sourcePath – 原图片
  • targetPath
  • srcX
  • srcY
  • orientation
  • defaultAccurate
Returns:

.code-block:: python

>>> reco = ImageRecognize()

# 进行图像比较,并返回比较结果 >>> reco.imageComparison()

static uniteResolution(sourcePath, srcX=720, srcY=1280, orientation='', format='png')
Parameters:
  • sourcePath
  • srcX
  • srcY
  • orientation
  • format
Returns: