How to fuse three images?

16 visualizaciones (últimos 30 días)
Rami
Rami el 1 de Jul. de 2013
Comentada: mohd akmal masud el 20 de Nov. de 2017
I have three images of three object. Object C covers the physical dimensions of objects A and B. I need to show all objects on a single image with diffrent colors. I able to fused two images with object C and A or C and B with following code:
A = imread(1..);
B = imread(2..);
C = imread(3..);
figure; imshow(C,'InitialMag','fit');
green = cat(3, zeros(size(C)),ones(size(C)), zeros(size(C)));
hold on
h = imshow(green);
hold off
% Use 'h' influence map as the AlphaData for the solid green image.
set(h, 'AlphaData', A)
How can I show object A, B and C (diffrent colors on the same image). Any help regarding the same will be appreciable. Thanks

Respuesta aceptada

Jeff E
Jeff E el 1 de Jul. de 2013
I'm reading quite a bit into your question, but it sounds like you have three binary images saved as rgb images.
A = rgb2gray(imread(1..);
B = rgb2gray(imread(2..);
C = rgb2gray(imread(3..);
overlay_im = cat(3, C, A, B);
imshow(overlay_im);
If you post your images, it's more likely you will receive good advice.
  2 comentarios
Rami
Rami el 2 de Jul. de 2013
Thanks Jeff, It worked. next time I will try to write my problem more clearly. Thanks
mohd akmal masud
mohd akmal masud el 20 de Nov. de 2017
Hi every one,
I have 135 slice Image PET(dicom format,size 256x256), and 135 slices images CT(dicom format, size 512x512). My PET image start with name PET001.dcm until PET135.dcm, then my CT image start with name CT001.dcm until CT135.dcm.
First i resize CT image into 256x256. Example:
>>P1=dicomread('PET001,dcm');
>>C1=dicomread('CT001.dcm');
>>C1R=imresize(C1, [256 256]);
then i fuse both image like this:
>>subplot(1,1,1); imshow(P1+C1R);
Can you help me how to combine all the 135 slice image CT and 135 slice image PET in one subplot??

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 1 de Jul. de 2013
Jeff's answer is a good one. You might also take a look at imshowpair() or imfuse() in the Image Processing Toolbox.

Categorías

Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by