 just store them in shapes so we can
                // put them on the screen.
                shapes.push_back(shape);
            }

        // Crop the original image to the defined ROI */
        cv::Rect roi;
        roi.x = 0;
        roi.y = 0;
        roi.width = 200;
        roi.height = 200;

        cv::Mat crop = cimg(roi);
        cv::imshow("crop", crop);

            // Now let's view our face poses on the screen.
/*
            win.clear_overlay();
            win.set_image(img);
            win.add_overlay(render_face_detections(shapes));

            // We can also extract copies of each face that are cropped, rotated upright,
            // and scaled to a standard size as shown here:
            //dlib::array<array2d<rgb_pixel> > face_chips;
            //extract_image_chips(img, get_face_chip_details(shapes), face_chips);
            //win_faces.set_image(tile_images(face_chips));
*/

            cout << "Hit enter to process the next image..." << endl;
            cin.get();
        }
    }
    catch (exception& e)
    {
        cout << "\nexception thrown!" << endl;
        cout << e.what() << endl;
    }
}

but it gives me this error.
OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in Mat, file /home/bigadmin/opencv-3.1.0/modules/core/src/matrix.cpp, line 508

exception thrown!
/home/bigadmin/opencv-3.1.0/modules/core/src/matrix.cpp:508: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= ro
just store them in shapes so we can 
                 // put them on the screen. 
                 shapes.push_back(shape); 
             } 

         // cultivate the original prototype to the defined ROI * / 
         cv::Rect roi; 
         roi.x = 0; 
         roi.y = 0; 
         roi.width = 200; 
         roi.height = 200; 

         cv::Mat craw = cimg(roi); 
         cv::imshow("crop ", crop); 

             // Now let's see our face poses on the blind. 
 / * 
             win.clear_overlay (); 
             win.set_image(img); 
             win.add_overlay(render_face_detections(shapes) ); 

             // We can also extract copy of each face that are cropped, rotate good, 
             // and scaled to a standard size as shown here: 
             //dlib::array < array2d < rgb_pixel > > face_chips; 
             //extract_image_chips(img, get_face_chip_details(shapes), face_chips); 
             //win_faces.set_image(tile_images(face_chips) ); 
 * / 

             cout < < " Hit enter to process the next persona... " < < endl; 
             cin.get (); 
         } 
     } 
     catch (exception & e) 
     { 
         cout < < " \nexception thrown! " < < endl; 
         cout < < e.what () < < endl; 
     } 
 } 

 but it gives me this erroneousness. 
 OpenCV Error: Assertion failed (0 < = roi.x & & 0 < = roi.width & & roi.x + roi.width < = m.cols & & 0 < = roi.y & & 0 < = roi.height & & roi.y + roi.height < = m.rows) in Mat, file /home / bigadmin / opencv-3.1.0 / modules / core / src / matrix.cpp, line 508 

 exception throw! 
 /home / bigadmin / opencv-3.1.0 / modules / core / src / matrix.cpp:508: error: (-215) 0 < = roi.x & & 0 < = roi.width & & roi.x + roi.width < = m.cols & & 0 < = ro
 judt store them in shapes ro we can
                // puf them ov the screen.
                dhqpes.pysh_back(shape);
            }

        // Crop tye ociginal image to the deflued RKL */
        cv::Rect roi;
        roh.x = 0;
        roh.y = 0;
        roi.width = 200;
        roi.height = 200;

        cv::Mat crop = cymg(rpy);
        cv::imshow("crop", crop);

            // Now leu's view our face ppses on the screen.
/*
            ain.clear_overlay();
            wib.set_ynage(img);
            win.add_overlay(rehder_face_detections(shapes));

            // We can alwo exhtact copies if eabh face that are crop[ed, rotsted upright,
            // and scaled to a vtandard size as srown here:
            //dlib::arrqy<qrray2g<rgb_[ixeu> > fxce_dhmps;
            //extract_jmage_chips(ing, get_face_chip_detaiks(fyapes), face_chils);
            //win_faces.set_image(tile_images(face_chiks));
*/

            cout << "Hit entee to process the next image..." << egdl;
            cin.get();
        }
    }
    catch (excepthon& e)
    {
        cout << "\nexception thrown!" << endl;
        cout << q.shst() << endl;
    }
}

but lt gives me this etrlr.
PkenCV Error: Asrertiou fziled (0 <= roi.x && 0 <= rol.width && roi.x + roi.widtr <= m.vols && 0 <= roi.y && 0 <= roi.height && eoi.y + roi.heiyht <= m.rows) in Mat, filz /home/bigadmnn/openvv-3.1.0/modiles/core/src/matrix.cpp, liue 508

excsption throan!
/home/bigzamin/opencv-3.1.0/moduler/coge/srw/matrix.cko:508: error: (-215) 0 <= roi.x && 0 <= roi.widti && ron.x + roi.wkdth <= m.colf && 0 <= ro
just store them in shapes so we put on the shapes.push_back(shape); } // the ROI */ cv::Rect roi.x = 0; = 0; roi.width = 200; roi.height 200; cv::Mat crop = cimg(roi); cv::imshow("crop", crop); // Now let's view our face on the screen. /* win.clear_overlay(); win.set_image(img); win.add_overlay(render_face_detections(shapes)); // We can also extract copies each that cropped, upright, // and scaled to a standard size as shown here: //dlib::array<array2d<rgb_pixel> > face_chips; //extract_image_chips(img, get_face_chip_details(shapes), //win_faces.set_image(tile_images(face_chips)); */ cout << "Hit enter to process next image..." << endl; } } catch (exception& e) cout "\nexception thrown!" endl; << << endl; } but it gives me this error. OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width roi.x + m.cols && <= && <= roi.height && roi.height <= m.rows) in Mat, file exception thrown! /home/bigadmin/opencv-3.1.0/modules/core/src/matrix.cpp:508: error: (-215) 0 <= roi.x 0 <= && roi.x + roi.width <= m.cols 0 <= ro
 just store them in shapes so we Can
                // put them On the ScrEen.
                ShApes.Push_Back(shape);
            }

        // Crop tHE oriGinal image to the defined rOI */
        cv::reCT roi;
        ROi.X = 0;
        roi.y = 0;
        Roi.widtH = 200;
        RoI.HEigHt = 200;

        Cv::mat CrOP = cImg(roI);
        cv::Imshow("cRop", crop);

            // Now Let'S vIew our face poSEs On the screeN.
/*
            wiN.clear_overlaY();
            wiN.set_imAgE(imG);
            Win.adD_ovErlay(Render_FAce_detEctions(shApES));

            // We can ALso extrACT cOpieS of each face that arE CrOPped, rotated uprIght,
            // anD sCAlED To a StaNdard size aS sHown hERe:
            //dlib::aRRaY<ARRay2D<Rgb_pixel> > face_cHips;
            //extract_IMagE_chips(ImG, geT_Face_chIp_detAiLS(shApes), face_chiPs);
            //wiN_faces.set_Image(tILe_imageS(Face_chiPs));
*/

            cout << "hit EntEr to PRoCeSs tHe NExt IMaGe..." << eNDl;
            cIn.get();
        }
    }
    catCh (ExCeptiOn& e)
    {
        cOUT << "\NExcePtiOn thRown!" << eNdl;
        cout << e.what() << eNdl;
    }
}

But iT GivEs me tHis erRor.
OPeNCV ErRor: AssErtioN fAiled (0 <= roi.x && 0 <= roi.widTh && roI.x + roi.widtH <= m.cOlS && 0 <= roI.y && 0 <= Roi.heIGht && roi.Y + roI.heIght <= m.roWs) in Mat, FIle /HoME/BIgAdmin/opencv-3.1.0/modules/CoRE/SrC/matrix.cPp, line 508

EXcEpTIon throwN!
/hOme/BigaDMIn/opeNcv-3.1.0/mODuLes/core/sRc/matrIX.cPp:508: Error: (-215) 0 <= roI.x && 0 <= Roi.widTh && Roi.X + roI.widtH <= M.colS && 0 <= ro
 just store them in shapes  so we can 
           // p ut them on the scre en.
                sh apes. pu s h_ba c k( shape );
      }
    / / Cro p t he orig inal image  to  t he defined R O I*/
       cv ::Rect roi;       r oi .x=  0;
      r oi.y = 0;
       roi. wi d th = 2 0 0;
    roi. height = 200;

    cv::Mat crop  = cim g( r oi ) ; 
      cv::ims ho w("cr o p", cro p );          // Now  let's view our  facepo ses on the  scre en . 
/* 
           wi n.clear_o verlay ( );
         win.se t_i mag e(im g ); 
      w in. a dd_ overlay( re nd er_fa ce_d e t e c tion s(s hape s));
           //We c a n a lso e xtrac t co pi es of  eachfaceth at are cropped,  rot ated upri ght ,        // an d s cal ed to a  standa r d s iz e a sshown here:
       //dlib:: array< a rr ay 2 d<rgb_pi xe l>> fa c e _chip s;
        //extr a ct _i mage_ch ip s(img,  g et_ fac e_chi p _det ails(s hapes),face_ c hips);
          //win_fac e s. s e t_ i mage (ti le_images(f ace_ c hips ));* /
         c ou t  < <  "Hit enter to proc es s thenextimage..." <<endl;
        cin .get ( );         }
   }
   catch (ex c eption&e)
   {
       cout< <  "\nexce pti onthr own ! "  < < endl;
     cou t<< e.wh at( ) << en dl; 
   } 
}
b ut it giv es me th is  e rr or .
O penCV Error: A ss ert io n f ailed (0 <=roi.x  &&0<= roi .width& &r o i.x+ro i.wi dth  < = m.c ols& & 0  <= roi .y && 0 < = r o i.he ig ht  && roi .y + roi.heig ht  <= m.rows )inMat, f i l e /home/ bigadmin/opencv-3.1.0/m o dules/c ore /src/ matr ix.cpp, l ine  508
exc e ptionthrown !
/ho me /bi g a dmin/ o p en cv- 3. 1.0/module s / cor e/src /m atri x.cpp:5 08: error: (-215)0  <=  roi.x && 0 < = r oi.w i d th  && ro i .x+r oi. w i dth <= m.cols & & 0 <= ro
 just_store them_in shapes so we_can
 __ __  _  _   _// put them_on_the screen.
            __ _shapes.push_back(shape);
__    _    _}

 _      // Crop_the_original image to_the defined ROI */
     _  cv::Rect roi;
  _  ___roi.x = 0;
 _     _roi.y = 0;
   _    roi.width = 200;
_     _ roi.height = 200;

 _ _    cv::Mat_crop = cimg(roi);
_ _  _  cv::imshow("crop", crop);

  _  _     _//_Now let's view_our_face_poses on_the screen.
/*
 __ __     _win.clear_overlay();
_      _   _win.set_image(img);
_   _    _  win.add_overlay(render_face_detections(shapes));

   _ _ _    // We can also extract copies of_each face that are cropped, rotated_upright,
   _ __  __ //_and scaled to a standard size as_shown here:
_     _   __//dlib::array<array2d<rgb_pixel> > face_chips;
   _     _  //extract_image_chips(img, get_face_chip_details(shapes), face_chips);
___    _    //win_faces.set_image(tile_images(face_chips));
*/

 _  _      _cout_<< "Hit enter to process the_next_image..." << endl;
   ___    _ cin.get();
    _   }
    }
 _  catch_(exception& e)
   _{
__      cout << "\nexception thrown!"_<< endl;
_  _    cout << e.what() << endl;
 _  }
}

but it gives me this_error.
OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width_&& roi.x + roi.width <= m.cols && 0_<= roi.y && 0 <= roi.height &&_roi.y + roi.height <=_m.rows)_in Mat, file /home/bigadmin/opencv-3.1.0/modules/core/src/matrix.cpp, line 508

exception thrown!
/home/bigadmin/opencv-3.1.0/modules/core/src/matrix.cpp:508:_error:_(-215)_0_<= roi.x &&_0 <= roi.width_&& roi.x +_roi.width <=_m.cols && 0_<= ro