- 博客(10)
- 收藏
- 关注
原创 OpenCV 图像颜色
作者:ccccting案列:© Fu Xianjun. All Rights Reserved.目录图像颜色导库代码图像颜色导库import cv2import numpy as np代码img = cv2.imread("1.jpg")print (img.shape)gao, chang , tongdaoshu = img. shapeprint("gao:%s, chang:%s, tongdao:%s"%(gao,chang, tongdao
2021-06-30 17:21:40 117
原创 OpenCV 图像灰度化
作者:ccccting案列:© Fu Xianjun. All Rights Reserved.目录图像灰度化导库 函数分量法图像灰度化导库import cv2 as cvimport numpy as npimport matplotlib.pyplot as pltimg = cv.imread("1.jpg", cv.IMREAD_COLOR)函数gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)...
2021-06-30 17:07:33 104
原创 OpenCV 图像轮廓
作者:ccccting案列:© Fu Xianjun. All Rights Reserved.目录图像轮廓定义代码图像轮廓定义边缘检测能够测出边缘,但是边缘是不连续的,将边缘连接为一个整体,构成轮廓代码import cv2o = cv2.imread("1.jpg")cv2.imshow("original", o)co = o.copy()gray = cv2.cvtColor(co, cv2.COLOR_BGR2GRAY)ret,binary
2021-06-30 17:02:11 91
原创 OpenCV 目标检测
作者:ccccting案列:© Fu Xianjun. All Rights Reserved.目录目标检测作用代码效果目标检测作用可提取视频中自己所感兴趣的部分代码import cv2import numpy as npOPENCV_OBJECT_TRACKERS = { "csrt": cv2.TrackerCSRT_create, "kcf": cv2.TrackerKCF_create, "boosting": cv2.Tr
2021-06-30 15:33:30 559
原创 OpenCV 消除批注
作者:ccccting案列:© Fu Xianjun. All Rights Reserved.目录消除文章横线批注代码总结消除文章横线批注代码import cv2import numpy as npimg = cv2.imread('1.jpg',0)a = cv2.resize(img,(300,500))binary = cv2.threshold(a,250,250,0)[1]k = cv2.getStructuringElement(cv2.MORPH_
2021-06-30 15:26:57 370
原创 OpenCV 多边形拟合
作者:ccccting案列:© Fu Xianjun. All Rights Reserved.多边形拟合代码if classes[i]==1: cv2.putText(img,'lane'+str(cls_boxes[i,4]),(center_bbox_x,center_bbox_y), cv2.FONT_HERSHEY_SIMPLEX , 1,myColorList[0],1,cv2.LINE_AA) cv2.dr
2021-06-30 15:22:17 264
原创 OpenCV 直方图处理
作者:ccccting案列:© Fu Xianjun. All Rights Reserved.目录直方图处理1.绘制直方图直方图处理1.绘制直方图import cv2import matplotlib.pyplot as pltimg = cv2.imread('1.jpg')plt.hist(img.ravel(),16)plt.show()import cv2import matplotlib.pyplot as pltimg=cv2.imread..
2021-06-29 16:27:19 75
原创 OpenCV 凸包
作者:ccccting案列:© Fu Xianjun. All Rights Reserved.什么是凸包定义凸包与轮廓近似相似,但不同,虽然有些情况下它们给出的结果是一样的。函数cv2.convexHull()可以用来检测一个曲线是否具有凸性缺陷,并能纠正缺陷。一般来说,凸性曲线总是凸出来的,至少是平的。如果有地方凹进去了就被叫做凸性缺陷。例如下图中的手,红色曲线显示了手的凸包,凸性缺陷被双箭头标出来了。代码. @param points Input 2D point s
2021-06-29 16:20:39 203
原创 OpenCV 人脸识别
作者:ccccting案列:© Fu Xianjun. All Rights Reserved.人脸识别1.图片人脸识别import cv2import numpy as npdef face_detect_demo(): gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY) cv.CascadeClassifier face_detector = cv.CascadeClassifier( faces
2021-06-29 14:48:19 60
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人