python读取图片的几种方式及图像宽和高的存储顺序-创新互联

1、opencv
2、imageio
3、matplotlib
4、scipy

我们提供的服务有:成都做网站、网站建设、外贸营销网站建设、微信公众号开发、网站优化、网站认证、横县ssl等。为上1000家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的横县网站制作公司
# coding:utf-8
import cv2
import imageio
from scipy import misc
from PIL import Image
from matplotlib import pyplot as plt
image_path = "./images/000011.jpg"
# 使用pillow读取图片,获取图片的宽和高
img_pillow = Image.open(image_path)
img_width = img_pillow.width # 图片宽度
img_height = img_pillow.height # 图片高度
print("width -> {}, height -> {}".format(img_width, img_height))
img_cv = cv2.imread(image_path)
img_imageio = imageio.imread(image_path)
img_scipy = misc.imread(image_path)
img_matplot = plt.imread(image_path)
print(img_cv.shape)
print(img_imageio.shape)
print(img_scipy.shape)
print(img_matplot.shape)

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网站标题:python读取图片的几种方式及图像宽和高的存储顺序-创新互联
文章地址:http://bzwzjz.com/article/dicdce.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站制作 成都做网站建设公司 营销网站建设 成都网站建设 高端网站建设 成都网站建设公司 专业网站设计 LED网站设计方案 成都定制网站建设 成都网站建设 网站设计 做网站设计 成都网站建设 成都响应式网站建设 重庆电商网站建设 网站制作 网站制作 成都网站建设 H5网站制作 成都h5网站建设 响应式网站设计 重庆网站建设