求外接矩形的四个顶点坐标

 

read_image (Image, '无标题.png')

*方法1进行角点检测
* points_foerstner (Image, 1, 2, 3, 200, 0.3, 'gauss', 'false', RowJunctions, ColumnJunctions, CoRRJunctions, CoRCJunctions, CoCCJunctions, RowArea, ColumnArea, CoRRArea, CoRCArea, CoCCArea)
* gen_cross_contour_xld (Cross, RowJunctions, ColumnJunctions, 46, 0.785398)
* points_harris (Image, 0.7, 2, 0.08, 1000, Row, Column)
* gen_cross_contour_xld (Cross, Row, Column, 6, 0.785398)
threshold (Image, Region, 0, 128)

*方法2
shape_trans (Region, RegionTrans, 'rectangle2')
gen_contour_region_xld (RegionTrans, Contours, 'border')
gen_polygons_xld (Contours, Polygons, 'ramer', 2)
get_polygon_xld (Polygons, Row, Col, Length, Phi)
gen_cross_contour_xld (Cross, Row, Col, 6, Phi)


*方法3拟合出rectangle2
fit_rectangle2_contour_xld (Contours, 'regression', -1, 0, 0, 3, 2, Row1, Column, Phi1, Length1, Length2, PointOrder)
*外部函数
get_rectangle2_points (Row1, Column, Phi1, Length1, Length2, ConerY, ConerX, LineCenterY, LineCenterX)
gen_cross_contour_xld (Cross1, LineCenterY, LineCenterX, 6, Phi)
gen_cross_contour_xld (Cross2, ConerY, ConerX, 6, Phi)

代码下载路径:https://download.csdn.net/download/yue1453544229/11226431

 

添加外部函数的方法,把函数文件放到如下能检索到的目录下,可以自己新建的文件夹目录

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值