TA的每日心情 | 衰 2020-2-14 06:39 |
---|
签到天数: 3 天 连续签到: 2 天 [LV.2]偶尔看看I


- 积分
- 13

|
51Halcon诚邀您的加入,专注于机器视觉开发与应用技术,我们一直都在努力!
您需要 登录 才可以下载或查看,没有账号?会员注册
x
我怎么才能解决矫正过的图片中的特征对视差图的影响
比如下图中包装袋上的图案被反应进了视差图中。
程序是
##############################################################################
# File generated by HDevelop for text file Version 18.11.1.0
# Non-ASCII strings in this file are encoded in local-8-bit encoding (cp936).
#
# Please note that non-ASCII characters in string constants are exported
# as octal codes in order to guarantee that the strings are correctly
# created on all systems, independent on any compiler settings.
#
##############################################################################
# File generated by HDevelop for text file Version 18.11.1.0
# Non-ASCII strings in this file are encoded in local-8-bit encoding (cp936).
#
# Please note that non-ASCII characters in string constants are exported
# as octal codes in order to guarantee that the strings are correctly
# created on all systems, independent on any compiler settings.
#
# Source files with different encoding should not be mixed in one project.
##############################################################################
# Procedures
# Chapter: Develop
# Short Description: Switch dev_update_pc, dev_update_var and dev_update_window to 'off'.
dev_update_off ()
* This procedure sets different update settings to 'off'.
* This is useful to get the best performance and reduce overhead.
*
dev_update_pc ('off')
dev_update_var ('off')
dev_update_window ('off')
return ()
# Main procedure
* Example program to demonstrate the operator binocular_disparity
*
* A pair of epipolar images (which are already rectified and have parallel,
* horizontal epipolar lines) will be processed.
* --------------------------------------------------------
#*for image_index:= 1 to 3 by 1
dev_update_off ()
dev_close_window ()
Width :=640
Height := 512
dev_open_window (0, 0, Width / 2, Height / 2, 'black', WindowHandle1)
dev_open_window (0, Width / 2 + 12, Width / 2, Height / 2, 'black', WindowHandle2)
dev_open_window (Height / 2 + 62, 0, Width / 2, Height / 2, 'black', WindowHandle3)
* The images to be read:
Path := 'stereo/epipolar/'
*
* read_image (LImage, Path + 'baseball_l')
* read_image (LImage, 'D:/stereo_data/stereo_data/data2/colorleft1.png')
read_image (LImage, '路径')
dev_set_window (WindowHandle1)
dev_display (LImage)
* read_image (RImage, Path + 'baseball_r')
* read_image (RImage, 'D:/stereo_data/stereo_data/data2/colorright1.png')
read_image (RImage, '路径')
*read_image (GImage, '路径')
dev_set_window (WindowHandle2)
dev_display (RImage)
count_seconds (Start)
z := 3
DefaultParameters := ['fast','fast_accurate','accurate','very_accurate']
*binocular_disparity (LImage, RImage, DisparityNCC, Score, 'ncc', 5,5, 0, 64, 164, 2, -0.5, 'none', 'interpolation')
SurfaceSmoothing := [0,10,20,30,40,50,0,0,0,0,0,30]
EdgeSmoothing := [0,0,0,0,0,0,10,20,30,40,50,20]
final_sum_dis := 1000
final_bad_1 := 1000
final_bad_2 := 1000
for I1 := 10 to |SurfaceSmoothing| - 1 by 1
*for I2 := 3 to 21 by 2
for I := -170 to -125 by 1
binocular_disparity_ms (LImage, RImage, DisparityNCC, Score, I, I+140, SurfaceSmoothing[I1], EdgeSmoothing[I1], 'similarity_measure','census_sparse')
*binocular_disparity (LImage, RImage, DisparityNCC, Score, 'ncc', I2, I2,30,I ,I+100, 2, 0.8, 'left_right_check','interpolation')
*get_domain (DisparityNCC, RegionInpainting)
*complement (RegionInpainting, RegionInpainting)
*full_domain (DisparityNCC, DisparityNCC)
* harmonic_interpolation (DisparityNCC, RegionInpainting, DisparityNCC, 0.001)
count_seconds (Stop)
Duration := (Stop - Start) * 1000
* write_image (DisparityNCC, 'png', 0, 'D:/stereo_data/stereo_data/ncc_result/cones_1.png')
DisparityNCC := DisparityNCC
dev_set_window (WindowHandle3)
dev_display (DisparityNCC)
disp_message (WindowHandle3,I1 , 'window', 12, 12, 'black', 'true')
disp_message (WindowHandle3,I, 'window', 24, 24, 'black', 'true')
*dev_display (Score)
endfor
endfor
* write_image (DisparityNCC, 'png', 0, 'D:/stereo_data/stereo_data/ncc_result/cones.png')
|
|