add_image算子

* This example demonstrates how to add two images with
* the operator 'add_image'.
* 
* 
dev_close_window ()
dev_update_off ()
* 
* Read the two images and cut out a rectangular area
* in each image
read_image (Image1, 'patras')
read_image (Image2, 'brycecanyon1')
*add_image需要两张图片同样大小,因此这里对两种图片都进行同样大小的分割 crop_part (Image1, ImagePart1,
0, 0, 512, 480) crop_part (Image2, ImagePart2, 0, 0, 512, 480) * * Display the two input images for the addition dev_open_window_fit_image (ImagePart1, 0, 0, -1, -1, WindowHandle) set_display_font (WindowHandle, 16, 'mono', 'true', 'false') dev_display (ImagePart1) disp_message (WindowHandle, 'Image 1', 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle, 'black', 'true') stop () dev_display (ImagePart2) disp_message (WindowHandle, 'Image 2', 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle, 'black', 'true') stop () * * Add the two images with factor 0.5 for the gray value * adaption. The resulting image is stored in ImageResult.
*图片加法, add_image (ImagePart1, ImagePart2, ImageResult,
0.5, 0) dev_display (ImageResult) disp_message (WindowHandle, 'Resulting image of the addition', 'window', 12, 12, 'black', 'true')

===================================================

crop_part ( Image : ImagePart : Row, Column, Width, Height : )

剪切出一个长方形的图像

add_image ( Image1, Image2 : ImageResult : Mult, Add : )

两图像相叠加 g' := (g1 + g2) * Mult + Add

posted @ 2020-08-07 16:11  白菜小腾  阅读(509)  评论(0)    收藏  举报