필터 지우기
필터 지우기

merge image using matlab

조회 수: 25 (최근 30일)
mohammed abdul wadood
mohammed abdul wadood 2018년 4월 4일
댓글: mohammed abdul wadood 2018년 4월 4일
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?

채택된 답변

Amit
Amit 2018년 4월 4일
편집: KSSV 2018년 4월 4일
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)
  댓글 수: 1
mohammed abdul wadood
mohammed abdul wadood 2018년 4월 4일
Thanks, thanks a lot

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2018년 4월 4일
편집: KSSV 2018년 4월 4일
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
mohammed abdul wadood
mohammed abdul wadood 2018년 4월 4일
Thank you for help, I am very Thankful for this.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by