cv2小记——图像梯度
# coding: utf-8 # !/usr/bin/python """ @File : 图像梯度.py @Author : jiaming @Modify Time: 2020/2/3 12:13 @Contact : https://blog.csdn.net/weixin_39541632 @Version : 1.0 @Desciption : 图像梯度、图像边界 cv2.Sobel() cv2.Schar() cv2.Laplacian() """ import os import sys import numpy as np import cv2 import pprint from matplotlib import pyplot as plt rawPath = os . path . abspath ( __file__ ) currentFile = os . path . basename ( sys . argv [ 0 ] ) dataPath = rawPath [ : rawPath . find ( currentFile ) ] + r 'static\\' """ OpenCV 提供了三种不同的梯度滤波器,或者说高通滤波器:Sobel、 Scharr、 Laplacian """ """ Sobel 算子和 Scharr 算子 Sobel