2 Star 27 Fork 12

css/HappyFightOpencv

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Poker.py 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
css 提交于 2021-03-05 16:50 +08:00 . 初始化
#!/usr/bin/python
# coding:utf-8
"""
@author: css
@software: PyCharm
@file: Poker.py
@time: 2021/3/3 16:45:02
"""
import cv2
class Poker:
'所有员工的基类'
def __init__(self, name, img, num=4):
self.num = num
self.name = name
h, w = img.shape
# 手牌
self.selfImg = img
self.isUpOut = False
self.isDownOut = False
# 出牌
if name == '王':
self.otherImg = cv2.resize(img, (int(w / 1.8), int(h / 1.8)))
# 底牌
self.handImg = cv2.resize(img, (int(w / 4.1), int(h / 4.1)))
elif name == '8' or name == '9':
self.otherImg = cv2.resize(img, (int(w / 1.3), int(h / 1.3)))
# 底牌
self.handImg = cv2.resize(img, (int(w / 1.9), int(h / 1.9)))
else:
self.otherImg = cv2.resize(img, (int(w / 1.3), int(h / 1.3)))
# 底牌
self.handImg = cv2.resize(img, (int(w / 1.8), int(h / 1.8)))
def setNum(self, num):
self.num = num
def init(self):
if self.name == '王':
self.num = 2
else:
self.num = 4
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/css_code/happy-fight-opencv.git
git@gitee.com:css_code/happy-fight-opencv.git
css_code
happy-fight-opencv
HappyFightOpencv
master

搜索帮助