Opencv cornerHarris错误

时间:2016-05-08 17:25:45

标签: python opencv fingerprint

我试图在指纹识别中检测兴趣点(关键点):

import cv2 as cv
import numpy as np
input = cv.imread("C:\Users\ADNAN\Desktop\FingClass.png");
input2 = cv.threshold(input,127,255,cv.THRESH_BINARY)[1];
dst = cv.cornerHarris(input2,2,3,0.04);

但是角落哈里斯抛出一个我不理解的错误

cv2.error: C:\builds\master_PackSlaveAddon-win32-vc12èstativ\opencv\modules\imgproc\src\corner.cpp:287: rror: (-215) src.type() == cv_8uc1 || src.type() == cv_32FC1 in function cv::cornerEigenValsVecs

1 个答案:

答案 0 :(得分:1)

您可能必须包含

def view(request):
    ...
    cookie_state = request.COOKIES.get('viewed_post_%s' % post_name_slug)
    response = render_to_response('community/post.html',context_instance=RequestContext(request, context_dict))
    if cookie_state:
        Post.objects.filter(id=post.id).update(total_views=F('total_views') + 1)
    else:
        Post.objects.filter(id=post.id).update(unique_views=F('unique_views') + 1)
        Post.objects.filter(id=post.id).update(total_views=F('total_views') + 1)
                        response.set_cookie('viewed_post_%s' % post_name_slug , True, max_age=2678400)
    return response

在执行你的角落哈里斯之前。

请点击此处查看更多详细信息和示例代码以及示例图片: http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_feature2d/py_features_harris/py_features_harris.html

如果图片仍无效,您可以发布图片。

您使用的是哪个版本的OpenCV?