Please help! blending of two images!Error: Matrix dimensions must agree

3 visualizaciones (últimos 30 días)
This is my code to blend two images in MATLAB but I am getting an error which says the matrix dimensions must agree in the 12th line , formula for c. Please help
alpha=1;
a = imread('cameraman.bmp');
dimension = size(a);
figure
imshow(a);
title('Original image of Cameraman');
b = imread('lena512.bmp');
dimension = size(b);
figure
imshow(b);
title('Original image of lena');
c=((1-alpha)*a)+(alpha*b);
imshow(c);
title('Blending of the two images');
  5 comentarios
Aishwarya Bangalore Kumar
Aishwarya Bangalore Kumar el 25 de Abr. de 2018
it shows 512,512 for 1 image and 256,256 for the other

Iniciar sesión para comentar.

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 25 de Abr. de 2018
Editada: KALYAN ACHARJYA el 25 de Abr. de 2018
Add following statement Convert the image b to image a size
b1=imresize(b,[rows colm]);
% Here rows and colm of size of image a
  7 comentarios
KALYAN ACHARJYA
KALYAN ACHARJYA el 25 de Abr. de 2018
Editada: KALYAN ACHARJYA el 25 de Abr. de 2018
I have answered as per your question, I hope the question is answered. For image, its easy, also codes available in net. just check and learn. Still unable then open a new thread again, all community members will help you. First, try?

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by