dev_update_off ()
gen_image_const (ImageConstX, 'real', 832, 1500)
gen_image_const (ImageConstY, 'real', 832, 1500)
gen_image_const (ImageConstZ, 'real', 832, 1500)
* Image Acquisition 01: Code generated by Image Acquisition 01
for Index := 0 to 1500 - 1 by 1
read_image (Image, 'cal.bmp')
* Image Acquisition 01: Do something
get_image_size (Image, Width, Height)
gen_rectangle1 (ROI_0, 172, 23, 387, 790)
reduce_domain (Image, ROI_0, Image)
* Z-Map图
threshold (Image, RegionThresh, 200, 255)
opening_rectangle1 (RegionThresh, RegionOpening, 5, 1)
closing_rectangle1 (RegionOpening, RegionClosing, 10, 1)
Points:=[]
for IndexWidth := 1 to Width by 1
gen_region_line (RegionLines1, 0, IndexWidth, Height, IndexWidth)
intersection (RegionClosing, RegionLines1, RegionIntersection)
area_center (RegionIntersection, Area, PointRow, Column)
if (Area==0)
PointInter:=0
else
PointInter:=PointRow
endif
tuple_concat (Points, PointRow, Points)
endfor
for IndexCol := 0 to Width-1 by 1
tuple_greater (Points[IndexCol], 0, Greater)
if (Greater==0)
GrayPoint:=0
else
GrayPoint:=Points[IndexCol]
endif
set_grayval (ImageConstZ, Index, IndexCol, GrayPoint)
endfor
**********************************************
* X-Map图
for IndexWidthX := 1 to Width-1 by 1
set_grayval (ImageConstX, Index, IndexWidthX, IndexWidthX)
endfor
* X-Map图
for IndexWidthX := 1 to Width-1 by 1
set_grayval (ImageConstY, Index, IndexWidthX, Index)
endfor
endfor
xyz_to_object_model_3d (ImageConstX, ImageConstY, ImageConstZ, ObjectModel3D)
dev_open_window (0, 0, 832/2, 1500/2, 'black', WindowHandle)
visualize_object_model_3d (WindowHandle, ObjectModel3D, [], [], ['lut','color_attrib','disp_pose'], ['color1','coord_z','true'], '三摄模组点云图', '', [], PoseOut)
原始图片
重建点云
关注公众号,更多知识内容