OpenCV的 60 种图像效果,一篇文章搞定

OpenCV的 60 种图像效果,一篇文章搞定

代码语言:javascript代码运行次数:0运行复制推荐阅读31个Python实战项目教你掌握图像处理,PDF开放下载opencv_contrib扩展模块中文教程pdf,限时领取最近在B站看到一个视频关于OpenCV 中的60 种,图像处理,总结的非常棒,因此分享给小伙伴们!

项目:https://github.com/dyh/opencv_tools

接下来我们详细看一下这个项目中到底包含了哪些内容。

一分钟视频:

图像色彩

image_color.py

色度/色调饱和度纯度/亮度固定饱和度s固定亮度v固定色度h + 固定饱和度s固定色度h + 固定亮度v固定饱和度s + 固定亮度v图像变换

image_transformation.py

形态学滤波器腐蚀和膨胀图像腐蚀 3x3膨胀 3x3 3次腐蚀 7x7腐蚀 3x3 3次形态学滤波器开启和闭合图像Close the imageOpen the image灰度图像中应用形态学运算 Gradient | EdgeApply threshold to obtain a binary image7x7 Black Top-hat ImageApply threshold to obtain a binary imageApply the black top-hat transform using a 7x7 structuring element图像滤波器

image_filtering.py

Blur the image with a mean filterBlur the image with a mean filter 9x9缩减 采样resizing with NNresizing with bilinear中值滤波定向滤波器Compute Sobel X derivativeCompute Sobel Y derivativeCompute norm of SobelCompute Sobel X derivative (7x7)Apply threshold to Sobel norm (low threshold value)Apply threshold to Sobel norm (high threshold value)down-sample and up-sample the imagedown-sample and up-sample the imagecv2.subtractcv2.subtract gauss15 - gauss05cv2.subtract gauss22 - gauss20提取直线、轮廓、区域

image_outline.py

Canny ContoursCanny Contours GrayHough tranform for line detectionCircles with HoughPGet the contours, Contours with RETR_LIST图像增强-白平衡等

image_enhancement.py

简单白平衡灰度世界算法直方图均衡化视网膜-大脑皮层(Retinex)增强算法Single Scale RetinexMulti Scale RetinexMulti Scale Retinex With Color Restoration自动白平衡 AWB自动色彩均衡 ACE运行环境

python 3.6+,pip 20+

pip install -r requirements.txt

代码语言:javascript代码运行次数:0运行复制Pillow==8.0.1

numpy==1.19.4

opencv-python==4.4.0.46

six==1.15.0

matplotlib==3.3.3

cycler==0.10.0

kiwisolver==1.3.1

pkg-resources==0.0.0

pyparsing==2.4.7

python-dateutil==2.8.1如何运行

克隆代码

进入目录

创建 python 虚拟环境

激活虚拟环境

升级pip

安装软件包

在 main.py 文件中,设置要处理的图片路径 file_path,例如

运行程序

程序将在 output 目录下输出60张图片

是不是非常的实用

利用现有的工具提高效果,如果对你有帮助,可以给我来三连!

代码语言:javascript代码运行次数:0运行复制

相关推荐

国际海运中的EBS、CIC和ECRS附加费是什么?
365bet英超

国际海运中的EBS、CIC和ECRS附加费是什么?

📅 07-22 👁️ 8324
米家如何参加众筹项目管理
365bet手机网址多少

米家如何参加众筹项目管理

📅 07-27 👁️ 8897
泰迪的毛为什么不卷?
beat365官方

泰迪的毛为什么不卷?

📅 07-18 👁️ 3522