首页
学习
活动
专区
工具
TVP
发布

小鹏的专栏

专栏成员
331
文章
407146
阅读量
56
订阅数
opencv--基于深度学习的人脸检测器
首先, 一直以来就在考虑这么牛逼的opencv该换一下里边一些过时的东西了,像:检测器、识别器等等,果不其然,openv的大佬们还是偷偷的换了。
MachineLP
2022-05-09
4370
anaconda + tensorflow +ubuntu
用过一段时间的caffe后,对caffe有两点感受:1、速度确实快; 2、 太不灵活了。
MachineLP
2022-05-09
3530
OpenCV之二值图像 联通组件寻找
python代码: import cv2 as cv import numpy as np def connected_components_demo(src): src = cv.GaussianBlur(src, (3, 3), 0) gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY) ret, binary = cv.threshold(gray, 0, 255, cv.THRESH_BINARY | cv.THRESH_OTSU)
MachineLP
2021-08-13
3250
OpenCV之图像二化自适应阈值算法
python代码: import cv2 as cv import numpy as np # # THRESH_BINARY = 0 # THRESH_BINARY_INV = 1 # THRESH_TRUNC = 2 # THRESH_TOZERO = 3 # THRESH_TOZERO_INV = 4 # src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src)
MachineLP
2021-08-13
9420
OpenCV之图像二值寻找算法 – TRIANGLE
python代码: import cv2 as cv import numpy as np #import tensorflow as tf # tf.enable_eager_execution() # # THRESH_BINARY = 0 # THRESH_BINARY_INV = 1 # THRESH_TRUNC = 2 # THRESH_TOZERO = 3 # THRESH_TOZERO_INV = 4 # src = cv.imread("./test.png") cv.namedWindo
MachineLP
2021-08-13
3390
OpenCV之图像二值寻找算法 – OTSU
python代码: import cv2 as cv import numpy as np # # THRESH_BINARY = 0 # THRESH_BINARY_INV = 1 # THRESH_TRUNC = 2 # THRESH_TOZERO = 3 # THRESH_TOZERO_INV = 4 # src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src) h
MachineLP
2021-08-13
3210
OpenCV之基本阈值操作
python代码: import cv2 as cv import numpy as np # # THRESH_BINARY = 0 # THRESH_BINARY_INV = 1 # THRESH_TRUNC = 2 # THRESH_TOZERO = 3 # THRESH_TOZERO_INV = 4 # src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src)
MachineLP
2021-08-13
4650
OpenCV之二值图像介绍
python代码: import cv2 as cv import numpy as np src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src) T = 127 # 转换为灰度图像 gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY) h, w = gray.shape T = cv.mean(gray)[0] print("cu
MachineLP
2021-08-13
2690
OpenCV之图像模板匹配
python代码: import cv2 as cv import numpy as np def template_demo(): src = cv.imread("./test.png") tpl = cv.imread("./test01.png") cv.imshow("input", src) cv.imshow("tpl", tpl) th, tw = tpl.shape[:2] result = cv.matchTemplate(src, t
MachineLP
2021-08-13
4250
OpenCV之拉普拉斯金字塔
python代码: import cv2 as cv import numpy as np def laplaian_demo(pyramid_images): level = len(pyramid_images) for i in range(level-1, -1, -1): if (i-1) < 0: h, w = src.shape[:2] expand = cv.pyrUp(pyramid_images[i],
MachineLP
2021-08-13
2220
OpenCV之图像二值化与去噪
python代码: import cv2 as cv import numpy as np def method_1(image): gray = cv.cvtColor(image, cv.COLOR_BGR2GRAY) t, binary = cv.threshold(gray, 0, 255, cv.THRESH_BINARY | cv.THRESH_OTSU) return binary def method_2(image): blurred = cv.Ga
MachineLP
2021-08-13
6280
OpenCV之图像金字塔
python代码: import cv2 as cv def pyramid_down(pyramid_images): level = len(pyramid_images) print("level = ",level) for i in range(level-1, -1, -1): expand = cv.pyrUp(pyramid_images[i]) cv.imshow("pyramid_down_"+str(i), expand)
MachineLP
2021-08-05
3840
OpenCV之Canny边缘检测器
python代码: import cv2 as cv import numpy as np src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src) # t1 = 100, t2 = 3*t1 = 300 edge = cv.Canny(src, 100, 300) cv.imshow("mask image", edge) cv.imwrite("./edge.pn
MachineLP
2021-08-05
3160
OpenCV之USM 锐化增强算法
python代码: import cv2 as cv import numpy as np src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src) # sigma = 5、15、25 blur_img = cv.GaussianBlur(src, (0, 0), 5) usm = cv.addWeighted(src, 1.5, blur_img, -0.5, 0)
MachineLP
2021-08-05
1K0
OpenCV之图像锐化
python代码: import cv2 as cv import numpy as np src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src) # sharpen_op = np.array([[-1, -1, -1], [-1, 9, -1], [-1, -1, -1]], dtype=np.float32) sharpen_op = np.array([[0
MachineLP
2021-07-27
7440
OpenCV之图像梯度 – 拉普拉斯算子(二阶导数算子)
python代码: import cv2 as cv import numpy as np image = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", image) h, w = image.shape[:2] src = cv.GaussianBlur(image, (0, 0), 1) dst = cv.Laplacian(src, cv.CV_32F, ksize=3,
MachineLP
2021-07-27
6380
OpenCV之Sobel算子
python代码: import cv2 as cv import numpy as np src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src) h, w = src.shape[:2] x_grad = cv.Sobel(src, cv.CV_32F, 1, 0) y_grad = cv.Sobel(src, cv.CV_32F, 0, 1) x_grad =
MachineLP
2021-07-23
2840
OpenCV之快速的图像边缘滤波算法
python代码: import cv2 as cv import numpy as np src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src) h, w = src.shape[:2] dst = cv.edgePreservingFilter(src, sigma_s=100, sigma_r=0.4, flags=cv.RECURS_FILTER) resu
MachineLP
2021-07-23
3710
OpenCV之图像积分图算法
python代码: import cv2 as cv import numpy as np def get_block_sum(ii, x1, y1, x2, y2, index): tl = ii[y1, x1][index] tr = ii[y2, x1][index] bl = ii[y1, x2][index] br = ii[y2, x2][index] s = (br - bl - tr + tl) return s def blur_de
MachineLP
2021-07-23
2650
OpenCV之边缘保留滤波算法 – 均值迁移模糊(mean-shift blur)
python代码: import cv2 as cv import numpy as np src = cv.imread("./test.png") cv.namedWindow("input", cv.WINDOW_AUTOSIZE) cv.imshow("input", src) h, w = src.shape[:2] dst = cv.pyrMeanShiftFiltering(src, 15, 30, termcrit=(cv.TERM_CRITERIA_MAX_ITER+cv.TERM_C
MachineLP
2021-07-20
5970
点击加载更多
社区活动
【纪录片】中国数据库前世今生
穿越半个世纪,探寻中国数据库50年的发展历程
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档