HALCON从入门到入门-harris提取关键点-旋转测试算法鲁棒性

测试效果

首先将图像旋转 并识别关键点

接着在原始图像上识别关键点

接着将旋转识别出来的关键点按照旋转的关系 反向旋转回来,看是否和没旋转的图像识别出的关键点重合

可以看到基本都是重合的。

测试代码

* This program illustrates the robustness of the Harris point detector.
* We extract the prominent points, once from the original image and
* once from a rotated image. The points from the rotated image are again
* rotated by the same angle but in the opposite direction. Eventually both sets
* of points are displayed in the same image.
* 
read_image (Image, 'fabrik')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_set_part (0, 0, Height - 1, Width - 1)
* 
if (Width < Height)
    Radius := Width / 2
else
    Radius := Height / 2
endif
gen_circle (Circle, Width / 2, Height / 2, Radius)
* 
SigmaGrad := 3.0
SigmaSmooth := 3.0
Threshold := 1000
* 
RotationAngle := 22.5
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_rotate (HomMat2DIdentity, rad(RotationAngle), Height / 2, Width / 2, HomMat2DRotate)
hom_mat2d_invert (HomMat2DRotate, HomMat2DRotateBack)
* 
affine_trans_image (Image, ImageRotated, HomMat2DRotate, 'constant', 'false')
reduce_domain (ImageRotated, Circle, ImageReduced)
points_harris (ImageReduced, SigmaGrad, SigmaSmooth, 0.04, Threshold, Row, Col)
gen_cross_contour_xld (Temp, Row, Col, 6, rad(45) - rad(RotationAngle))
affine_trans_contour_xld (Temp, Rotated, HomMat2DRotateBack)
* 
reduce_domain (Image, Circle, ImageReduced)
points_harris (ImageReduced, SigmaGrad, SigmaSmooth, 0.04, Threshold, Row, Col)
gen_cross_contour_xld (Original, Row, Col, 4, rad(45))
* 
dev_clear_window ()
dev_display (ImageReduced)
dev_set_color ('yellow')
dev_display (Rotated)
dev_set_color ('red')
dev_display (Original)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黄晓魚

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值