EMGU CV thresholding exception

So I'm trying to threshold a video feed, and I'm getting a weird Exception that shuts down my program. I'm very new to image processing so I have absolutely no idea what the problem could be. I'm running VS2010 in C++. Here's my code:

1
2
3
4
5
6
7
	Emgu::CV::Image<Gray,UInt16> ^currentFrame;
	Emgu::CV::Image<Gray,UInt16> ^threshFrame;
	threshFrame = gcnew Emgu::CV::Image<Gray,UInt16>(cols,rows);
	currentFrame=frameFromCamera_static->Clone();
	CvInvoke::cvThreshold(currentFrame, threshFrame, 160, 255, (Emgu::CV::CvEnum::THRESH)CV_THRESH_BINARY);
	CvInvoke::cvShowImage("Output", threshFrame);
	int c = cvWaitKey(40);


The exception I'm getting is this:

An unhandled exception of type 'Emgu.CV.CvException' occurred in Emgu.CV.dll

Additional information: OpenCV: [

As you can see, the "Additional information" doesn't really offer much in terms of additional information. I'm very confused and very frustrated so if anyone could help me out that would be phenomenal. Thank you!
Topic archived. No new replies allowed.