secretitem.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:ArkwoodAR 作者: rdmilligan 项目源码 文件源码
def detect(self, image):

        # convert image to grayscale
        image_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

        # apply template matching
        result = cv2.matchTemplate(image_gray, self.template, cv2.TM_CCOEFF_NORMED)

        # obtain locations, where threshold met
        locations = np.where(result >= self.THRESHOLD)

        for item in locations:
            if len(item) == 0:
                return None

        return locations
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号