Commit c5b35950 by 杨林龙

提交修改

1 parent 478e563b
......@@ -3,3 +3,24 @@
/target
/*.iml
__pycache__/test.cpython-39.pyc
Identify_sn/train/threecode/*
Identify_vinandsn/image/*
Identify_vinandsn/train/threecode/*
Identify_vinandsn/ch_ppocr_mobile_v2.0_cls_infer/*
Identify_vinandsn/ch_ppocr_mobile_v3.0_cls_infer/*
Identify_vinandsn/ch_ppocr_mobile_v4.0_cls_infer/*
Identify_vinandsn/ch_ppocr_server_v2.0_det_infer/*
Identify_vinandsn/ch_ppocr_server_v2.0_rec_infer/*
Identify_vinandsn/ch_ppocr_server_v3.0_det_infer/*
Identify_vinandsn/ch_ppocr_server_v3.0_rec_infer/*
Identify_vinandsn/ch_ppocr_server_v4.0_det_infer/*
Identify_vinandsn/ch_ppocr_server_v4.0_rec_infer/*
Identify_vinandsn/*.txt
Identify_sn/ch_ppocr_mobile_v4.0_cls_infer/*
Identify_sn/ch_ppocr_server_v4.0_det_infer/*
Identify_sn/ch_ppocr_server_v4.0_rec_infer/*
Identify_sn/*.txt
flaskr/__pycache__/__init__.cpython-310.pyc
flaskr/biz/__pycache__/identify_service.cpython-310.pyc
flaskr/biz/__pycache__/user_service.cpython-310.pyc
flaskr/model/__pycache__/interactive_user.cpython-310.pyc
a.jpg

24.4 KB

......@@ -7,7 +7,8 @@ producer = KafkaProducer(bootstrap_servers="192.168.3.131:9092") # Kafka集群
topic = "my-yang-topic" # Kafka主题名称
key = b"my-key" # 消息的键(可选)
value = b"my-value" # 消息的值
producer.send(topic, key=key, value=value)
for item in range(10):
producer.send(topic, key=key, value=value)
# 等待所有消息发送完成
producer.flush()
......
output.jpg

737 KB

No preview for this file type
import cv2
# 读取图像
image = cv2.imread("./Identify_vinandsn/output.jpg")
# 逆时针旋转90度
# rotated_image = cv2.transpose(image)
# rotated_image = cv2.flip(rotated_image, 0)
# 旋转180度
rotated_image = cv2.flip(image, -1)
# 显示旋转后的图像
cv2.imshow('Rotated Image', rotated_image)
# 保存图像
cv2.imwrite('output.jpg', rotated_image)
cv2.waitKey(0)
cv2.destroyAllWindows()
from PIL import Image
from PIL import ImageEnhance
# 打开图像文件
image = Image.open("./Identify_vinandsn/output.jpg")
# 创建对比度增强器
enhancer = ImageEnhance.Contrast(image)
# 增强对比度(将对比度增强为原来的2倍)
factor = 2.0
enhanced_image = enhancer.enhance(factor)
# 保存增强后的图像
enhanced_image.save("enhanced_image.jpg")
from PIL import Image
# 使用 Image.open() 打开图像文件
image = Image.open("./wKgFDWWCYl-AUkQ8AAYswLlsPlA225.jpg")
print(image.mode)
# 将图像转换为具有三个通道的图像对象
image_rgb = image.convert("RGB")
image_rgb.save("a.jpg")
# 打印转换后的图像对象的模式
print(image_rgb.mode)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!