python-图像边缘算法-动态显示过程

import os
import matplotlib.pyplot as plt
import cv2
import numpy as np

def get_EuclideanDistance(x,y):
    myx = np.array(x)
    myy = np.array(y)
    return np.sqrt(np.sum((myx-myy)*(myx-myy)))

dir = os.listdir('./train')

if __name__ == '__main__':

    print('loading %s ...'%dir[1])
    print('working')
    image1 = cv2.imread('./train/'+dir[1])
    w = image1.shape[1]
    h = image1.shape[0]
    image2 = np.zeros((h,w,3), np.uint8)

    black = np.array([0,0,0])
    white = np.array([255,255,255])
    centercolor = np.array([125,125,125])
    #此处为关键,打开图片框
    plt.ion()
    i = 0
    for y in range(0,h-1):
        for x in range(0,w-1):

            down = image1[y+1,x,:]
            right = image1[y,x+1,:]

            here = image1[y,x,:]
            here2 = here
            right2 = right
            d
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值