opencv
龚慧林
积极、乐观、努力
展开
-
python读取图片并且显示
使用python-opencv读取图片,利用opencv或matplotlib显示图片。# -*- coding: utf-8 -*-import numpy as npfrom matplotlib import pyplot as plt#import urllibimport cv2def load_image1(file): # Load an color image...原创 2019-09-30 12:03:22 · 847 阅读 · 0 评论 -
Python OpenCV version
#!/usr/bin/env python'''prints OpenCV versionUsage: opencv_version.py [<params>] params: --build: print complete build info --help: print this help'''# Python 2...原创 2019-10-06 13:47:45 · 334 阅读 · 0 评论 -
python opencv载入图片
# -*- coding: utf-8 -*-"""Created on Sun Oct 14 19:58:58 2018@author: lin"""import numpy as npimport cv2# Load an color image in grayscaleimg = cv2.imread("G:\\picture\\flower.jpg", 0)# c...原创 2019-09-30 13:32:55 · 248 阅读 · 0 评论 -
python opencv图像滤波
# -*- coding: utf-8 -*-import numpy as npfrom matplotlib import pyplot as pltimport cv2def medianBlurTest(file): img1 = cv2.imread(file) #e1 = cv2.getTickCount() for i in range(1, 15, 2):...原创 2019-09-30 13:01:38 · 282 阅读 · 0 评论 -
python opencv图像融合
# -*- coding: utf-8 -*-import numpy as npfrom matplotlib import pyplot as pltimport cv2def addWeight(): pic1 = 'F:\\dataSet\\picture\\000006 (2).jpg' pic2 = 'F:\\dataSet\\picture\\1.png' i...原创 2019-09-30 12:58:38 · 341 阅读 · 0 评论 -
python opencv图像处理
# -*- coding: utf-8 -*-import numpy as npfrom matplotlib import pyplot as pltimport cv2def roiProcess(): file = "F:\\dataSet\\picture\\000006 (2).jpg" img=cv2.imread(file) # [startRow: end...原创 2019-09-30 12:54:59 · 322 阅读 · 0 评论 -
python opencv调色板
# -*- coding: utf-8 -*-import numpy as npimport cv2def nothing(x): pass def palette(): img=np.zeros((300,1378,3),np.uint8) cv2.namedWindow('image') cv2.createTrackbar('R','image',0,255,not...原创 2019-09-30 12:48:59 · 522 阅读 · 0 评论 -
python opencv画图
import numpy as npimport cv2def drawPic(): img=np.zeros((512,512,3), np.uint8) # Draw a diagonal blue line with thickness of 5 px cv2.line(img,(0,0),(511,511),(255,0,0),5) cv2.rectangle(img,...原创 2019-09-30 12:45:22 · 322 阅读 · 0 评论 -
opencv python播放视频和保存视频
# -*- coding: utf-8 -*-import numpy as npimport cv2def playVideo(videoFile): cap = cv2.VideoCapture(videoFile) if cap.isOpened(): print("Open ", videoFile, " success!") else: print("Open ...原创 2019-09-30 12:15:59 · 2096 阅读 · 0 评论 -
python numpy 3
import numpy as npx = 3print(type(x)) # Prints "<class 'int'>"print(x) # Prints "3"print(x + 1) # Addition; prints "4"print(x - 1) # Subtraction; prints "2"print(x * 2) # Mul...原创 2019-10-06 13:47:39 · 120 阅读 · 0 评论