Depthmap01Ab深度图中有NaN值,低版本的halcon 很难处理。好多函数都不能用。经过如下代码处理后的图片,Nan值都变为了其最小有效数值。可以后续处理。
read_image (Depthmap01Ab, ‘G:/项目/褶皱的数据/DepthMap01_AB.tiff’)
get_image_size (Depthmap01Ab, Width1, Height1)
gen_rectangle1 (Rectangle, 0, 0, Height1 - 1, Width1 - 1)
get_region_points (Rectangle, Rows, Columns)
get_grayval (Depthmap01Ab, Rows, Columns, Grayval)
tuple_less_elem (Grayval, 999999999999999.9, Less)
tuple_select_mask (Grayval, Less, Selected)
tuple_max (Selected, Max)
tuple_min(Selected, Min)
threshold (Depthmap01Ab, Region, Min, Max)
complement(Region, RegionComplement)
get_region_points (RegionComplement, Rows1, Columns1)
tuple_length (Rows1, complementLength)
tuple_gen_const (complementLength, Min, Mintuple)
set_grayval (Depthmap01Ab, Rows1, Columns1, Mintuple)
其中tuple_gen_const (complementLength, Min, Mintuple)可以把Min改成你想替换Nan的数字。
halcon处理Nan值
最新推荐文章于 2024-08-02 17:30:46 发布