答案 0 :(得分:0)
这没用吗?
checkrer.png
import cv2
import numpy as np
filename = 'checker.png'
img = cv2.imread(filename)
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
## Harris corner detector
gray_f = np.float32(gray)
dst = cv2.cornerHarris(gray_f,2,3,0.04)
dst = cv2.dilate(dst,None)
corner = dst>0.01*dst.max()
# Image for confirmation
# corner_img = img.copy()
# corner_img[corner] = [0,0,255]
# cv2.imwrite("corner.png", corner_img)
## low brightness area
ksize = (20, 20)
blue = cv2.blur(gray, ksize)
low = blue<150
# Image for confirmation
# low_img = img.copy()
# low_img[low] = [0,0,255]
# cv2.imwrite("low.png", low_img)
## cross point
cross_point = corner * low
# Image for confirmation
cross_img = img.copy()
cross_img[cross_point] = [0,0,255]
cv2.imwrite("cross.png", cross_img)
cross.png