Azzera filtri
Azzera filtri

merge image using matlab

25 visualizzazioni (ultimi 30 giorni)
mohammed abdul wadood
mohammed abdul wadood il 4 Apr 2018
hi, if i have 3 image can i extract one color channel from image (red channel from image 1, green channel from image 2, blue channel from image 3) and merge them in new image?

Risposta accettata

Amit
Amit il 4 Apr 2018
Modificato: KSSV il 4 Apr 2018
Yes you can do this as:
im1= imread('image1.jpg');
im2= imread('image2.jpg');
im3= imread('image3.jpg');
r = im1(:,:,1);
g = im2(:,:,2);
b = im3(:,:,3);
NewImage = cat(3,r,g,b);
imshow(NewImage)

Più risposte (1)

KSSV
KSSV il 4 Apr 2018
Modificato: KSSV il 4 Apr 2018
I1 = imread('image1') ;
I2 = imread('image2') ;
I3 = imread('image3') ;
R = I1(:,:,1) ;
[nx,ny] = size(R) ;
G = imresize(I2(:,:,2),[nx,ny]) ; % in case if the dimensions are different
B = imresize(I3(:,:,3),[nx,ny]) ;
I = cat(3,R,G,B) ;
imshow(I)
  1 Commento
mohammed abdul wadood
mohammed abdul wadood il 4 Apr 2018
Thank you for help, I am very Thankful for this.

Accedi per commentare.

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by