我正在用C++制作一个程序,它使用2个图像来检测SURF特征,用bruteforcematcher计算匹配并绘制它.
这是代码
#include <cstdio>
#include <string>
#include <vector>
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include "opencv2/features2d/features2d.hpp"
using namespace cv;
using namespace std;
int main(int argc, char **argv){
if (argc <3) {
cout << "Usage: " << argv[0] << " imageLocation1 imageLocation2" << endl;
return -1;
}
Mat source1 = imread(argv[1],CV_LOAD_IMAGE_GRAYSCALE);
Mat source2 = imread(argv[2],CV_LOAD_IMAGE_GRAYSCALE);
if(source1.empty() || source2.empty()){
printf("Can't load all the images!");
return -1;
}
//Initialise the Wrapping Class for Surf()
SurfFeatureDetector detector(400);
//detect : first param: Image, second param: vector (output) …Run Code Online (Sandbox Code Playgroud) 我们将我们的API从Django - Piston移植到Django-TastyPie.一切顺利,'直到我们达到这个目的:
应用程序的urls.py
url(r'^upload/', Resource(UploadHandler, authentication=KeyAuthentication()), name="api-upload"),
url(r'^result/(?P<uuid>[^//]+)/', Resource(ResultsHandler, authentication=KeyAuthentication()), name="api-result")
Run Code Online (Sandbox Code Playgroud)
这使用活塞,所以我们想把它改成适合TastyPie的东西
url(r'^upload/', include(upload_handler.urls), name="api-upload"),
url(r'^result/(?P<uuid>[^//]+)/', include(results_handler.urls), name="api-result")
Run Code Online (Sandbox Code Playgroud)
但我们坚持这个错误
使用参数'()'和关键字参数'{'uuid':'fbe7f421-b911-11e0-b721-001f5bf19720'}'找不到'api-result'.
和结果的调试页面:
使用MelodyService.urls中定义的URLconf,Django按以下顺序尝试了这些URL模式:
^ melotranscript/^ upload/^ melotranscript/^ result /(?P [^ //] +)/ ^(?Presultshandler)/ $ [name ='api_dispatch_list'] ^ melotranscript/^ result /(?P [^ // ] +)/ ^(?Presultshandler)/ schema/$ [name ='api_get_schema'] ^ melotranscript/^ result /(?P [^ //] +)/ ^(?Presultshandler)/ set /(?P\w [\ w /; - ]*)/ $ [name ='api_get_multiple'] ^ melotranscript/^ result /(?P [^ //] +)/ ^(?Presultshandler)/(?P\w [\ w/- ]*)/ $ [name ='api_dispatch_detail'] …
我正在寻找关于在Django中为OAuth编写两条腿提供程序的教程/示例/解释.
很难找到关于OAuth提供商的文档,甚至更难找到一个两足系统......