我正在尝试在Halide中实现Meijster距离变换算法.我已经将此代码重写为C++(使用openCV)并且它工作正常.关于这个算法的论文就在这里.现在我的卤化物代码已完成50% - 第一阶段工作正常,现在我遇到了阶段2(链接代码中的扫描3)的问题,其中(简化)看起来像这样:
//g is 2 dimensional cv::Mat (something like array) - result of previous stage
// m is g.width and n is g.height
int(*functionF)(int x, int i, int g_i) = EDT_f;
int(*functionSep)(int i, int u, int g_i, int g_u, int max_value) = EDT_Sep;
cv::Mat dt = cv::Mat(n, m, CV_32SC1);
int* s = new int[m];
int* t = new int[m];
int q = 0, w;
for (int y = 0; y<n; y++)
{
q = 0; …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Mac Os X 10.9上的qt creator构建简单的OpenCV应用程序.所以我使用brew安装了OpenCv和Qt4:
brew install opencv
brew install qt4
Run Code Online (Sandbox Code Playgroud)
然后下载了qt creator.比我做了简单的项目 - main.cpp:
#include <QCoreApplication>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Mat m;
m = Mat(2, 3, 4);
cv::threshold(m, m, 123, 200, 1);
m = cv::imread("asdasd", 1); //problem is here!
return a.exec();
}
Run Code Online (Sandbox Code Playgroud)
和.pro文件:
QT += core
QT -= gui
TARGET = opencv_test
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app …
Run Code Online (Sandbox Code Playgroud)