zoukankan      html  css  js  c++  java
  • 4-7 毛玻璃

    import cv2
    import numpy as np
    import random
    img = cv2.imread('image2.jpg',1)
    imgInfo = img.shape
    height = imgInfo[0]
    width = imgInfo[1]
    dst = np.zeros((height,width,3),np.uint8)#为什么我们总是把高度放在第一位,因为我们当前的矩阵它是以行列式来展示的,所以它要先行后列.
    #我们过去图片中某一个元素也是先行后列.行就是当前的高度,列就是当前的宽度.
    mm = 8
    for m in range(0,height):
        for n in range(0,width):
            index = int(random.random()*8)#0-8
            (b,g,r) = img[m+index,n+index]
            dst[m,n] = (b,g,r)
    cv2.imshow('dst',dst)
    cv2.waitKey(0)

    import cv2
    import numpy as np
    import random
    img = cv2.imread('image2.jpg',1)
    imgInfo = img.shape
    height = imgInfo[0]
    width = imgInfo[1]
    dst = np.zeros((height,width,3),np.uint8)#为什么我们总是把高度放在第一位,因为我们当前的矩阵它是以行列式来展示的,所以它要先行后列.
    #我们过去图片中某一个元素也是先行后列.行就是当前的高度,列就是当前的宽度.
    mm = 8
    for m in range(0,height-mm):
        for n in range(0,width-mm):
            index = int(random.random()*8)#0-8
            (b,g,r) = img[m+index,n+index]
            dst[m,n] = (b,g,r)
    cv2.imshow('dst',dst)
    cv2.waitKey(0)

  • 相关阅读:
    在阿里云服务器上安装MySQL
    mui中调用ajax时报abort错误
    IDEA根据数据库表生成pojo对象
    java.io.IOException: All specified directories have failed to load.
    mysql隔离级别
    java8新特性
    数据库语言分类
    Spring AOP 代码示例
    java NIO学习(二)
    java NIO学习(一)
  • 原文地址:https://www.cnblogs.com/ZHONGZHENHUA/p/9692570.html
Copyright © 2011-2022 走看看