代码展示
# -*- coding:utf-8 -*-
import cv2
image = cv2.imread('/home/pi/PycharmProjects/learn/opencv/samples/data/stuff.jpg')
h, w = image.shape[:2]
my_retina = cv2.bioinspired.Retina_create((w, h),
colorMode=True,
colorSamplingMethod=cv2.bioinspired.RETINA_COLOR_BAYER,
)
# my_retina.write("RetinaDefaultParameters.yaml")
# my_retina.setup("RetinaSpecificParameters.yaml")
my_retina.clearBuffers()
my_retina.run(image)
retinaOutput_parvo = my_retina.getParvo()
retinaOutput_magno = my_retina.getMagno()
cv2.namedWindow('原图', 0)
cv2.namedWindow('视网膜的运动通道', 0)
cv2.namedWindow('视网膜的细节通道', 0)
cv2.imshow("原图", image)
cv2.imshow("视网膜的细节通道", retinaOutput_parvo)
cv2.imshow("视网膜的运动通道", retinaOutput_magno)
cv2.waitKey()
效果展示