下面的代码用于将图像功能保存到csv格式文件。此代码正常工作。 我想从文件中加载和读取功能。任何人都可以为此提供python代码。 任何人都可以帮助我。
img1 = cv2.imread("/Users/alisa/Desktop/sift.jpg")
gr_img1 = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
sift = cv2.xfeatures2d.SIFT_create()
kp1, des1 = sift.detectAndCompute(gr_img1, None)
filename = '/Users/alisa/Desktop/q.csv'
gr_img1 = ''
for row_features in des1:
for feature in row_features:
gr_img1 = gr_img1 + str(feature) + ','
with open(filename, 'w+') as output:
output.write(gr_img1 + "\n")`