* This program reconstructs the height of a single solder
* ball on a BGA using depth from focus.
*
dev_update_off ()
dev_close_window ()
read_image (Image, 'dff/focus_bga_37')
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
dev_set_paint ('default')
dev_display (Image)
*
* Read the sequence of images
disp_message (WindowHandle, 'Read a sequence of focus images ...', 'image', 20, 20, 'white', 'false')
Sequence := [37:-1:1]
Names := 'dff/focus_bga_' + Sequence$'02'
read_image (ImageArray, Names)
channels_to_image (ImageArray, Image)
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
for Index := 1 to 37 by 1
access_channel (Image, ImageDisp, Index)
dev_display (ImageDisp)
disp_message (WindowHandle, 'DFF sequence of solder ball: image ' + Index$'02', 'image', 20, 20, 'white', 'false')
wait_seconds (0.05)
endfor
*
* Compute the depth map and display results
dev_display (ImageDisp)
disp_message (WindowHandle, 'Compute the depth map', 'image', 20, 20, 'white', 'false')
depth_from_focus (Image, Depth, Confidence, ['bandpass',3,3], 'next_maximum')
scale_image_max (Depth, DepthScaleMax)
select_grayvalues_from_channels (Image, Depth, Sharp)
scale_image (Sharp, ImageScaled, 8, 0)
compose2 (DepthScaleMax, ImageScaled, MultiChannelImage)
dev_clear_window ()
dev_set_paint (['3d_plot','texture'])
dev_display (MultiChannelImage)
disp_message (WindowHandle, '3D reconstruction of a solder ball on a bga', 'image', 20, 280, 'white', 'false')
measure_bga_dff
最新推荐文章于 2024-08-15 22:18:26 发布