: c = imshowpair (a, b)
: [c, rc] = imshowpair (a, ra, b, rb)
: c = imshowpair (…, method)
: c = imshowpair (…, name, value)

Combines two images using a specified method. The smaller image gets padded with zeros to match the size of the bigger one. The method is a char array and can have one of the following values:

"falsecolor": Default. Display each image as one (or more) [R G B] channels of the output image. Images can be assigned to the output channels by passing the "ColorChannels" option (see below).

"blend": Combines the images using alpha blending with both images equally transparent.

"checkerboard": Masks both images with a 16x16 checkerboard stretched to fit the output image, each image masked with a negative version of the other’s mask and combines the result. The top left tile contains the top left part of the image a.

"diff": Outputs an image that represents the absolute difference of grayscale versions of the images. The result is also grayscale.

"montage": Places b on the right side of a. This method is useful for comparing a modified image with its original.

Intensities of the images can be scaled before creating c by providing the "Scaling" option which can take one of the following values:

"independent": Default. Intensities of both images are scaled independently of each other.

"joint": Intensities of both images are scaled as if all the pixels belonged to a single image coposed of a and b.

"none": No scaling is applied.

Output of the "falsecolor" method can be further modified by providing the "ColorChannels" option assigning image to one or two output [R G B] channels, given a three-element vector with values 0, 1 or 2, e.g. [0 2 1], that assigns a to the blue channel and b to the green channel. 0 means neither image gets assigned. Accepts also two char-array values that represent shorthands for commonly used vectors: "green-magenta" for [2 1 2] and "red-cyan" for [1 2 2].

When given ra and rb, images are positioned according to their positons in world coordinate system. The output image spans the combined extent of the images. Since both images can have different resolutions in both dimensions, the resolution of the output image in each dimension is the finer resolution of the two. Resulting spatial referencing object is returned as rc.

See also: imfuse.

Package: image