Hi I am trying to run this sample code from OpenCV:
#include \"opencv2\\opencv.hpp\"
using namespace cv;
int main(int, char**)
{
VideoCapture cap(0);
From the conversation in the comments to the question, we saw that VideoCapture gives frame in grayscale. So the call to cvtColor caused the crash.
...
Mat frame;
cap >> frame; // frame is already CV_8UC1
//cvtColor(frame, edges, CV_BGR2GRAY); // so don't to convert here, or crash!
edges = frame.clone();
...