ZIPOpencv-图像检测学习 891.16KB

m0_73536593

资源文件列表:

图像检测.zip 大约有15个文件
  1. 图像检测/
  2. 图像检测/01 灰度对比.py 805B
  3. 图像检测/02 图像边缘增强.py 1.09KB
  4. 图像检测/03 去噪.py 724B
  5. 图像检测/04 直线检测.py 650B
  6. 图像检测/05-1 圆形检测简单.py 1.17KB
  7. 图像检测/05-2 圆形检测复杂.py
  8. 图像检测/img/
  9. 图像检测/img/01-灰度对比.jpg 71.61KB
  10. 图像检测/img/02(图像边缘增强).jpg 182.34KB
  11. 图像检测/img/03(去噪).jpg 13.57KB
  12. 图像检测/img/04(直线检测).jpg 293.13KB
  13. 图像检测/img/05-1(圆形检测简单).jpg 80.8KB
  14. 图像检测/img/05-2(圆形检测复杂).jpg 148.07KB
  15. 图像检测/test.jpg 148.07KB

资源介绍:

图像检测学习
import cv2 import numpy as np # 读取图片 image = cv2.imread('test.jpg') # 将图片转换为灰度图 gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # 使用高斯模糊减少噪声 blurred = cv2.GaussianBlur(gray, (9, 9), 0) # 使用霍夫圆变换检测圆 circles = cv2.HoughCircles(blurred, cv2.HOUGH_GRADIENT, dp=1, minDist=20, param1=50, param2=30, minRadius=0, maxRadius=70) # 初始化计数器 small_circle_count = 0 medium_circle_count = 0 # 确保至少找到一个圆 if circles is not None: circles = np.uint16(np.around(circles)) for i in circles[0, :]: if 0 <= i[2] < 40: # 小圆 cv2.circle(image, (i[0], i[1]), i[2], (255, 0, 255), 2) # 紫色框小圆 small_circle_count += 1 elif 40 <= i[2] <= 50: # 中圆 cv2.circle(image, (i[0], i[1]), i[2], (0, 255, 0), 2) # 红色框中圆 medium_circle_count += 1 # 显示结果和统计数量 print(f"Detected {small_circle_count} small circles.") print(f"Detected {medium_circle_count} medium circles.") cv2.imshow('Detected Circles', image) cv2.waitKey(0) cv2.destroyAllWindows()
100+评论
captcha
    类型标题大小时间
    ZIPwwwwwwwwwwwwwwww2.63MB7月前
    ZIP爱普生打印机清零软件适应于L3115L3116L3117L3118废墨清零工具1.15MB7月前
    ZIPyolov5/yolov8英文字体文件403.71KB7月前
    ZIPyolov5/yolov8中文字体文件14.2MB7月前
    ZIPreact 安卓端微信 H5 实现在线 PDF 预览5.4MB7月前
    ZIPdelphi+数据控制组件33.5KB7月前
    ZIPvue 安卓端微信 H5 实现在线 PDF 预览5.39MB7月前
    ZIP1_visual studio2010配置opengl.zip389.33KB7月前