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主菜單->函數->建立新函數
然後,就可以編輯新的函數了。包括名稱,參數設定等等。設定完成後,應用,确定。
最後編輯完函數後記得儲存。