展示图片

创建日期:2024-06-21
更新日期:2025-01-01
from __future__ import print_function
import sys
import time
import numpy as np
import cv2 as cv

def main():
    src = cv.imread("./img/creative_commons_elephant.jpg")

    cv.imshow("Input", src)

    kernel = np.array([[-1, -2, -1], [0, 0, 0], [1, 2, 1]], np.float32)
    dst1 = cv.filter2D(src, -1, kernel)

    cv.imshow("Output", dst1)

    cv.waitKey(0)
    cv.destroyAllWindows()

main()