我正在尝试判断图像是否被像素化。我试图使用拉普拉斯方差方法来做这件事,但我不确定它是否正确工作,因为使用我的代码,一个非常扭曲/像素化的图像返回的方差非常高,为1011:
import sys
import cv2
import imutils as im
csv_filename = sys.argv[1]
def variance_of_laplacian(image):
# compute the Laplacian of the image and then return the focus
# measure, which is simply the varian
我想要提取图像的轮廓,我正在尝试使用MatplotLib的轮廓函数来实现。这是我的代码:
from PIL import Image
from pylab import *
# read image to array
im = array(Image.open('HOJA.jpg').convert('L'))
# create a new figure
figure()
# show contours with origin upper left corner
contour(im, origin='image')
axis('e