自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 OpenCV 图像处理 显示

PIL、 matplotlib 和 OpenCV的存储方式不一样,前两者是( R, G, B ),后者是(B , G, R )因此最好不要用matplotlib (plt)显示OpenCV处理的图像OpenCV显示cv2.imshow(" name", image) #name是显示窗口的名称cv2.waitKey(0) #按键盘时,鼠标要落在显示窗口上cv2.destroyAllWindows()# -*- coding: utf-8 -*-import cv2import n

2021-03-19 17:33:20 154

原创 python 图像处理 PIL库

# -*- coding: utf-8 -*-import osimport numpy as npfrom PIL import Image# 读入图片,默认为RGB顺序,读出的变量img类型为Image类型, size为(width,height),但是为彩色三通道图像img = Image.open("tmp.jpg")#显示图像img.show()#返回图像的格式,'JPG'print(img.format)#返回图像大小,(width,height)print(im

2021-03-19 11:12:39 110

原创 python中numpy.reshape()

>>> import numpy as np>>> x = np.array([[2, 4], [3, 1], [7, 8]])>>> y = x.reshape(3,2) #指定新数组行为3,列为2>>> print(y)[[2 4] [3 1] [7 8]]>>> y = x.reshape(-1,1) #指定新数组列为1>>> print(y)[[2] [4] [3]

2021-03-17 16:02:32 285

原创 python一维二维数组取行取列:,-1应用

import numpy as np>>> a=np.arange(1,6)>>> print(a)[1 2 3 4 5]>>> print(a[-1]) #取最后一个数5>>> print(a[:-1]) #只不取最后一个数[1 2 3 4]>>> print(a[::-1]) #翻转取数[5 4 3 2 1]>>> print(a[2::-1]) #翻转数

2021-03-17 15:22:18 1790

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除