title: R6010 -abort() has been called 2
body: <p>hi i try to programming about opencv
  but i am blocked by debuging error
  that is "abort() has been called" what should i do? 
  it is program that looking face to use triangle then i dont know what problem is </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;opencv2/opencv.hpp&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  #include &lt;opencv2/core/core.hpp&gt;
  #include &lt;opencv2/contrib/contrib.hpp&gt;
  #include &lt;opencv2/imgproc/imgproc.hpp&gt;
  #include &lt;opencv2/objdetect/objdetect.hpp&gt;
  #include &lt;vector&gt;
  
  using namespace cv;
  using namespace std;
  
  
  int main()
  {
  
  VideoCapture cap(0); // open the default camera
  if(!cap.isOpened())  // check if we succeeded
      return -1;
  
  vector&lt;Mat&gt; images;
  vector&lt;int&gt; labels;
  
  images.at(0);
  labels.at(0);
  
  // Get the height from the first image. We'll need this
  // later in code to reshape the images to their original
  // size AND we need to reshape incoming faces to this size:
  int im_width = images[0].cols;
  int im_height = images[0].rows;
  // Create a FaceRecognizer and train it on the given images:
  Ptr&lt;FaceRecognizer&gt; model = createFisherFaceRecognizer();
  model-&gt;train(images, labels);
  // That's it for learning the Face Recognition model. You now
  // need to create the classifier for the task of Face Detection.
  // We are going to use the haar cascade you have specified in the
  // command line arguments:
  //
  
  CascadeClassifier faceCascade;
  faceCascade.load("C:\\opencv\\data\\haarcascade\\haarcascade_frontalface_alt.xml");
  
  
  
  
  Mat image;
  
  
  namedWindow("edges",1);
  
  for(;;){
      cap &gt;&gt; image; // get a new frame from camera
      Mat original = image.clone();
      Mat frame_gray;
      cvtColor(original, frame_gray, CV_BGR2GRAY);
  
     // equalizeHist( frame_gray, frame_gray );
     /* GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
      Canny(edges, edges, 0, 30, 3);*/
  
    //DITECT FACE
    // Find the faces in the frame:
      vector&lt; Rect_&lt;int&gt; &gt; faces;
      faceCascade.detectMultiScale(frame_gray, faces);
      // At this point you have the position of the faces in
      // faces. Now we'll get the faces, make a prediction and
      // annotate it in the video. Cool or what?
  
      for(int i = 0; i &lt; faces.size(); i++) {
  
      Rect face_i = faces[i];
  
      //rectangle(image, aRect, CV_RGB(0, 255,0), 1);
      Mat face = frame_gray(face_i);
          // Resizing the face is necessary for Eigenfaces and Fisherfaces. You can easily
          // verify this, by reading through the face recognition tutorial coming with OpenCV.
          // Resizing IS NOT NEEDED for Local Binary Patterns Histograms, so preparing the
          // input data really depends on the algorithm used.
          //
          // I strongly encourage you to play around with the algorithms. See which work best
          // in your scenario, LBPH should always be a contender for robust face recognition.
          //
          // Since I am showing the Fisherfaces algorithm here, I also show how to resize the
          // face you have just found:
          Mat face_resized;
          cv::resize(face, face_resized, Size(im_width, im_height), 1.0, 1.0, INTER_CUBIC);
          // Now perform the prediction, see how easy that is:
          int prediction = model-&gt;predict(face_resized);
          // And finally write all we've found out to the original image!
          // First of all draw a green rectangle around the detected face:
          rectangle(original, face_i, CV_RGB(0, 255,0), 1);
          // Create the text we will annotate the box with:
          string box_text = format("Prediction = %d", prediction);
          // Calculate the position for annotated text (make sure we don't
          // put illegal values in there):
  
          int pos_x = std::max(face_i.tl().x - 10, 0);
          int pos_y = std::max(face_i.tl().y - 10, 0);
          // And now put it into the image:
          putText(original, box_text, Point(pos_x, pos_y), FONT_HERSHEY_PLAIN, 1.0, CV_RGB(0,255,0), 2.0);
     }
  
  
      faceCascade.detectMultiScale( frame_gray, faces, 1.1, 3, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) );
  
  
      imshow("frame_gray", frame_gray);
  
    if(waitKey(1000) &gt;= 0) 
        break;
  }
      return 0;
  }
  </code></pre>