title: Crop and show image that i get from Haar Cascade
body: <p>I have trained Haar cascade and now i need to work with founded object. How i can crop it from original image and show in new window?(or show multiple window if i found 2 object on image). There is my code (opencv ver 2.4.13):</p>
  
  <pre><code>    #include &lt;opencv2/opencv.hpp&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  using namespace cv;
  
  int main(void)
  {
      CascadeClassifier trafficLightCascader;
      string Cascade_name = "TrafficLight.xml";
  
  if (!trafficLightCascader.load(Cascade_name))
  {
      cout &lt;&lt; "Can't load the face feature data" &lt;&lt; endl;
      return -1;
  }
  
  vector&lt;Rect&gt; trafficLights;
  
  Mat src = imread("6копия.png"); 
  CvRect AssignRect = Rect(0, 0, src.cols, src.rows / 2);
  Mat srcImage = src(AssignRect);
  
  Mat grayImage(srcImage.rows, srcImage.cols, CV_8UC1);
  
  cvtColor(srcImage, grayImage, CV_BGR2GRAY);
  equalizeHist(grayImage, grayImage); 
  
  trafficLightCascader.detectMultiScale(grayImage, trafficLights, 1.1, 1, 0, Size(3,3));
  
  for (int i = 0; i &lt; trafficLights.size(); ++i)
  {
      rectangle(src, trafficLights[i], Scalar(0, 255, 0), 2, 8, 0);
  }
  
  imshow("src", src);
  waitKey(0);
  
  
  return 0;}
  </code></pre>