You are here : matlabImage Processingimfuse

imfuse() - Image Processing

C = imfuse(A,B) creates
a composite image from two images, A and B.
If A and B are different sizes, imfuse pads
the smaller dimensions with zeros so that both images are the same
size before creating the composite. The output, C,
is a numeric matrix containing a fused version of images A and B.example[C RC] =
imfuse(A,RA,B,RB) creates
a composite image from two images, A and B,
using the spatial referencing information provided in RA and RB.
 The output RC defines the spatial referencing
information for the output fused image C.exampleC = imfuse(___,method) uses
the algorithm specified by method.exampleC = imfuse(___,Name,Value) specifies
additional options with one or more Name,Value pair
arguments, using any of the previous syntaxes.


Syntax

C = imfuse(A,B) example[C RC] =
imfuse(A,RA,B,RB) exampleC = imfuse(___,method) exampleC = imfuse(___,Name,Value) example


Example

Create Overlay Image of Two ImagesLoad an image into the workspace. Create a copy and apply
a rotation offset.A = imread('cameraman.tif');
B = imrotate(A,5,'bicubic','crop');Create blended overlay image, scaling the intensities
of A and B jointly as a single
data set.C = imfuse(A,B,'blend','Scaling','joint');
Save the resulting image as a .png file
and view the fused image.imwrite(C,'my_blend_overlay.png');
imshow(C);
Create Overlay Image Using Color to Distinguish the Areas of Similar Intensity.Load an image into the workspace. Create a copy and apply
a rotation offset.A = imread('cameraman.tif');
B = imrotate(A,5,'bicubic','crop');Create blended overlay image, using red for one image,
green for image B, and yellow for areas of similar intensity between
the two images. C = imfuse(A,B,'falsecolor','Scaling','joint','ColorChannels',[1 2 0]);
Save the resulting image as a .png file
and view the fused image.imwrite(C,'my_blend_red-green.png');
imshow(C)
Create Fused Image of Two Spatially Referenced ImagesLoad an image into the workspace and create a spatial
referencing object associated with it.A = dicomread('knee1.dcm');
RA = imref2d(size(A));Create a second image by resizing image A and
create a spatial referencing object associated with that image.B = imresize(A,2);
RB = imref2d(size(B));Set referencing object parameters to specify the limits
of the coordinates in world coordinates.RB.XWorldLimits = RA.XWorldLimits;
RB.YWorldLimits = RA.YWorldLimits;Create a blended overlay image and view it, using color
to indicate areas of similar intensity. This example uses red for
image A, green for image B, and yellow for areas of similar intensity
between the two images. Note how the images do not appear to share
any areas of similar intensity.C = imfuse(A,B,'falsecolor','Scaling','joint','ColorChannels',[1 2 0]);
imshow(C)

Create a new fused image, this time using the spatial
referencing information in RA and RB,
and view it. In this version, the image appears yellow, because the
images A and B have the same
extent in the world coordinate system. The images actually are aligned,
even though B is twice the size of A.[C,RC] = imfuse(A,RA,B,RB,'ColorChannels',[1 2 0]);


Output / Return Value


Limitations


Alternatives / See Also


Reference