基本信息
源码名称:python项目小区监控图像拼接系统
源码大小:13.54M
文件格式:.zip
开发语言:Python
更新时间:2024-06-06
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
以python小区监控图像拼接系统的设计和实现为主要的考虑内容,
开发出小区监控拼接系统,就是为了能够让业主或者安保人员能够在同一时间将不同地方的图像进行拼接。
# 定义图像拼接函数 def image_compose(image_colnum, image_size, image_rownum, image_names, image_save_path, x_new, y_new): to_image = Image.new('RGB', (image_colnum * x_new, image_rownum * y_new)) # 创建一个新图 # 循环遍历,把每张图片按顺序粘贴到对应位置上 total_num = 0 for y in range(1, image_rownum 1): for x in range(1, image_colnum 1): from_image = resize_by_width(image_names[image_colnum * (y - 1) x - 1], image_size) # from_image = Image.open(image_names[image_colnum * (y - 1) x - 1]).resize((image_size,image_size ), Image.ANTIALIAS) to_image.paste(from_image, ((x - 1) * x_new, (y - 1) * y_new)) total_num = 1 if total_num == len(image_names): break return to_image.save(image_save_path) # 保存新图 def get_image_list_fullpath(dir_path): file_name_list = os.listdir(dir_path) image_fullpath_list = [] for file_name_one in file_name_list: file_one_path = os.path.join(dir_path, file_name_one) if os.path.isfile(file_one_path): image_fullpath_list.append(file_one_path) else: img_path_list = get_image_list_fullpath(file_one_path) image_fullpath_list.extend(img_path_list) return image_fullpath_list