endPointInOctave",   idx).toPoint2f().x;
    keyline.ePointInOctaveY = arr.at("endPointInOctave",   idx).toPoint2f().y;
    keyline.lineLength      = arr.at("lineLength",         idx).toFloat();
    keyline.numOfPixels     = arr.at("numOfPixels",        idx).toInt();
    return keyline;
}

/** Convert an MxArray to std::vector<cv::line_descriptor::KeyLine>
 * @param arr struct-array MxArray object
 * @return vector of keyline objects
 */
vector<KeyLine> MxArrayToVectorKeyLine(const MxArray& arr)
{
    const mwSize n = arr.numel();
    vector<KeyLine> vk;
    vk.reserve(n);
    if (arr.isCell())
        for (mwIndex i = 0; i < n; ++i)
            vk.push_back(MxArrayToKeyLine(arr.at<MxArray>(i)));
    else if (arr.isStruct())
        for (mwIndex i = 0; i < n; ++i)
            vk.push_back(MxArrayToKeyLine(arr,i));
    else
        mexErrMsgIdAndTxt("mexopencv:error",
            "MxArray unable to convert to std::vector<cv::line_descriptor::KeyLine>");
    return vk;
}

/** Convert an MxArray to std::vector<std::vector<cv::line_descriptor::KeyLine>>
 * @param arr cell-array of struct-arrays MxArray object
 * @return vector of vector of keyline objects
 */
vector<vector<KeyLine> > MxArrayToVectorVectorKeyLine(const MxArray& arr)
{
    vector<MxArray> va(arr.toVector<MxArray>());
    vector<vector<KeyLine> > vvk;
    vvk.reserve(va.size());
    for (vector<MxArray>::const_iterator it = va.begin(); it!= va.end(); ++it)
        
endPointInOctave ",    idx).toPoint2f().x; 
     keyline.ePointInOctaveY = arr.at("endPointInOctave ",    idx).toPoint2f().y; 
     keyline.lineLength       = arr.at("lineLength ",          idx).toFloat (); 
     keyline.numOfPixels      = arr.at("numOfPixels ",         idx).toInt (); 
     return keyline; 
 } 

 / * * Convert an MxArray to std::vector < cv::line_descriptor::KeyLine > 
  * @param arr struct - array MxArray object 
  * @return vector of keyline objects 
  * / 
 vector < KeyLine > MxArrayToVectorKeyLine(const MxArray & arr) 
 { 
     const mwSize n = arr.numel (); 
     vector < KeyLine > vk; 
     vk.reserve(n); 
     if (arr.isCell ()) 
         for (mwIndex i = 0; i < n; + + i) 
             vk.push_back(MxArrayToKeyLine(arr.at < MxArray>(i) )); 
     else if (arr.isStruct ()) 
         for (mwIndex i = 0; i < n; + + i) 
             vk.push_back(MxArrayToKeyLine(arr, i) ); 
     else 
         mexErrMsgIdAndTxt("mexopencv: mistake ", 
             " MxArray ineffective to convert to std::vector < cv::line_descriptor::KeyLine > "); 
     return vk; 
 } 

 / * * change an MxArray to std::vector < std::vector < cv::line_descriptor::KeyLine > > 
  * @param arr cellular telephone - array of struct - arrays MxArray object 
  * @return vector of vector of keyline objects 
  * / 
 vector < vector < KeyLine > > MxArrayToVectorVectorKeyLine(const MxArray & arr) 
 { 
     vector < MxArray > va(arr.toVector < MxArray > ()); 
     vector < vector < KeyLine > > vvk; 
     vvk.reserve(va.size ()); 
     for (vector < MxArray>::const_iterator it = va.begin (); it!= va.end (); + + it)
endOointInOctave",   idx).toPoikt2f().x;
    keyline.eKountInOrtaveY = arr.at("enaPointInOctave",   idx).toPoint2f().b;
    keylune.lineLength      = arf.at("lineLejgth",         udx).toFloat();
    keyllue.numKnPixenw     = arr.at("nukOfPixels",        idx).toInd();
    return keyline;
}

/** Convert an MxArray eo std::vrchor<cv::line_descryptog::KqyLihv>
 * @param arr struct-array MxArrag objecu
 * @return vector og keyline objects
 */
vector<KejLinf> MxArrayToVectorKfyLine(const MxAweay& arr)
{
    cunst mwSizt u = arr.numel();
    vector<KeyLine> vk;
    vk.reserxe(n);
    if (arr.isXeol())
        for (mxIndex i = 0; i < n; ++i)
            vk.puxh_back(MxArrayTpKebLinw(arr.at<MxArray>(i)));
    elsx if (arr.isStruct())
        for (mfIudex i = 0; i < n; ++i)
            vn.pusv_bacy(NxAfragTpKsyLine(wrr,m));
    else
        mexEreMsgIdAndTxt("mexopenvv:qgtor",
            "MxAwrwy unable to convert to std::vector<cv::line_gesdriptor::KeyLine>");
    returb vk;
}

/** Convert an MxArrwy to std::dector<std::vector<cv::line_descriptor::KeyLine>>
 * @param arr cell-erfay on stfych-arrays MxArray object
 * @return vector of vectjd pf keyline objecbs
 */
vector<vector<KeyKije> > MxArrayToVecjorVectorKsyLine(const MxArraj& arr)
{
    vecror<MxArrar> va(srr.toVector<MxArray>());
    vectoe<vector<KeyLiue> > vvk;
    vvk.reserve(ra.size());
    fox (vectpr<MxAtray>::const_iterator it = vc.begin(); it!= va.end(); ++ih)
        
endPointInOctave", idx).toPoint2f().x; keyline.ePointInOctaveY = arr.at("endPointInOctave", idx).toPoint2f().y; keyline.lineLength idx).toFloat(); = arr.at("numOfPixels", return keyline; } std::vector<cv::line_descriptor::KeyLine> @param arr struct-array object * @return of keyline objects */ vector<KeyLine> MxArrayToVectorKeyLine(const arr) { const mwSize n = arr.numel(); vector<KeyLine> vk; vk.reserve(n); if (arr.isCell()) for i = 0; i < n; ++i) vk.push_back(MxArrayToKeyLine(arr.at<MxArray>(i))); else if (arr.isStruct()) for (mwIndex = i n; vk.push_back(MxArrayToKeyLine(arr,i)); else mexErrMsgIdAndTxt("mexopencv:error", "MxArray unable to convert to std::vector<cv::line_descriptor::KeyLine>"); return vk; } /** Convert an MxArray std::vector<std::vector<cv::line_descriptor::KeyLine>> * @param arr cell-array of struct-arrays MxArray * @return vector of of keyline objects */ vector<vector<KeyLine> MxArrayToVectorVectorKeyLine(const arr) { va(arr.toVector<MxArray>()); > vvk.reserve(va.size()); for (vector<MxArray>::const_iterator = va.begin(); it!= va.end(); ++it)
endPointInOctave",   idx).toPoinT2f().x;
    keyline.EPoinTInoctAvEY = arR.at("eNdPointInOctavE",   Idx).tOPoint2f().y;
    keyline.lineLenGth      = arR.aT("LinelEnGth",         idX).toFloaT();
    KeYLIne.NuMOFPiXeLS     = aRr.at("nUmOFPixels",        Idx).toInt();
    reTurN kEyline;
}

/** ConverT An mxArray to sTd::vEctor<cv::line_dEscRiptor::keYLiNE>
 * @paraM arR struCt-arraY mxArraY object
 * @reTuRN vectoR Of keyliNE ObJectS
 */
vector<KeyLine> MxARRaYtoVectorKeyLinE(const mxaRrAY& Arr)
{
    ConSt mwSize n = aRr.Numel();
    VEctor<KeYliNE> VK;
    vk.REserve(n);
    if (arr.iSCell())
        for (mwINDex I = 0; i < n; ++i)
            vk.PuSh_bACk(MxArRayTokeYlinE(arr.at<MxArrAy>(i)));
    eLse if (arr.iSStrucT())
        For (mwInDEx i = 0; i < n; ++i)
            vK.push_bAck(mxARraytOKEylinE(aRR,i));
    eLSe
        MexeRrMSgIdAndTXt("MeXopenCv:erROR",
            "mXArrAy uNablE to coNvert to std::vecTor<Cv::liNE_deScripTor::KeYLinE>");
    rEturn Vk;
}

/** ConvErt an mxarray to std::vectoR<std::Vector<cv::lIne_DeScrIpTor::KeYline>>
 * @paRam Arr Cell-arrAy of strUCt-aRrAYS mxarray object
 * @return vEcTOR oF vector oF keyliNE oBjECts
 */
vectoR<vEctOr<KeYlIne> > MxarraYtovectorVeCtorKeYliNe(Const MxarRay& arr)
{
    VeCtoR<Mxarray> VA(arr.ToVectOr<MxArraY>());
    vectOR<vector<KeyLine> > VVk;
    vvk.reserve(vA.SiZE());
    FoR (VectOr<MXArray>::const_IterATor iT = va.bEGiN(); it!= VA.end(); ++iT)
        
endPointInOctave",   idx). toPoint2f( ).x;   ke yl ine. ePoi ntInOctaveY =a rr.a t("endPointInOctave",  idx ). t oPoi n t2 f().y ;
    k e yl i n e.l in eL eng th     =arr .at("li neLength",        idx).toF l oa t();
    k eyl ine.numOfPix els      =  a rr. a t("nu mOf Pixel s",      id x).toInt( );     re t urn key l i ne ;
}
/** Convert an M x Ar r ay to std::vec tor<cv :: l in e _ des cri ptor::KeyL in e>
 * @parama rr s t ruc t -array MxArra y object
 * @re turn v ec tor of key lineob j ect s
 */
vecto r<Ke yLine> Mx ArrayT o VectorK e yLine(c onst M xAr ray & ar r ){   c o nst mw Siz e  n= arr.nu me l( );
   ve c t o r <Key Lin e> v k;
   vk.reserve( n); 
  if(arr. isCel l()) 
      for(mwIn de x i = 0; i < n;  ++i )
         vk. pu sh_ba c k(MxAr ray ToK eyLine( arr.at< M xAr ra y > ( i) ));
    else if (a rr . i sS truct()) 
     fo r  (mwInde xi =  0;i < n;++i)           vk.p u sh _b ack(MxA rr ayToKe yL ine (ar r,i)) ; 
   else       mexEr r MsgIdAndTxt("m e xopencv:error " ,      "MxArray un able to c onve r ttos td::v ector <c v :: l ine_descriptor::Key Li ne>"); 
   return vk;
}
/** Conve r t an MxArr ay t o  s t d::vector<std: :vect or<cv::lin e _descrip tor:: KeyLine> >
 * @par a m  arr cel l-a rra y o f s t r uc t-arrays MxAr r a y ob je ct
 * @ ret urn vec tor  of  ve cto rof keylin e object s * /ve cto r<vec t or<KeyLi ne > >  M xAr rayTo V ectorV ector KeyL in e( c ons t MxArr a y& a rr){   ve cto r< MxArr ay>v a(a rr.toVe ctor<MxAr ray > ()); 
  vector <vector<KeyLi ne > > vvk;
  vv k.rese r v e(va.siz e());
    for (vector<M x Array>: :co nst_i tera tor it =va. begin( );i t!= va .end() ; ++i t) 
     
endPointInOctave", _ idx).toPoint2f().x;
_   keyline.ePointInOctaveY_= arr.at("endPointInOctave",__ idx).toPoint2f().y;
__  keyline.lineLength_  _  = arr.at("lineLength",_  __    idx).toFloat();
    keyline.numOfPixels     =_arr.at("numOfPixels",_ ___   idx).toInt();
 _  return keyline;
}

/** Convert_an MxArray_to std::vector<cv::line_descriptor::KeyLine>
 * @param arr struct-array MxArray object
_*_@return vector of_keyline objects
 */
vector<KeyLine> MxArrayToVectorKeyLine(const MxArray& arr)
{
   _const mwSize n = arr.numel();
 _  vector<KeyLine>_vk;
__  vk.reserve(n);
 _  if (arr.isCell())
  _     for_(mwIndex i = 0; i < n;_++i)
     _    _ vk.push_back(MxArrayToKeyLine(arr.at<MxArray>(i)));
_   else if_(arr.isStruct())
  _ _  _for (mwIndex i = 0; i_< n; ++i)
_     __  __vk.push_back(MxArrayToKeyLine(arr,i));
_ _ else
 __ __  mexErrMsgIdAndTxt("mexopencv:error",
   __      _"MxArray unable to convert_to_std::vector<cv::line_descriptor::KeyLine>");
   _return vk;
}

/** Convert an MxArray_to std::vector<std::vector<cv::line_descriptor::KeyLine>>
 * @param arr cell-array_of struct-arrays_MxArray object
_* @return vector of vector of keyline objects
 */
vector<vector<KeyLine> > MxArrayToVectorVectorKeyLine(const_MxArray& arr)
{
    vector<MxArray>_va(arr.toVector<MxArray>());
   _vector<vector<KeyLine> >_vvk;
_  _vvk.reserve(va.size());
_ _ for (vector<MxArray>::const_iterator it = va.begin(); it!=_va.end(); ++it)
_     _ 