1、角点检测有关算子:
points_harris()
proj_match_points_ransac()
gen_projective_mosaic()
2、安装Halcon后下面有很多例程,里面有几个关于拼接的例子,推荐看一下:文件->浏览例程->方法->拼接->mosaicking.hdev。
3、Halcon角点官方自带的测试示例,interest_points_comparison.hdev,
转载一篇文章http://blog.sina.com.cn/s/blog_61cc743001017ss9.html
* This program compares the result of different operators * which detect points of interest * dev_update_off () Dark := 100 Background := 175 Light := 250 Angle := rad(45) Size := 3 create_test_image (Image, Background, Light, Dark) dev_close_window () get_image_size (Image, Width, Height) dev_open_window (0, 0, 512, 512, 'black', WindowHandle) set_display_font (WindowHandle, 16, 'mono', 'true', 'false') dev_set_color ('black') dev_set_line_width (3) * * Foerstner interest points detector points_foerstner (Image, 1, 2, 3, 200, 0.3, 'gauss', 'true', RowJunctions, ColJunctions, CoRRJunctions, CoRCJunctions, CoCCJunctions, RowArea, ColArea, CoRRArea, CoRCArea, CoCCArea) gen_cross_contour_xld (CrossFoerstner, RowJunctions, ColJunctions, Size, Angle) dev_display (Image) dev_display (CrossFoerstner) disp_message (WindowHandle, 'Foerstner interest points detector', 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle, 'black', 'true') stop () * * Harris interest points detector points_harris (Image, 0.7, 2, 0.04, 0, RowHarris, ColHarris) gen_cross_contour_xld (CrossHarris, RowHarris, ColHarris, Size, Angle) dev_display (Image) dev_display (CrossHarris) disp_message (WindowHandle, 'Harris interest points detector', 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle, 'black', 'true') stop () * * Harris binomial interest points detector points_harris_binomial (Image, 5, 15, 0.04, 1000, 'on', RowHarrisBinomial, ColHarrisBinomial) gen_cross_contour_xld (CrossHarrisBinom, RowHarrisBinomial, ColHarrisBinomial, Size, Angle) dev_display (Image) dev_display (CrossHarrisBinom) disp_message (WindowHandle, 'Harris binomial interest points detector', 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle, 'black', 'true') stop () * * Sojka interest points detector points_sojka (Image, 9, 2.5, 0.75, 30, 90, 0.5, 'true', RowSojka, ColSojka) gen_cross_contour_xld (CrossSojka, RowSojka, ColSojka, Size, Angle) dev_display (Image) dev_display (CrossSojka) disp_message (WindowHandle, 'Sojka interest points detector', 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle, 'black', 'true') stop () * * Lepetit interest points detector points_lepetit (Image, 3, 1, 20, 35, 'interpolation', RowLepetit, ColLepetit) gen_cross_contour_xld (CrossLepetit, RowLepetit, ColLepetit, Size, Angle) dev_display (Image) dev_display (CrossLepetit) disp_message (WindowHandle, 'Lepetit interest points detector', 'window', 12, 12, 'black', 'true') 其中,红色的create_test_image (Image, Background, Light, Dark)这个函数为外部函数(即自己所写函数)。具体的过程创建见下一节。 create_test_image 函数程序如下: gen_image_const (Image, 'byte', 256, 280) scale_image (Image, Image, 1, Background) gen_rectangle1 (Rectangle, 40, 40, 80, 80) overpaint_region (Image, Rectangle, Light, 'fill') gen_rectangle1 (Rectangle, 81, 81, 121, 121) overpaint_region (Image, Rectangle, Light, 'fill') gen_rectangle1 (Rectangle, 40, 81, 80, 121) overpaint_region (Image, Rectangle, Dark, 'fill') gen_rectangle1 (Rectangle, 81, 40, 121, 80) overpaint_region (Image, Rectangle, Dark, 'fill') gen_circle (Circle, 160, 40, 2) overpaint_region (Image, Circle, Dark, 'fill') gen_circle (Circle, 160, 100, 4) overpaint_region (Image, Circle, Dark, 'fill') gen_circle (Circle, 160, 160, 6) overpaint_region (Image, Circle, Dark, 'fill') gen_circle (Circle, 220, 40, 6) overpaint_region (Image, Circle, Light, 'fill') gen_circle (Circle, 220, 100, 4) overpaint_region (Image, Circle, Light, 'fill') gen_circle (Circle, 220, 160, 2) overpaint_region (Image, Circle, Light, 'fill') gen_rectangle1 (Rectangle, 140, 220, 240, 222) overpaint_region (Image, Rectangle, Light, 'fill') gen_rectangle1 (Rectangle, 200, 180, 202, 240) overpaint_region (Image, Rectangle, Light, 'fill') gen_rectangle2 (Rectangle, 60, 200, rad(45), 40, 10) overpaint_region (Image, Rectangle, Dark, 'fill') gen_rectangle2 (Rectangle, 60, 200, rad(-45), 40, 10) overpaint_region (Image, Rectangle, Dark, 'fill') return ()
4、Halcon函数调用
HDevelop主菜单->函数->创建新函数
然后,就可以编辑新的函数了。包括名称,参数设置等等。设置完成后,应用,确定。
最后编辑完函数后记得保存。