Image Merge

Description

This operator blends two input images (which must have the same dimensions) at the pixel level according to a specified method to generate a new image.

Overview

Fuses two input images of the same size into a new image according to a specified method.

Scenarios

  • Image Fusion: Overlays two images from different sources or processed differently to create a blended effect, for example, combining the texture of one image with the contour of another.

  • Result Enhancement: When two different algorithm branches generate result images, "Maximum" can be used to merge the two results to highlight all detected features.

  • Background Replacement/Composition: "Weighted Addition" can be used to achieve a semi-transparent blending effect of two images.

Inputs and Outputs

Inputs

Image 1: The first image to be merged.

Image 2: The second image to be merged. Both images must have the same dimensions.

Outputs

Merged Image: The output blended image.

Parameters

Merge Method

Description

Select the specific method used to merge the two input images.

Tuning Instructions

  • Take Maximum: Compares the pixel values of the two images at the same coordinate position and uses the larger pixel value as the output image’s pixel value.

  • Take Minimum: The opposite of the above — compares pixel by pixel and uses the smaller value as the output.

  • Weighted Overlay: A more flexible method that allows different blending effects by adjusting the following weight parameters.

  • Weight of First Image: Range [0,1]; the larger the value, the greater its proportion in the final result, i.e., the more opaque it is.

  • Weight of Second Image: Also in the range [0,1]; the sum of the two images' weights is typically 1, which keeps the overall brightness unchanged. If the sum is greater than 1, the image becomes brighter; if less than 1, it becomes darker.

  • Gamma Coefficient: Range [0,500]; on top of the weighted sum, this adds an extra brightness value to each pixel, which can be used to control the overall brightness of the final composited image.

Parameter Range

Values/Range:

  • Maximum

  • Minimum

  • Weighted Addition

Default: Maximum

First Image Weight

Description

Values range from [0, 1]. The larger the value, the higher the proportion in the final result, i.e., the more opaque it is.

Parameter Range

Values/Range: [0.0, 1.0]

Default: 0.8

Second Image Weight

Description

Values range from [0, 1]. Generally, the sum of the weight coefficients of the two images is 1 to keep the overall brightness unchanged. If the sum is greater than 1, the image becomes brighter; if less than 1, it becomes darker.

Parameter Range

Values/Range: [0.0, 1.0]

Default: 0.2

Grayscale Coefficient

Description

Values range from [0, 500]. An additional brightness value added to each pixel on top of the weighted sum, used to adjust the overall brightness of the final composite image.

Parameter Range

Values/Range: [0.0, 500.0]

Default: 0