Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -318,7 +318,7 @@ INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (14, '2024_04_15_14
|
||||
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (15, '2024_04_15_143134_create_cards_table', 1);
|
||||
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (16, '2024_04_16_084221_create_vip_logs_table', 1);
|
||||
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (17, '2024_05_08_101122_create_material_categories_table', 1);
|
||||
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (17, '2025_01_08_011255_create_versions_table', 1);
|
||||
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (18, '2025_01_08_011255_create_versions_table', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
## install
|
||||
|
||||
```bash
|
||||
pip3 install opencv-contrib-python
|
||||
```
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import cv2
|
||||
import sys
|
||||
from cv2.wechat_qrcode import WeChatQRCode
|
||||
|
||||
|
||||
def qr(new_width, new_height, mode):
|
||||
resized = cv2.resize(image, (new_width, new_height), interpolation=cv2.INTER_CUBIC)
|
||||
gray = cv2.cvtColor(resized, mode) # cv2.COLOR_RGB2GRAY
|
||||
detect_obj = WeChatQRCode()
|
||||
results, _ = detect_obj.detectAndDecode(gray)
|
||||
|
||||
if len(results) < 1:
|
||||
return ""
|
||||
|
||||
return results[0]
|
||||
|
||||
|
||||
try:
|
||||
image = cv2.imread(sys.argv[1])
|
||||
# 放大multiple倍,转灰度
|
||||
img_size = image.shape
|
||||
new_width = 2000
|
||||
new_height = int(img_size[0] * (new_width / img_size[1]))
|
||||
results = qr(new_width, new_height, cv2.COLOR_RGB2GRAY)
|
||||
if results == "":
|
||||
results = qr(new_width, new_height, cv2.COLOR_RGB2HSV)
|
||||
print(results)
|
||||
sys.exit(0)
|
||||
print(results)
|
||||
sys.exit(0)
|
||||
except Exception as e: # 捕获具体异常
|
||||
print(f"Error occurred: {str(e)}")
|
||||
sys.exit(1)
|
||||
Reference in New Issue
Block a user