Python报错问题解决
程序报错的描述及解决方案
最白の白菜
Java道路长漫漫,坚持学习最关键。
人生苦短,我用Python。
人外有人,山外有山。越努力,越幸运!
展开
-
SIFT算法运行cv.xfeatures2d.SIFT_create()时报错
问题描述cv2.error: OpenCV(4.1.2) error: OpenCV(4.1.2) /io/opencv_contrib/modules/xfeatures2d\src\sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE C原创 2022-03-08 18:39:42 · 4645 阅读 · 0 评论 -
轮廓检测中cv.findContours报错ValueError: not enough values to unpack (expected 3, got 2)
代码报错ValueError: not enough values to unpack (expected 3, got 2)原因是新版本只返回两个参数了原代码image, contours, hierarchy = cv.findContours(canny,cv.RETR_TREE,cv.CHAIN_APPROX_NONE)去掉第一个参数。替换如下contours, hierarchy = cv.findContours(canny, cv.RETR_TREE, cv.CHAIN_APPR原创 2022-03-08 17:26:38 · 701 阅读 · 0 评论 -
Colab中使用cv.imshow(img) 导致内核崩溃报错:DisabledFunctionError: cv2.imshow() is disabled in Colab
问题描述DisabledFunctionError: cv2.imshow() is disabled in Colab, because it causes Jupyter sessions to crash; see https://github.com/jupyter/notebook/issues/3935.问题解决如果使用的是 google colab,用此解决方案,替换报错的那一行:from google.colab.patches import cv2_imshowcv2_imsh原创 2022-03-06 20:12:45 · 2299 阅读 · 0 评论