【发布时间】:2021-05-12 12:34:13
【问题描述】:
在机器学习中从灰度图像中提取特征存在问题。
我有一张用这个颜色转换成的灰色图像。
from PIL import Image
img = Image.open('source.png').convert('LA')
img.save('greyscalesource.png')
image2 = imread('greyscalesource.png')
print("The type of this input is {}".format(type(image)))
print("Shape: {}".format(image2.shape))
plt.imshow(image2)
我实际上需要从这张灰色图片中提取特征,因为下一部分是关于训练具有此特征的模型以预测图像的彩色形式。
我们不能使用任何深度学习库
有一些方法,例如 SIFT ORB FAST... 但我真的不知道如何为我的目标提取特征。
#ORB
orb = cv2.ORB_create()
#keypoints and descriptors
kpO, desO = orb.detectAndCompute(img, None)
img7 = cv2.drawKeypoints(img, kpO, 1, flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
cv2.imwrite('_ORB.jpg',img7)
以上代码的输出为真。
有什么解决方案或想法我该怎么办?
【问题讨论】:
标签: machine-learning image-processing feature-extraction