首页 > 解决方案 > opencv python中的detectAndCompute()方法给出命令行错误

问题描述

我正在尝试使用 ORB 方法进行特征匹配,但该detectAndCompute方法出错。

代码:

import cv2
import matplotlib.pyplot as 

# display function
def display(img, title=None, cmap='gray'):
    fig = plt.figure(figsize=(12, 10))
    ax = fig.add_subplot(111)
    ax.imshow(img, cmap)
    plt.title(title)
    plt.show()

reeses_printout = cv2.imread("../DATA/reeses_puffs.png", 0)
cereals = cv2.imread("../DATA/many_cereals.jpg", 0)

orb = cv2.ORB_create()
key_points_1, descriptors_1 = orb.detectAndCompute(reeses_printout, mask=None)
key_points_2, descriptors_2 = orb.detectAndCompute(cereals, mask=None)

错误信息:

$ python3 feature_matcing.py 
: CommandLine Error: Option 'enable-value-profiling' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

标签: pythonopencvllvm

解决方案


推荐阅读