aihot  2017-05-08 23:50:46  OpenCV |   查看评论   
    //we make it that the x increases from left to right and  
  •     //y increases from top to bottom  
  •       
  •     //arrange data of the rectangle  
  •     float dist;  
  •     if(x1>x2){  
  •         dist=x2;  
  •         x2=x1;  
  •         x1=dist;  
  •     }  
  •     if(y1>y2){  
  •         dist=y2;  
  •         y2=y1;  
  •         y1=dist;  
  •     }  
  •       
  •     //check whether inscribed square of the cirle and the rectangle cross  
  •     //express the inscribed square with four line which can be expressed by a number  
  •     dist=r/(float)1.4142136;  
  •     float xSquare1=x-dist;  
  •  

    除特别注明外,本站所有文章均为 赢咖4注册 原创,转载请注明出处来自矩形和圆的相交检测 算法分析与实现

    留言与评论(共有 0 条评论)
       
    验证码:
    [lianlun]1[/lianlun]