python - Dead Kernel : sift.detect(gray,None) 内核似乎已经死了。它会自动重启
问题描述
import cv2
import numpy as np
img = cv2.imread('home.jpg')
gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
sift = cv2.SIFT()
**kp = sift.detect(gray,None)** #Kernel dies here
img=cv2.drawKeypoints(gray,kp)
cv2.imwrite('sift_keypoints.jpg',img)
只想学习 SIFT,但 Mr.Kernel 在执行 sift.detect 时死了。
解决方案
我有一个类似的问题,并通过使用cv2.SIFT_create()
而不是cv2.SIFT()
.
推荐阅读
- reactjs - 表头显示的次数与 JSON 数据一样多。我该如何解决
- r - 如何在 R 中运行回归模型,假设为 H0 = b1 + b4 = 0?
- excel - 如何在 VBA 中的两个日期范围之间进行搜索?
- android - 每个 Flutter 应用都包含 Flutter 引擎吗?
- javascript - Jquery - 检查当前是否未编辑控件
- pine-script - 从鼠标单击中获取 2 条并投射第三个时间点
- vue.js - 为什么 v-model 不重置复选框?
- sql - PySpark 中是否有相当于 SnowFlake 的“REGEXP_SUBSTR”?
- flutter - Flutter Futurebuilder 在显示快照数据值时显示错误
- azure-devops - DevOps URL 默认项目集合