图像边缘算法
numpy使用指南[菜鸟教程]http://www.runoob.com/numpy/numpy-tutorial.html
opencv使用指南[官方文档]http://www.opencv.org.cn/opencvdoc/2.3.2/html/doc/tutorials/tutorials.html
完整代码如下(python3)
#-*- coding:utf-8 -*-
#code:1054263694@qq.com
#ImageEdgeAlgorithms.py
import cv2
import numpy as np
fn = 'test.jpg'
#计算欧式距离
def get_EuclideanDistance(x,y):
myx = np.array(x)
myy = np.array(y)
return np.sqrt(np.sum((myx-myy)*(myx-myy)))
#.py文件的最顶层代码都会被运行(不管是直接运行还是被导入&