2
내가 OpenCV의 VideoCapture 모듈에 의해 검색된 depthImage와 OpenCV의 임계 값을 사용하려고 해요,하지만 난 다음 오류 얻을 :사용 OpenCV의 임계 값
OpenCV Error: Bad argument in unknown function, file PATHTOOPENCV\opencv\modules\core\src\matrix.cpp line 646
내 코드는 다음과 같다 :
를#include "opencv2/opencv.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/gpu/gpu.hpp"
cv::VideoCapture kinect;
cv::Mat rgbMap;
cv::Mat dispMap;
bool newFrame;
void setup()
{
kinect.open(CV_CAP_OPENNI);
newFrame = false;
}
void update()
{
if(kinect.grab())
{
kinect.retrieve(rgbMap, CV_CAP_OPENNI_BGR_IMAGE);
kinect.retrieve(dispMap, CV_CAP_OPENNI_DISPARITY_MAP);
newFrame = true;
}
}
void draw()
{
if(newFrame)
{
cv::Mat * _thresSrc = new cv::Mat(dispMap);
cv::Mat * _thresDst = new cv::Mat(dispMap);
cvThreshold(_thresSrc, _thresDst, 24, 255, CV_THRESH_BINARY);
// Draw _thresDst;
delete _thresSrc;
delete _thresDst;
newFrame = false;
}
}
당신이 C++ 인터페이스와 C 인터페이스를 혼합하는